Hello Gordon,

Sorry about the last email, seems like stuff are working now, sort of.
But I think I found another problem, to make sure we are on the same path,
here is my Consumer again:

Queue receiverQ  = session.createQueue("receiverQ; " +
                                "{create:always, auto-delete:true, 
exclusive:true,
node:{x-bindings:[{exchange:'amq.topic', key:'producerQ'}]}}");
MessageConsumer consumer = session.createConsumer(receiverQ);
consumer.setMessageListener(new MyMessageListener());           
while(true){}

And my producer:

String ALTERNATE_EXCHANGE = "amq.topic";
String requestsQueue  ="producerQ34; {create:always,
node:{x-declare:{auto-delete:true, exclusive:true, alternate-exchange:
'"+ALTERNATE_EXCHANGE+"'}}}"; // +
Session session = createSession();
MessageProducer producer =
session.createProducer(session.createQueue(requestsQueue));
TextMessage message      = session.createTextMessage("Some Payload");
producer.send(message);         
Thread.sleep(10 * 1000);

Start broker, start Consumer, start Producer, kill Producer.
Expected: message will come into the Consumer I have.
De facto: It does.

Everything is fine in the case above.

Then, without restarting the broker:

Edit the key in the consumer:

Queue receiverQ  = session.createQueue("receiverQ; " +
                                "{create:always, auto-delete:true, 
exclusive:true,
node:{x-bindings:[{exchange:'amq.topic', key:'123producerQ456'}]}}");

Start Consumer, start Producer, kill Producer.
Expected: because the routing key is different, the message should not come
into the consumer.
De facto : it does.


It looks like the broker does some caching, because if I re-start the
broker, and run the case above(case 2), no message hits my listener.

btw, I can post the code on bitbucket of alike, in case you need it.

I sent the logs also to your email.

Thank You,
Eugene.





--
View this message in context: 
http://apache-qpid-developers.2158895.n2.nabble.com/x-bindings-misunderstanding-tp7583454p7583501.html
Sent from the Apache Qpid developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to