Hello,
In the documentation of Qpid Java Broker 6.0.0, it is mentioned here that
unroutable messages will be discarded eventually.
I have a test where a queue is bound to a topic and a message is sent which
doesn't match the binding filter on purpose. Instead of the message being just
discarded, the sender is receiving an error informing him the message was
rejected.
Is this expected? shouldn't the sender be "warned" instead of getting an
exception?
Another workaround is to implement a "default" queue which will be called from
the alternate exchange but I prefer to check with you this behaviour before
implementing the workaround.
Test caseCreate topic "T"Create queue "Q"Create binding between T and Q using a
binding key BK1Have a consumer listen to QHave a sender send to T a message
with a binding key BK2
Output client-sidejavax.jms.JMSException: Unknown error from remote peer
at
org.apache.qpid.jms.provider.amqp.AmqpSupport.convertToException(AmqpSupport.java:125)
at
org.apache.qpid.jms.provider.amqp.AmqpFixedProducer.processDeliveryUpdates(AmqpFixedProducer.java:232)
at
org.apache.qpid.jms.provider.amqp.AmqpProvider.processUpdates(AmqpProvider.java:804)
at
org.apache.qpid.jms.provider.amqp.AmqpProvider.access$1900(AmqpProvider.java:92)
at
org.apache.qpid.jms.provider.amqp.AmqpProvider$17.run(AmqpProvider.java:701) at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at
java.util.concurrent.FutureTask.run(FutureTask.java:262) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Checking the code of org.apache.qpid.server.exchange.AbstractExchange#send,
when a queue is not found in the routing table of the Exchange and no alternate
exchange is defined, then the message is considered as
org.apache.qpid.amqp_1_0.type.messaging.Rejected. This is what the
org.apache.qpid.amqp_1_0.type.Outcome has as value. Then client side, the code
checks the value of the Outcome and sets an error in case it was rejected.
org.apache.qpid.jms.provider.amqp.AmqpFixedProducer#processDeliveryUpdates}
else if (outcome instanceof Rejected) {
LOG.trace("Outcome of delivery was rejected: {}", delivery);
ErrorCondition remoteError = ((Rejected) outcome).getError();
if (remoteError == null) {
remoteError = getEndpoint().getRemoteCondition();
}
deliveryError = AmqpSupport.convertToException(remoteError);
}
Regards,
Adel Boutroswww.murex.com