Bug 731399 - Error message on assert fails shall be more specific
Summary: Error message on assert fails shall be more specific
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java
Version: 2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-17 14:14 UTC by Petr Matousek
Modified: 2024-01-19 19:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Petr Matousek 2011-08-17 14:14:15 UTC
Description of problem:

When assertion used in address string fails, following error message is always displayed:
org.apache.qpid.AMQException: The name XXX supplied in the address doesn't resolve to an exchange or a queue

I thing the message shall be more specific.
It would be better to indicate that in some way the assertion failed.
It is not necessary to include precise details, but the error at present makes it look like the queue or exchange does not exist.

Even if it was: "The name XXX supplied in the address doesn't resolve to an exchange or a queue with the specified properties"

Please see additional info for details.

Version-Release number of selected component (if applicable):
qpid-java-0.10-6

How reproducible:
100%

Steps to Reproduce:
1. qpid-config add queue q
2. drain "q;{assert:always, node:{durable:True}}"
3. following exception is received:
org.apache.qpid.AMQException: The name 'q' supplied in the address doesn't resolve to an exchange or a queue
  
Actual results:
Too general error message is displayed.

Expected results:
The error message shall indicates in some way that the assertion fails.

Additional info:

C++ client:

# qpid-config add queue q

# $cppapi/drain "q;{assert:always, node:{durable:True}}"
Queue not durable: q

# $cppapi/drain "q;{assert:always, node:{x-declare: {exclusive:True}}}"
Queue not exclusive: q

JAVA client:

# qpid-config add queue q
# java -cp $CLASSPATH org.apache.qpid.example.Drain "q;{assert:always, node:{durable:True}}"
{}
Exception in thread "main" javax.jms.JMSException: Error registering consumer: org.apache.qpid.AMQException: The name 'q' supplied in the address doesn't resolve to an exchange or a queue
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2052)
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1995)
	at org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:314)
	at org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:622)
	at org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
	at org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1993)
	at org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:965)
	at org.apache.qpid.example.Drain.<init>(Drain.java:70)
	at org.apache.qpid.example.Drain.main(Drain.java:103)
Caused by: org.apache.qpid.AMQException: The name 'q' supplied in the address doesn't resolve to an exchange or a queue
	at org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1237)
	at org.apache.qpid.client.AMQSession.registerConsumer(AMQSession.java:2836)
	at org.apache.qpid.client.AMQSession.access$500(AMQSession.java:120)
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2029)
	... 8 more

# java -cp $CLASSPATH org.apache.qpid.example.Drain "q;{assert:always, node:{x-declare: {exclusive:True}}}"
{}
Exception in thread "main" javax.jms.JMSException: Error registering consumer: org.apache.qpid.AMQException: The name 'q' supplied in the address doesn't resolve to an exchange or a queue
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2052)
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1995)
	at org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:314)
	at org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:622)
	at org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
	at org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1993)
	at org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:965)
	at org.apache.qpid.example.Drain.<init>(Drain.java:70)
	at org.apache.qpid.example.Drain.main(Drain.java:103)
Caused by: org.apache.qpid.AMQException: The name 'q' supplied in the address doesn't resolve to an exchange or a queue
	at org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1237)
	at org.apache.qpid.client.AMQSession.registerConsumer(AMQSession.java:2836)
	at org.apache.qpid.client.AMQSession.access$500(AMQSession.java:120)
	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2029)
	... 8 more

Comment 1 Frantisek Reznicek 2014-03-05 08:10:32 UTC
Defect nominated for Open Source Contest Spring 2014.

Qpid resp. MRG/M References:
  http://qpid.apache.org
  http://qpid.apache.org/components/qpid-jms/index.html
  Messaging Programming Reference, Messaging Installation and Configuration Guide at
    https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_MRG/
  http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol
  http://rajith.2rlabs.com/2007/09/06/amqp-in-10-mins-part1-introduction/

Goals:
  1] propose patch that fixes the above described issue
  2] propose testing scenario down-to individual steps
  3] implement / automate testing scenario as part of already existing upstream qpid-java unit test framework


In case you struggle feel free to:
 * join IRC channel #qpid on http://freenode.net/ and ask
 * ask in Bugzilla using comment field
 * ask on mailing list, see https://qpid.apache.org/discussion.html page for details


Note You need to log in before you can comment on or make changes to this bug.