No subject


Tue Apr 12 10:32:41 BST 2011


ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
connection = factory.newConnection();
channel = connection.createChannel();
channel.exchangeDeclare("EX", "topic");
channel.queueDeclare("A", false, false, false, null);
channel.queueBind("A", "EX", "client.something");

Now if I send a message:

[...]
channel.basicPublish("EX", "client.*", null, message.getBytes());

it gets queued in queue A and I can read it with:

[...]
QueueingConsumer consumer = new QueueingConsumer(channel);
channel.basicConsume("A", true, consumer);

Later at t1, two more clients CLIENT1, CLIENT2 show up and declare:
- queues B, C
on the same exchange EX



More information about the rabbitmq-discuss mailing list