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

Christopher L. Shannon commented on AMQ-6430:
---------------------------------------------

I took a look at this and there are actually two problems here with how noLocal 
is handled with durables.  The main issue you are seeing is that when the 
durable comes back online the new connectionId is not being captured for the 
NoLocal expression parser which means that when messages are sent after broker 
restart the logic thinks that the message isn't coming from the current 
subscription when it is.  The fix here is to make sure the connectionId is 
updated properly when the new consumer comes online.

The second issue is that the JMS spec says that 
{noformat}
A client can change an existing durable subscription by creating a durable
TopicSubscriber with the same name and a new topic and/or message selector,
or NoLocal attribute. Changing a durable subscription is equivalent to deleting
and recreating it.
{noformat}

Right now we aren't checking if that NoLocal attribute changes at all when a 
new consumer comes online.  Base on the spec I think we should update the 
activation check such that if the NoLocal attribute changes (ie goes from false 
to true or true to false) we treat it as a selector change and process it the 
same way (delete and recreate the sub)

I am working on a patch and fix now to go out with our 5.14.1 release.

> noLocal=true in durable subscriptions is ignored after reconnect
> ----------------------------------------------------------------
>
>                 Key: AMQ-6430
>                 URL: https://issues.apache.org/jira/browse/AMQ-6430
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.13.4, 5.14.0
>         Environment: Ubuntu 14.04, OpenJDK 1.7.0_111 and Oracle JDK 1.8.0.74, 
> other environments not testet
>            Reporter: Daniel Faber
>            Assignee: Christopher L. Shannon
>         Attachments: ActiveMQNoLocalTest.java, pom.xml
>
>
> I create a connection to my local ActiveMQ and open two sessions. In the 
> first session I create a durable topic subscriber with noLocal=true. In the 
> second session I send a message to the same topic. Then I close both sessions 
> and the connection. The first time I do this, everything works well, that 
> means I send but do not receive the message. The second time I run the same 
> application I send AND receive the message.
> After removing all files and directories in ActiveMQ's data directory, not 
> receiving my own message works again, but only once.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to