Repository: camel Updated Branches: refs/heads/camel-2.15.x 9912202b4 -> b657207da refs/heads/master a9f133823 -> a0ae974f9
Add component documentation. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a0ae974f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a0ae974f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a0ae974f Branch: refs/heads/master Commit: a0ae974f9f2009dd47c7c3b491c8272cff4a0e9d Parents: a9f1338 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Apr 15 09:44:21 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Apr 15 10:14:18 2015 +0200 ---------------------------------------------------------------------- .../component/validator/ValidatorEndpoint.java | 21 +++--- .../camel/component/ibatis/IBatisComponent.java | 15 +++- .../camel/component/ibatis/IBatisEndpoint.java | 47 ++++++------ .../component/validator/msv/MsvComponent.java | 3 + .../camel/component/nagios/NagiosComponent.java | 3 + .../component/nagios/NagiosConfiguration.java | 18 +++++ .../camel/component/nagios/NagiosEndpoint.java | 4 ++ .../camel/component/event/EventComponent.java | 3 + .../component/zookeeper/ZooKeeperComponent.java | 3 + .../zookeeper/ZooKeeperConfiguration.java | 75 +++++++++++--------- .../component/zookeeper/ZooKeeperConsumer.java | 2 +- .../component/zookeeper/ZooKeeperEndpoint.java | 4 +- .../component/zookeeper/ZookeeperProducer.java | 6 +- 13 files changed, 134 insertions(+), 70 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java index dc9811a..85096b1 100644 --- a/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java @@ -45,25 +45,26 @@ public class ValidatorEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(ValidatorEndpoint.class); - @UriPath @Metadata(required = "true") + @UriPath(description = "URL to a local resource on the classpath or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.") + @Metadata(required = "true") private String resourceUri; - @UriParam(defaultValue = XMLConstants.W3C_XML_SCHEMA_NS_URI) + @UriParam(defaultValue = XMLConstants.W3C_XML_SCHEMA_NS_URI, description = "Configures the W3C XML Schema Namespace URI.") private String schemaLanguage = XMLConstants.W3C_XML_SCHEMA_NS_URI; - @UriParam + @UriParam(description = "To use a custom javax.xml.validation.SchemaFactory") private SchemaFactory schemaFactory; - @UriParam + @UriParam(description = "To use a custom org.apache.camel.processor.validation.ValidatorErrorHandler. The default error handler captures the errors and throws an exception.") private ValidatorErrorHandler errorHandler = new DefaultValidationErrorHandler(); - @UriParam + @UriParam(description = "Whether DOMSource/DOMResult or SaxSource/SaxResult should be used by the validator.") private boolean useDom; - @UriParam(defaultValue = "true") + @UriParam(defaultValue = "true", description = "Whether the Schema instance should be shared or not. This option is introduced to work around a JDK 1.6.x bug. Xerces should not have this issue.") private boolean useSharedSchema = true; - @UriParam + @UriParam(description = "To use a custom LSResourceResolver") private LSResourceResolver resourceResolver; - @UriParam(defaultValue = "true") + @UriParam(defaultValue = "true", description = "Whether to fail if no body exists.") private boolean failOnNullBody = true; - @UriParam(defaultValue = "true") + @UriParam(defaultValue = "true", description = "Whether to fail if no header exists when validating against a header.") private boolean failOnNullHeader = true; - @UriParam + @UriParam(description = "To validate against a header instead of the message body.") private String headerName; public ValidatorEndpoint() { http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java b/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java index 0d5f63c..157ecbc 100644 --- a/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java +++ b/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java @@ -92,6 +92,9 @@ public class IBatisComponent extends UriEndpointComponent { return sqlMapClient; } + /** + * To use the given {@link com.ibatis.sqlmap.client.SqlMapClient} + */ public void setSqlMapClient(SqlMapClient sqlMapClient) { this.sqlMapClient = sqlMapClient; } @@ -100,6 +103,11 @@ public class IBatisComponent extends UriEndpointComponent { return sqlMapConfig; } + /** + * Location of iBatis xml configuration file. + * <p/> + * The default value is: SqlMapConfig.xml loaded from the classpath + */ public void setSqlMapConfig(String sqlMapConfig) { this.sqlMapConfig = sqlMapConfig; } @@ -107,7 +115,12 @@ public class IBatisComponent extends UriEndpointComponent { public boolean isUseTransactions() { return useTransactions; } - + + /** + * Whether to use transactions. + * <p/> + * This option is by default true. + */ public void setUseTransactions(boolean useTransactions) { this.useTransactions = useTransactions; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java b/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java index af422d8..8cf7791 100644 --- a/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java +++ b/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisEndpoint.java @@ -39,15 +39,16 @@ import org.apache.camel.util.ObjectHelper; public class IBatisEndpoint extends DefaultPollingEndpoint { @UriPath @Metadata(required = "true") private String statement; - @UriParam - private boolean useTransactions; - @UriParam + @UriParam(defaultValue = "true") + private boolean useTransactions = true; + @UriParam(label = "producer") private StatementType statementType; - @UriParam + @UriParam(label = "consumer", defaultValue = "0") private int maxMessagesPerPoll; - @UriParam + @UriParam(label = "consumer") private IBatisProcessingStrategy strategy; - @UriParam + @UriParam(defaultValue = "TRANSACTION_REPEATABLE_READ", + enums = "TRANSACTION_NONE,TRANSACTION_READ_UNCOMMITTED,TRANSACTION_READ_COMMITTED,TRANSACTION_REPEATABLE_READ,TRANSACTION_SERIALIZABLE") private String isolation; public IBatisEndpoint() { @@ -81,48 +82,40 @@ public class IBatisEndpoint extends DefaultPollingEndpoint { return consumer; } - /** - * Gets the iBatis SqlMapClient - */ public SqlMapClient getSqlMapClient() throws IOException { return getComponent().getSqlMapClient(); } - /** - * Gets the IbatisProcessingStrategy to to use when consuming messages from the database - */ public IBatisProcessingStrategy getProcessingStrategy() throws Exception { return strategy; } + /** + * Allows to plugin a custom {@link IBatisProcessingStrategy} to use by the consumer. + */ public void setStrategy(IBatisProcessingStrategy strategy) { this.strategy = strategy; } - /** - * Statement to run when polling or processing - */ public String getStatement() { return statement; } /** - * Statement to run when polling or processing + * The statement name in the iBatis XML mapping file which maps to the query, insert, update or delete operation you wish to evaluate. */ public void setStatement(String statement) { this.statement = statement; } - /** - * Indicates if transactions should be used when calling statements. Useful if using a comma separated list when - * consuming records. - */ public boolean isUseTransactions() { return useTransactions; } /** - * Sets indicator to use transactions for consuming and error handling statements. + * Whether to use transactions. + * <p/> + * This option is by default true. */ public void setUseTransactions(boolean useTransactions) { this.useTransactions = useTransactions; @@ -132,6 +125,9 @@ public class IBatisEndpoint extends DefaultPollingEndpoint { return statementType; } + /** + * Mandatory to specify for the producer to control which kind of operation to invoke. + */ public void setStatementType(StatementType statementType) { this.statementType = statementType; } @@ -140,6 +136,12 @@ public class IBatisEndpoint extends DefaultPollingEndpoint { return maxMessagesPerPoll; } + /** + * This option is intended to split results returned by the database pool into the batches and deliver them in multiple exchanges. + * This integer defines the maximum messages to deliver in single exchange. By default, no maximum is set. + * Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. + * Set a value of 0 or negative to disable it. + */ public void setMaxMessagesPerPoll(int maxMessagesPerPoll) { this.maxMessagesPerPoll = maxMessagesPerPoll; } @@ -148,6 +150,9 @@ public class IBatisEndpoint extends DefaultPollingEndpoint { return isolation; } + /** + * Transaction isolation level + */ public void setIsolation(String isolation) throws Exception { this.isolation = isolation; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-msv/src/main/java/org/apache/camel/component/validator/msv/MsvComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-msv/src/main/java/org/apache/camel/component/validator/msv/MsvComponent.java b/components/camel-msv/src/main/java/org/apache/camel/component/validator/msv/MsvComponent.java index 03b3c00..3539d09 100644 --- a/components/camel-msv/src/main/java/org/apache/camel/component/validator/msv/MsvComponent.java +++ b/components/camel-msv/src/main/java/org/apache/camel/component/validator/msv/MsvComponent.java @@ -47,6 +47,9 @@ public class MsvComponent extends ValidatorComponent { return schemaFactory; } + /** + * To use the {@link javax.xml.validation.SchemaFactory}. + */ public void setSchemaFactory(SchemaFactory schemaFactory) { this.schemaFactory = schemaFactory; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java index 62258a0..c86e347 100644 --- a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java +++ b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java @@ -56,6 +56,9 @@ public class NagiosComponent extends UriEndpointComponent { return configuration; } + /** + * To use a shared {@link NagiosConfiguration} + */ public void setConfiguration(NagiosConfiguration configuration) { this.configuration = configuration; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java index 319ab3d..e4d29ef 100644 --- a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java +++ b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java @@ -112,6 +112,9 @@ public class NagiosConfiguration implements Cloneable { return host; } + /** + * This is the address of the Nagios host where checks should be send. + */ public void setHost(String host) { this.host = host; } @@ -120,6 +123,9 @@ public class NagiosConfiguration implements Cloneable { return port; } + /** + * The port number of the host. + */ public void setPort(int port) { this.port = port; } @@ -128,6 +134,9 @@ public class NagiosConfiguration implements Cloneable { return connectionTimeout; } + /** + * Connection timeout in millis. + */ public void setConnectionTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; } @@ -136,6 +145,9 @@ public class NagiosConfiguration implements Cloneable { return timeout; } + /** + * Sending timeout in millis. + */ public void setTimeout(int timeout) { this.timeout = timeout; } @@ -144,6 +156,9 @@ public class NagiosConfiguration implements Cloneable { return password; } + /** + * Password to be authenticated when sending checks to Nagios. + */ public void setPassword(String password) { this.password = password; } @@ -152,6 +167,9 @@ public class NagiosConfiguration implements Cloneable { return encryptionMethod; } + /** + * To specify an encryption method. + */ public void setEncryptionMethod(NagiosEncryptionMethod encryptionMethod) { this.encryptionMethod = encryptionMethod; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java index 70a292b..20184ee 100644 --- a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java +++ b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java @@ -72,6 +72,10 @@ public class NagiosEndpoint extends DefaultEndpoint { return sendSync; } + /** + * Whether or not to use synchronous when sending a passive check. + * Setting it to false will allow Camel to continue routing the message and the passive check message will be send asynchronously. + */ public void setSendSync(boolean sendSync) { this.sendSync = sendSync; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-spring/src/main/java/org/apache/camel/component/event/EventComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/component/event/EventComponent.java b/components/camel-spring/src/main/java/org/apache/camel/component/event/EventComponent.java index 779a63f..1e91dab 100644 --- a/components/camel-spring/src/main/java/org/apache/camel/component/event/EventComponent.java +++ b/components/camel-spring/src/main/java/org/apache/camel/component/event/EventComponent.java @@ -52,6 +52,9 @@ public class EventComponent extends UriEndpointComponent implements ApplicationC return applicationContext; } + /** + * The Spring ApplicationContext + */ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java index 8681f8f..e104a9b 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java @@ -73,6 +73,9 @@ public class ZooKeeperComponent extends UriEndpointComponent { return configuration; } + /** + * To use a shared {@link ZooKeeperConfiguration} + */ public void setConfiguration(ZooKeeperConfiguration configuration) { this.configuration = configuration; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java index 89b43a8..66a9e74 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java @@ -36,8 +36,6 @@ import org.apache.camel.util.CollectionStringBuffer; @UriParams public class ZooKeeperConfiguration implements Cloneable { - private transient boolean changed; - @UriPath @Metadata(required = "true") private String serverUrls; private List<String> servers; @@ -45,19 +43,20 @@ public class ZooKeeperConfiguration implements Cloneable { private String path; @UriParam(defaultValue = "5000") private int timeout = 5000; - @UriParam(defaultValue = "5000") + @UriParam(label = "consumer", defaultValue = "5000") private long backoff = 5000; @UriParam(defaultValue = "true") + @Deprecated private boolean awaitExistence = true; - @UriParam + @UriParam(label = "consumer") private boolean repeat; @UriParam private boolean listChildren; - @UriParam - private boolean shouldCreate; - @UriParam + @UriParam(label = "producer") + private boolean create; + @UriParam(label = "producer", enums = "PERSISTENT,PERSISTENT_SEQUENTIAL,EPHEMERAL,EPHEMERAL_SEQUENTIAL", defaultValue = "EPHEMERAL") private String createMode; - @UriParam(defaultValue = "true") + @UriParam(label = "consumer", defaultValue = "true") private boolean sendEmptyMessageOnDelete = true; public void addZookeeperServer(String server) { @@ -65,7 +64,14 @@ public class ZooKeeperConfiguration implements Cloneable { servers = new ArrayList<String>(); } servers.add(server); - changed = true; + } + + public ZooKeeperConfiguration copy() { + try { + return (ZooKeeperConfiguration)clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeCamelException(e); + } } public List<String> getServers() { @@ -94,27 +100,24 @@ public class ZooKeeperConfiguration implements Cloneable { return timeout; } + /** + * The time interval to wait on connection before timing out. + */ public void setTimeout(int timeout) { this.timeout = timeout; - changed = true; } public boolean isListChildren() { return listChildren; } + /** + * Whether the children of the node should be listed + */ public void setListChildren(boolean listChildren) { this.listChildren = listChildren; } - public void clearChanged() { - changed = false; - } - - public boolean isChanged() { - return changed; - } - public String getConnectString() { StringBuilder b = new StringBuilder(); for (String server : servers) { @@ -126,7 +129,7 @@ public class ZooKeeperConfiguration implements Cloneable { } /** - * The zookeeper path + * The node in the ZooKeeper server (aka znode) */ public void setPath(String path) { this.path = path; @@ -136,22 +139,17 @@ public class ZooKeeperConfiguration implements Cloneable { return path; } - public boolean shouldRepeat() { + public boolean isRepeat() { return repeat; } + /** + * Should changes to the znode be 'watched' and repeatedly processed. + */ public void setRepeat(boolean repeat) { this.repeat = repeat; } - public ZooKeeperConfiguration copy() { - try { - return (ZooKeeperConfiguration)clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeCamelException(e); - } - } - /** * @deprecated The usage of this option has no effect at all. */ @@ -161,6 +159,7 @@ public class ZooKeeperConfiguration implements Cloneable { } /** + * Not in use * @deprecated The usage of this option has no effect at all. */ @Deprecated @@ -172,22 +171,31 @@ public class ZooKeeperConfiguration implements Cloneable { return backoff; } + /** + * The time interval to backoff for after an error before retrying. + */ public void setBackoff(long backoff) { this.backoff = backoff; } - public void setCreate(boolean shouldCreate) { - this.shouldCreate = shouldCreate; + public boolean isCreate() { + return create; } - public boolean shouldCreate() { - return shouldCreate; + /** + * Should the endpoint create the node if it does not currently exist. + */ + public void setCreate(boolean shouldCreate) { + this.create = shouldCreate; } public String getCreateMode() { return createMode; } + /** + * The create mode that should be used for the newly created node + */ public void setCreateMode(String createMode) { this.createMode = createMode; } @@ -196,6 +204,9 @@ public class ZooKeeperConfiguration implements Cloneable { return sendEmptyMessageOnDelete; } + /** + * Upon the delete of a znode, should an empty message be send to the consumer + */ public void setSendEmptyMessageOnDelete(boolean sendEmptyMessageOnDelete) { this.sendEmptyMessageOnDelete = sendEmptyMessageOnDelete; } http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java index 0c43de1..7fe40d5 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java @@ -154,7 +154,7 @@ public class ZooKeeperConsumer extends DefaultConsumer { handleException(e); backoffAndThenRestart(); } finally { - if (configuration.shouldRepeat()) { + if (configuration.isRepeat()) { try { operations.offer(current.createCopy()); } catch (Exception e) { http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java index b7fd9ee..64272ca 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java @@ -119,7 +119,7 @@ public class ZooKeeperEndpoint extends DefaultEndpoint { @ManagedAttribute public boolean getRepeat() { - return getConfiguration().shouldRepeat(); + return getConfiguration().isRepeat(); } @ManagedAttribute @@ -149,7 +149,7 @@ public class ZooKeeperEndpoint extends DefaultEndpoint { @ManagedAttribute public boolean getCreate() { - return getConfiguration().shouldCreate(); + return getConfiguration().isCreate(); } @ManagedAttribute http://git-wip-us.apache.org/repos/asf/camel/blob/a0ae974f/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java index a9b84dc..d147b4f 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java @@ -172,7 +172,7 @@ public class ZookeeperProducer extends DefaultProducer { public void processResult(int rc, String node, Object ctx, Stat statistics) { if (Code.NONODE.equals(Code.get(rc))) { - if (configuration.shouldCreate()) { + if (configuration.isCreate()) { log.warn(format("Node '%s' did not exist, creating it...", node)); ProductionContext context = (ProductionContext)ctx; OperationResult<String> result = null; @@ -234,7 +234,7 @@ public class ZookeeperProducer extends DefaultProducer { OperationResult result = setData.get(); - if (!result.isOk() && configuration.shouldCreate() && result.failedDueTo(Code.NONODE)) { + if (!result.isOk() && configuration.isCreate() && result.failedDueTo(Code.NONODE)) { log.warn(format("Node '%s' did not exist, creating it.", ctx.node)); result = createNode(ctx); } @@ -247,7 +247,7 @@ public class ZookeeperProducer extends DefaultProducer { OperationResult result = setData.get(); - if (!result.isOk() && configuration.shouldCreate() && result.failedDueTo(Code.NONODE)) { + if (!result.isOk() && configuration.isCreate() && result.failedDueTo(Code.NONODE)) { log.warn(format("Node '%s' did not exist, creating it.", ctx.node)); result = createNode(ctx); }