qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Rudyy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPID-8141) [JMS AMQP 0-x] Cannot publish message with address based destinations falsely identified as resolved due to unset routing key and exchange name
Date Fri, 04 May 2018 11:57:00 GMT

    [ https://issues.apache.org/jira/browse/QPID-8141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463783#comment-16463783
] 

Alex Rudyy commented on QPID-8141:
----------------------------------

Changes in commits [https://git-wip-us.apache.org/repos/asf?p=qpid-jms-amqp-0-x.git;h=a762b9d],
[https://git-wip-us.apache.org/repos/asf?p=qpid-jms-amqp-0-x.git;h=6a5ffcf], [https://git-wip-us.apache.org/repos/asf?p=qpid-jms-amqp-0-x.git;h=f5fb52d]
and corresponding merges look good to me

> [JMS AMQP 0-x] Cannot publish message with address based destinations falsely identified
as resolved due to unset routing key and exchange name
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-8141
>                 URL: https://issues.apache.org/jira/browse/QPID-8141
>             Project: Qpid
>          Issue Type: Bug
>          Components: JMS AMQP 0-x
>    Affects Versions: qpid-java-client-0-x-6.3.0
>            Reporter: Alex Rudyy
>            Assignee: Keith Wall
>            Priority: Major
>             Fix For: qpid-java-client-0-x-6.3.1
>
>
> Address based destination resolution functionality {{AMQSession#resolveAddress}} sets
a number of fields like {{routing key}}, {{exchange name}}, etc as part of invocation of {{AMQSession#setLegacyFieldsForQueueType}}.
If destination object is identified as resolved {{AMQSession#isResolved}} the essential fields
are not set on the destination object. As result, publishing attempts with such destination
objects will fail due to routing issues like the one reported below:
> {noformat}
> Caused by: org.apache.qpid.AMQConnectionClosedException: Error: No route for message
with exchange 'null' and routing key 'null' [error code: 312(no route)]
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> 	at org.apache.qpid.AMQException.cloneForCurrentThread(AMQException.java:81)
> 	at org.apache.qpid.AMQException.cloneForCurrentThread(AMQException.java:24)
> 	at org.apache.qpid.client.AMQProtocolHandler.writeCommandFrameAndWaitForReply(AMQProtocolHandler.java:638)
> 	at org.apache.qpid.client.AMQProtocolHandler.syncWrite(AMQProtocolHandler.java:675)
> 	at org.apache.qpid.client.AMQProtocolHandler.syncWrite(AMQProtocolHandler.java:669)
> 	at org.apache.qpid.client.AMQSession_0_8.commitImpl(AMQSession_0_8.java:271)
> 	at org.apache.qpid.client.AMQSession.commit(AMQSession.java:913)
> 	... 6 more
> Caused by: org.apache.qpid.AMQConnectionClosedException: Error: No route for message
with exchange 'null' and routing key 'null' [error code: 312(no route)]
> 	at org.apache.qpid.client.handler.ConnectionCloseMethodHandler.methodReceived(ConnectionCloseMethodHandler.java:90)
> 	at org.apache.qpid.client.handler.ClientMethodDispatcherImpl.dispatchConnectionClose(ClientMethodDispatcherImpl.java:227)
> 	at org.apache.qpid.framing.ConnectionCloseBody.execute(ConnectionCloseBody.java:105)
> 	at org.apache.qpid.client.state.AMQStateManager.methodReceived(AMQStateManager.java:118)
> 	at org.apache.qpid.client.AMQProtocolHandler.methodBodyReceived(AMQProtocolHandler.java:531)
> 	at org.apache.qpid.client.protocol.AMQProtocolSession.methodFrameReceived(AMQProtocolSession.java:460)
> 	at org.apache.qpid.framing.AMQMethodBodyImpl.handle(AMQMethodBodyImpl.java:66)
> 	at org.apache.qpid.client.AMQProtocolHandler.received(AMQProtocolHandler.java:480)
> 	at org.apache.qpid.client.AMQConnectionDelegate_8_0$ReceiverClosedWaiter.received(AMQConnectionDelegate_8_0.java:549)
> 	at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:164)
> 	at java.lang.Thread.run(Thread.java:748)
> {noformat}
> The clients applications creating new destination objects on every publishing attempt
using the same session are impacted by the issue.
> The following code snippet demonstrate the problem:
> {code}
> MessageProducer messageProducer = session.createProducer(null);
> for (int i=0;i<numberOfMessages;i++)
> {
>     Message message = session.createTextMessage("Test");
>     messageProducer.send(session.createQueue(String.format(
>             "ADDR:test;{\"create\":\"always\",\"node\":{\"type\":\"queue\",\"durable\":true}}")),
message);
> }
> session.commit();
> {code}
> The work around would be to avoid creation of destination objects every time. For example,
Qpid JNDI properties can be used to declare and cache the destination objects. 
> {code}
> destination.queue=ADDR:test;{"create":"always","node":"type":"queue","durable":true}}
> {code}
> {code}
> Destination destination = (Destination)context.lookup("queue")
> {code}
>   



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message