[rabbitmq-discuss] Exchange to Exchange Bindings

Yurisleidy Hernández Moya ymoya at uci.cu
Mon Sep 10 21:53:44 BST 2012


I'm testing the Exchange to Exchange Bindings extension but the queue does not receive the messages. any idea why? 
this is my code : 

ConnectionFactory factory = new ConnectionFactory(); 
factory.setHost("localhost"); 
Connection connection = factory.newConnection(); 
Channel channel = connection.createChannel(); 

channel.exchangeDeclare("ex1", "fanout"); 
channel.exchangeDeclare("ex2", "fanout"); 
channel.exchangeBind("ex1", "ex2", ""); 

channel.queueDeclare("queue", false, false, false, null); 
channel.queueBind("queue", "ex2", ""); 

String message = "msg"; 

channel.basicPublish("ex1", "", null, message.getBytes()); 
System.out.println(" [x] Sent '" + message + "'"); 

channel.close(); 
connection.close(); 

regards, 
Yuri 


10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION

http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120910/fd4a02fb/attachment.htm>


More information about the rabbitmq-discuss mailing list