[
https://issues.apache.org/jira/browse/QPID-6701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14703817#comment-14703817
]
Keith Wall edited comment on QPID-6701 at 8/19/15 10:06 PM:
------------------------------------------------------------
Against the Java Broker with a 0-30 client, the underlying exception reports
"The name 'non-existing-node' supplied in the address doesn't resolve to an
exchange or a queue". The pertinent part of the code is
AMQSession#resolveAddress which identifies dest as of type 1 (QUEUE_TYPE), but
then the control falls all the way through the switch to hit the default and
throw the AMQException. The exception bubbles up as AMQException " Exception
occured while verifying destination" and finally as a JMSException "Error
creating producer".
{noformat}
Exception in thread "main" javax.jms.JMSException: Error creating producer
at
org.apache.qpid.client.AMQSession.toJMSException(AMQSession.java:3719)
at
org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:696)
at
org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:69)
at org.apache.qpid.client.AMQSession$7.execute(AMQSession.java:2791)
at org.apache.qpid.client.AMQSession$7.execute(AMQSession.java:2782)
at
org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:371)
at
org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:652)
at
org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:96)
at
org.apache.qpid.client.AMQSession.createProducerImpl(AMQSession.java:2780)
at
org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:1305)
at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:97)
at org.apache.qpid.example.Spout.<init>(Spout.java:91)
at org.apache.qpid.example.Spout.main(Spout.java:147)
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:140)
Caused by: org.apache.qpid.AMQException: Exception occured while verifying
destination
at
org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:96)
at
org.apache.qpid.client.BasicMessageProducer.<init>(BasicMessageProducer.java:139)
at
org.apache.qpid.client.BasicMessageProducer_0_10.<init>(BasicMessageProducer_0_10.java:65)
at
org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:691)
... 16 more
Caused by: org.apache.qpid.AMQException: The name 'nonexistent' supplied in the
address doesn't resolve to an exchange or a queue
at org.apache.qpid.client.AMQSession.resolveAddress(AMQSession.java:722)
at
org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:90)
... 19 more
{noformat}
QPID-6040 (rev 1620659) changed the algorithm in AMQSession#resolveAddress so
that the two switch blocks (QUEUE_TYPE and TOPIC_TYPE) to 'break' regardless of
whether they consider the destination to be resolved. It is not immediately
clear to me why QPID-6040 required this, but I see that currently
AddressBasedDestinationTest will fail (against the Java Broker - with "The name
'$virtualhostProperties' supplied in the address doesn't resolve to an exchange
or a queue") if this part is reverted.
https://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?r1=1620659&r2=1620658&pathrev=1620659
was (Author: k-wall):
Against the Java Broker with a 0-30 client, the underlying exception reports
"The name 'non-existing-node' supplied in the address doesn't resolve to an
exchange or a queue". The pertinent part of the code is
AMQSession#resolveAddress which identifies dest as of type 1 (QUEUE_TYPE), but
then the control falls all the way through the switch to hit the default and
throw the AMQException. The exception bubbles up as AMQException " Exception
occured while verifying destination" and finally as a JMSException "Error
creating producer".
{noformat}
Exception in thread "main" javax.jms.JMSException: Error creating producer
at
org.apache.qpid.client.AMQSession.toJMSException(AMQSession.java:3719)
at
org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:696)
at
org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:69)
at org.apache.qpid.client.AMQSession$7.execute(AMQSession.java:2791)
at org.apache.qpid.client.AMQSession$7.execute(AMQSession.java:2782)
at
org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:371)
at
org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:652)
at
org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:96)
at
org.apache.qpid.client.AMQSession.createProducerImpl(AMQSession.java:2780)
at
org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:1305)
at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:97)
at org.apache.qpid.example.Spout.<init>(Spout.java:91)
at org.apache.qpid.example.Spout.main(Spout.java:147)
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:140)
Caused by: org.apache.qpid.AMQException: Exception occured while verifying
destination
at
org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:96)
at
org.apache.qpid.client.BasicMessageProducer.<init>(BasicMessageProducer.java:139)
at
org.apache.qpid.client.BasicMessageProducer_0_10.<init>(BasicMessageProducer_0_10.java:65)
at
org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:691)
... 16 more
Caused by: org.apache.qpid.AMQException: The name 'nonexistent' supplied in the
address doesn't resolve to an exchange or a queue
at org.apache.qpid.client.AMQSession.resolveAddress(AMQSession.java:722)
at
org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:90)
... 19 more
{noformat}
QPID-6040 (rev 1620659) changed the algorithm in AMQSession#resolveAddress so
that the two switch blocks (QUEUE_TYPE and TOPIC_TYPE) 'break' regardless of
whether they consider the destination to be resolved. It is not immediately
clear to me why QPID-6040 required this, but I see that currently
AddressBasedDestinationTest will fail (against the Java Broker - with "The name
'$virtualhostProperties' supplied in the address doesn't resolve to an exchange
or a queue") if this part is reverted.
https://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?r1=1620659&r2=1620658&pathrev=1620659
> [Regression btw 0.30 - 0.32] If address doesn't resolve an exception is not
> thrown
> ----------------------------------------------------------------------------------
>
> Key: QPID-6701
> URL: https://issues.apache.org/jira/browse/QPID-6701
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Affects Versions: 0.32
> Reporter: Rajith Attapattu
> Assignee: Keith Wall
> Priority: Blocker
> Fix For: qpid-java-6.0
>
>
> If you run "java -cp $CP org.apache.qpid.example.Spout non-existing-node",
> 1. In 0.30 you get an exception with the cause "org.apache.qpid.AMQException:
> Exception occured while verifying destination"
> 2. In 0.32 no such exception is thrown.
> The issue is in the resolveAddress method in AMQSession class.
> If resolved is false no action is taken. There are a couple issues with this.
> 1. A producer can be created to a non existent queue or exchange.
> 2. Messages being dropped - While sending to a non existing exchange will
> result in an error, sending to a non existent queue via an exchange will
> simply result in messages being dropped.
> 3. The address will continue to be resolved as there was no error the
> previous time.
> We should throw an exception if resolved == false.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]