On 12/17/2014 10:45 AM, Wayna Runa wrote:
Hi there again!

I am trying to connect to RabbitMQ queue (AMQP 0-9-1) via custom exchange
using Destination (Binding URL) without success.

I have tried several definitions of "destination", here my JNDI config:

------.------
connectionfactory.myRabbitMQConnectionFactory1 = amqp://admin:xxx@clientid
/DES_DEV?brokerlist='tcp://10.105.135.53:5672'

destination.myDestination1 = direct://ex_test1/rk_test1/q_test1
destination.myDestination2 =
direct://ex_test1//q_test1?autodelete='false'&durable='true'&internal='false'&routingkey='q_test1'
destination.myDestination3 =
direct://ex_test1//q_test1?routingkey='rk_test1'
------.------

Hi,

If you want to send to the exchange, regardless of the bound queues, then don't specify a queue.

destination.myDestination1 = BURL:direct://ex_text1/rk_test1/

If you specify the queue name, somewhere along the line RabbitMQ expects a queue of that name to be pre-bound to the exchange or it drops the message with an error. So the queue name shouldn't be used for sending messages, however, a routing key is expected (even though this isn't clear from any of the Qpid, RabbitMQ, or AMQP docs). The RabbitMQ web management interface is really helpful as it will also show you connections, channels, and queue consumers.

Hope that helps,
Nathan



My Java code is:

---.---.--
System.setProperty("qpid.amqp.version", "0-91");
*System.setProperty("qpid.dest_**syntax", "BURL");*
...
ConnectionFactory connectionFactory = (ConnectionFactory)
context.lookup("myRabbitMQConnectionFactory1");
Connection connection = connectionFactory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

TextMessage message = session.createTextMessage("Hello world - DESTINATION
BURL !!");
Destination destination = (Destination)
context.lookup("myJndiDirectDestination1"); // tested with 1, 2 and
Destination3
MessageProducer messageProducerD = session.createProducer(destination);

messageProducerD.send(message);
...
---.---.---

Here, my custom exchange is "ex_test1" and I have used different values for
routing keys.
I have to created previously the exchange (ex_test1) with different routing
keys, for example:

binding-a) ex_test1 ~> rk_test1 ~> q_test1
binding-b) ex_test1 ~> empty ~> q_test1
binding-c) ex_test1 ~> q_test1 ~> q_test1
binding-d) amq.direct ~> q_test1 ~> q_test1
binding-e) amq.direct ~> rk_test1 ~> q_test1

When running this code, no errors are shown, only *binding-d* and
*binding-e* work and the message is published in RabbitMQ.

They have in the header thw following:

Exchange :   amq.direct
headers:     JMS_QPID_DESTTYPE:    1


What is the correct definition of DESTINATION using custom exchange?

Thanks.


-- wr



____
This email message is a private communication. The information transmitted, 
including attachments, is intended only for the person or entity to which it is 
addressed and may contain confidential, privileged, and/or proprietary 
material. Any review, duplication, retransmission, distribution, or other use 
of, or taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is unauthorized by the sender and is 
prohibited. If you have received this message in error, please contact the 
sender immediately by return email and delete the original message from all 
computer systems. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to