private void _validate() throws Exception { if (brokerList == null) throw new ConfigurationException("missing required brokerList"); if (topic == null) throw new ConfigurationException("missing required topic"); if (clientId == null || clientId.length() == 0) clientId = InetAddress.getLocalHost().getHostAddress(); if (acknowledgePolicy != null) { try { ackPolicy = ACK_POLICY.find(acknowledgePolicy); } catch (IllegalArgumentException e) { logger.warn( "invalid acknowledgePolicy value: " + acknowledgePolicy + ". Use default setting " + DEFAULT_ACK_POLICY); ackPolicy = DEFAULT_ACK_POLICY; } catch (Exception e) { logger.warn( "Failed to validate acknowledgePolicy value: " + acknowledgePolicy + " => " + e.getClass().getSimpleName() + ": " + e.getMessage() + ". Use default setting " + DEFAULT_ACK_POLICY); ackPolicy = DEFAULT_ACK_POLICY; } } }
public static ACK_POLICY find(String ack) { return ACK_POLICY.valueOf(ack); }