Bug 870030

Summary: "not allowed" error while creating node binding for a default topic node
Product: Red Hat Enterprise MRG Reporter: Petr Matousek <pematous>
Component: qpid-javaAssignee: messaging-bugs <messaging-bugs>
Status: NEW --- QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: low Docs Contact:
Priority: low    
Version: DevelopmentCC: jross
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Matousek 2012-10-25 12:34:48 UTC
Description of problem:
When assert is used in the address string while creating node binding for some default topic node (ie. amq.direct), "not allowed" error is raised.

There is no error when assert is not used in the address string, however the binding is not created (this issue is already tracked by bug 860011).

There was a very similar issue with cpp client, please see 730981

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. qpid-config add queue q
2. Spout "amq.direct;{create: always,assert:always, node:{type: topic,x-bindings: [{ exchange: 'amq.direct', queue: 'q', key: 'key' }]}}"

Actual results:
using assert in the address string leads to error (530: not allowed)

Expected results:
No error, (The binding is successfully created, see 860011)

Additional info:
# java -cp $CLASSPATH org.apache.qpid.example.Spout "amq.direct;{create: always,assert:always, node:{type: topic,x-bindings: [{ exchange: 'amq.direct', queue: 'q', key: 'key' }]}}"
{}
IoReceiver - localhost/127.0.0.1:5672 2012-10-25 08:22:47,685 ERROR [apache.qpid.client.AMQConnection] Throwable Received but no listener set: org.apache.qpid.AMQException: ch=0 id=1 ExecutionException(errorCode=NOT_ALLOWED, commandId=1, classCode=7, commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared to be of type direct, requested topic (qpid/broker/SessionAdapter.cpp:128), errorInfo={}) [error code 530: not allowed]
main 2012-10-25 08:22:47,686 ERROR [apache.qpid.client.AMQConnection] Throwable Received but no listener set: org.apache.qpid.AMQException: ch=0 id=1 ExecutionException(errorCode=NOT_ALLOWED, commandId=1, classCode=7, commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared to be of type direct, requested topic (qpid/broker/SessionAdapter.cpp:128), errorInfo={}) [error code 530: not allowed]
Exception in thread "main" javax.jms.JMSException: Error creating producer
	at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:667)
	at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:67)
	at org.apache.qpid.client.AMQSession$7.execute(AMQSession.java:2644)
	at org.apache.qpid.client.AMQSession$7.execute(AMQSession.java:2635)
	at org.apache.qpid.client.AMQConnectionDelegate_0_10.executeRetrySupport(AMQConnectionDelegate_0_10.java:369)
	at org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:609)
	at org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
	at org.apache.qpid.client.AMQSession.createProducerImpl(AMQSession.java:2633)
	at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:1214)
	at org.apache.qpid.client.AMQSession.createProducer(AMQSession.java:104)
	at org.apache.qpid.example.Spout.<init>(Spout.java:91)
	at org.apache.qpid.example.Spout.main(Spout.java:146)
Caused by: org.apache.qpid.AMQException: Exception occured while verifying destination
	at org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:93)
	at org.apache.qpid.client.BasicMessageProducer.<init>(BasicMessageProducer.java:151)
	at org.apache.qpid.client.BasicMessageProducer_0_10.<init>(BasicMessageProducer_0_10.java:66)
	at org.apache.qpid.client.AMQSession_0_10.createMessageProducer(AMQSession_0_10.java:662)
	... 11 more
Caused by: org.apache.qpid.AMQException: ch=0 id=1 ExecutionException(errorCode=NOT_ALLOWED, commandId=1, classCode=7, commandCode=1, fieldIndex=0, description=not-allowed: Exchange declared to be of type direct, requested topic (qpid/broker/SessionAdapter.cpp:128), errorInfo={}) [error code 530: not allowed]
	at org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1062)
	at org.apache.qpid.client.AMQSession_0_10.sync(AMQSession_0_10.java:1042)
	at org.apache.qpid.client.AMQSession_0_10.sendExchangeDeclare(AMQSession_0_10.java:710)
	at org.apache.qpid.client.AMQSession_0_10.handleAddressBasedDestination(AMQSession_0_10.java:1254)
	at org.apache.qpid.client.BasicMessageProducer_0_10.declareDestination(BasicMessageProducer_0_10.java:89)