Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C55C6171C0 for ; Wed, 1 Oct 2014 09:01:45 +0000 (UTC) Received: (qmail 90504 invoked by uid 500); 1 Oct 2014 09:01:45 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 90457 invoked by uid 500); 1 Oct 2014 09:01:45 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 90446 invoked by uid 99); 1 Oct 2014 09:01:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2014 09:01:44 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of ondrej.fialka@gmail.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2014 09:01:19 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XZFmg-000434-BC for users@camel.apache.org; Wed, 01 Oct 2014 02:01:18 -0700 Date: Wed, 1 Oct 2014 02:01:18 -0700 (PDT) From: Ondrej_Fialka To: users@camel.apache.org Message-ID: <1412154078307-5757266.post@n5.nabble.com> Subject: How to set QPID parameters (e.g. durable=true) to Camel AMQPComponent? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello, Can I ask for help, please? I use Camel to route messages between various email, ftp and web service endpoints. I want to add AMQP support as well. Recently I use RabbitMQ but I want the application to handle any AMQP 0.9.1 broker. The problem is I did nor find any way how to set parameters like /durable=true/ to the AMQPComponent. I know QPID can use these parameters, but don't know how to pass them from Camel to QPID. If I want to connect to a durable queue it fails on incompatible parameters. This is because AMQP Component is inherited from JMSComponent and this component does not accept the necessary parameters. I construct the connection dynamically as Spring bean from configuration file (this works): / String CONNECTION_STRING = "amqp://%s:%s@%s/%s?brokerlist='tcp://%s:%s'"; ... amqpFactoryName = "amqConnectionFactory-" + code; endpointPrefix = "amqp-" + code; constructorArguments.addIndexedArgumentValue(0, connectionString, "java.lang.String"); amqpConnectionFactoryBeanDefinition.setConstructorArgumentValues(constructorArguments); amqpConnectionFactoryBeanDefinition.setAutowireCandidate(true); registry.registerBeanDefinition(amqpFactoryName, amqpConnectionFactoryBeanDefinition); GenericBeanDefinition amqpComponenetBeanDefinition = new GenericBeanDefinition(); amqpComponenetBeanDefinition.setBeanClass(AMQPComponent.class); amqpComponenetBeanDefinition.setAutowireCandidate(true); MutablePropertyValues values = new MutablePropertyValues(); values.addPropertyValue("connectionFactory", new RuntimeBeanReference(amqpFactoryName)); amqpComponenetBeanDefinition.setPropertyValues(values); registry.registerBeanDefinition(endpointPrefix, amqpComponenetBeanDefinition);/ The Camel route is defined like this: /from("amqp-in://BURL:direct://amq.direct//MyQueue") .to(...)/ This works well. But if the queue I want to connect to is durable, I tried: /amqp-in://BURL:direct://amq.direct//MyQueue?durable=true/ this fails: /Failed to resolve endpoint: amqp-IN://BURL:direct://amq.direct//MyQueue?durable=true There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{durable=true}]/ I found out why it fails, but don't know how to make it work. Is there any way to set the paramaters to the underlying QPID component? Or a different way to solve this? As I sad, I would like to use generic AMQP approach, not just RabbitMQ. Thank you, any help is appreciated. Ondrej -- View this message in context: http://camel.465427.n5.nabble.com/How-to-set-QPID-parameters-e-g-durable-true-to-Camel-AMQPComponent-tp5757266.html Sent from the Camel - Users mailing list archive at Nabble.com.