Repository: camel Updated Branches: refs/heads/master d0a6c0d8f -> 5f0b1f41e
CAMEL-10759 Deprecated rabbitmq set arg properties Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5f0b1f41 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5f0b1f41 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5f0b1f41 Branch: refs/heads/master Commit: 5f0b1f41e123f342937c2a8ecf5bd2323c64036e Parents: c124332 Author: Paul Watson <paul.wat...@pdwtech.com> Authored: Mon Feb 13 09:48:26 2017 +0000 Committer: Claus Ibsen <davscl...@apache.org> Committed: Mon Feb 13 11:00:59 2017 +0100 ---------------------------------------------------------------------- .../src/main/docs/rabbitmq-component.adoc | 2 +- .../component/rabbitmq/RabbitMQEndpoint.java | 62 ++++++++++++-------- 2 files changed, 40 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/5f0b1f41/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc b/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc index 019d877..0c98d78 100644 --- a/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc +++ b/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc @@ -89,7 +89,7 @@ The RabbitMQ component supports 60 endpoint options which are listed below: | publisherAcknowledgements | producer | false | boolean | When true the message will be published with publisher acknowledgements turned on | publisherAcknowledgementsTimeout | producer | | long | The amount of time in milliseconds to wait for a basic.ack response from RabbitMQ server | addresses | advanced | | Address[] | If this option is set camel-rabbitmq will try to create connection based on the setting of option addresses. The addresses value is a string which looks like server1:12345 server2:12345 -| args | advanced | | Map | Specify arguments for configuring the different RabbitMQ concepts a different prefix is required for each: Queue: arg.queue. Exchange: arg.exchange. Binding: arg.binding. For example to declare a queue with message ttl argument: http://localhost:5672/exchange/queueargs=arg.queue.x-message-ttl=60000 +| args | advanced | | Map | Specify arguments for configuring the different RabbitMQ concepts a different prefix is required for each: Exchange: arg.exchange. Queue: arg.queue. Binding: arg.binding. For example to declare a queue with message ttl argument: http://localhost:5672/exchange/queueargs=arg.queue.x-message-ttl=60000 | automaticRecoveryEnabled | advanced | | Boolean | Enables connection automatic recovery (uses connection implementation that performs automatic recovery when connection shutdown is not initiated by the application) | bindingArgs | advanced | | Map | Key/value args for configuring the queue binding parameters when declare=true | clientProperties | advanced | | Map | Connection client properties (client info used in negotiating with the server) http://git-wip-us.apache.org/repos/asf/camel/blob/5f0b1f41/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java index 83991f3..ddfdfe8 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java @@ -143,17 +143,22 @@ public class RabbitMQEndpoint extends DefaultEndpoint implements AsyncEndpoint { private boolean mandatory; @UriParam(label = "producer") private boolean immediate; + @UriParam(label = "advanced", prefix = "arg.", multiValue = true) + private Map<String, Object> args; @UriParam(label = "advanced") + @Deprecated private Map<String, Object> exchangeArgs = new HashMap<>(); @UriParam(label = "advanced") + @Deprecated private Map<String, Object> queueArgs = new HashMap<>(); @UriParam(label = "advanced") + @Deprecated private Map<String, Object> bindingArgs = new HashMap<>(); - @UriParam(label = "advanced", prefix = "arg.", multiValue = true) - private Map<String, Object> args; @UriParam(label = "advanced") + @Deprecated private ArgsConfigurer queueArgsConfigurer; @UriParam(label = "advanced") + @Deprecated private ArgsConfigurer exchangeArgsConfigurer; @UriParam(label = "advanced") private long requestTimeout = 20000; @@ -765,8 +770,32 @@ public class RabbitMQEndpoint extends DefaultEndpoint implements AsyncEndpoint { } /** + * Specify arguments for configuring the different RabbitMQ concepts, a different prefix is + * required for each: + * <ul> + * <li>Exchange: arg.exchange.</li> + * <li>Queue: arg.queue.</li> + * <li>Binding: arg.binding.</li> + * </ul> + * For example to declare a queue with message ttl argument: + * + * http://localhost:5672/exchange/queue?args=arg.queue.x-message-ttl=60000 + * + */ + public void setArgs(Map<String, Object> args) { + this.args = args; + } + + public Map<String, Object> getArgs() { + return args; + } + + /** * Key/value args for configuring the exchange parameters when declare=true + * + * @Deprecated Use args instead e.g arg.exchange.x-message-ttl=1000 */ + @Deprecated public void setExchangeArgs(Map<String, Object> exchangeArgs) { this.exchangeArgs = exchangeArgs; } @@ -777,6 +806,8 @@ public class RabbitMQEndpoint extends DefaultEndpoint implements AsyncEndpoint { /** * Key/value args for configuring the queue parameters when declare=true + * + * @Deprecated Use args instead e.g arg.queue.x-message-ttl=1000 */ public void setQueueArgs(Map<String, Object> queueArgs) { this.queueArgs = queueArgs; @@ -788,6 +819,8 @@ public class RabbitMQEndpoint extends DefaultEndpoint implements AsyncEndpoint { /** * Key/value args for configuring the queue binding parameters when declare=true + * + * @Deprecated Use args instead e.g arg.binding.foo=bar */ public void setBindingArgs(Map<String, Object> bindingArgs) { this.bindingArgs = bindingArgs; @@ -797,33 +830,14 @@ public class RabbitMQEndpoint extends DefaultEndpoint implements AsyncEndpoint { return bindingArgs; } - /** - * Specify arguments for configuring the different RabbitMQ concepts, a different prefix is - * required for each: - * <ul> - * <li>Queue: arg.queue.</li> - * <li>Exchange: arg.exchange.</li> - * <li>Binding: arg.binding.</li> - * </ul> - * For example to declare a queue with message ttl argument: - * - * http://localhost:5672/exchange/queue?args=arg.queue.x-message-ttl=60000 - * - */ - public void setArgs(Map<String, Object> args) { - this.args = args; - } - - public Map<String, Object> getArgs() { - return args; - } - public ArgsConfigurer getQueueArgsConfigurer() { return queueArgsConfigurer; } /** * Set the configurer for setting the queue args in Channel.queueDeclare + * + * @Deprecated Use args instead e.g arg.queue.x-message-ttl=1000 */ public void setQueueArgsConfigurer(ArgsConfigurer queueArgsConfigurer) { this.queueArgsConfigurer = queueArgsConfigurer; @@ -835,6 +849,8 @@ public class RabbitMQEndpoint extends DefaultEndpoint implements AsyncEndpoint { /** * Set the configurer for setting the exchange args in Channel.exchangeDeclare + * + * @Deprecated Use args instead e.g arg.exchange.x-message-ttl=1000 */ public void setExchangeArgsConfigurer(ArgsConfigurer exchangeArgsConfigurer) { this.exchangeArgsConfigurer = exchangeArgsConfigurer;