Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.1.0
-
None
-
JMS 0.2.0-SNAPSHOT, Qpid C++ broker 0.32
Description
When a link is refused by the peer because a node is not found, the client throws nice exception which contains the error:
javax.jms.InvalidDestinationException: Node not found: broadcast.ABCFR_ABCFRALMMACC1.Workflow [condition = amqp:not-found]
at org.apache.qpid.jms.provider.amqp.AmqpAbstractResource.getRemoteError(AmqpAbstractResource.java:243)
at org.apache.qpid.jms.provider.amqp.AmqpAbstractResource.processRemoteClose(AmqpAbstractResource.java:295)
at org.apache.qpid.jms.provider.amqp.AmqpProvider.processUpdates(AmqpProvider.java:739)
at org.apache.qpid.jms.provider.amqp.AmqpProvider.access$1300(AmqpProvider.java:85)
at org.apache.qpid.jms.provider.amqp.AmqpProvider$16.run(AmqpProvider.java:655)
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:745)
However, when the "established" link is detached for different reasons, the client throws only general exception which doesn't contain the error the peer sent with the detach. Such exception is not so useful without the error, because it doesn't tell what actually happened:
javax.jms.IllegalStateException: The MessageConsumer is closed
at org.apache.qpid.jms.JmsMessageConsumer.checkClosed(JmsMessageConsumer.java:251)
at org.apache.qpid.jms.JmsMessageConsumer.receive(JmsMessageConsumer.java:220)
at cz.scholz.qpid.jms.amqp10.BroadcastReceiver.main(BroadcastReceiver.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
The examples when the error is missing in the exception when communicating with the Qpid C++ broker are for example:
- ACL errors
2015-04-12 20:20:06 [Protocol] trace [qpid.192.168.1.174:10000-192.168.1.241:62927]: 1 -> @detach(22) [handle=0, closed=true, error=@error(29) [condition=:"amqp:unauthorized-access", description="ACL denied access request to broadcast.ABCFR_ABCFRALMMACC1.WorkflowX from ABCFR_ABCFRALMMACC1@QPID0000 (/home/scholzj/amqp/qpid-cpp-0.32/src/qpid/broker/amqp/Authorise.cpp:144)"]]
- Deletion of the node which is consumed:
2015-04-12 20:13:41 [Protocol] trace [qpid.192.168.1.174:10000-192.168.1.241:62873]: 1 -> @detach(22) [handle=0, closed=true, error=@error(29) [condition=:"amqp:resource-deleted", description="resource-deleted: Queue broadcast.ABCFR_ABCFRALMMACC1.Workflow has been deleted. (/home/scholzj/amqp/qpid-cpp-0.32/src/qpid/broker/Queue.cpp:1547)"]]
Can the error which caused the link to be detached be always part of the exceptions?