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

masc commented on AMQ-6155:
---------------------------

Yes. Without topic advisories it works fine.
Here's some interesting log entries from the receiver. The queue seems to be 
created prior to send. Version is 5.13.1
...
2016-02-18 01:15:22,683 131622 ActiveMQ VMTransport: 
vm://leoz-aq-86c3ca5c3a347577744055d910d00c6fa9811a53#3-3 
org.apache.activemq.broker.region.AbstractRegion DEBUG - 
leoz-aq-86c3ca5c3a347577744055d910d00c6fa9811a53 adding destination: 
temp-queue://ID:agnus.o81.5-57628-1455753254297-7:1:99
2016-02-18 01:15:22,683 131622 DefaultMessageListenerContainer-1 
org.deku.leoz.node.data.sync.EntityPublisher ERROR - Cannot publish to a 
deleted Destination: temp-queue://ID:agnus.o81.5-57628-1455753254297-7:1:99
javax.jms.InvalidDestinationException: Cannot publish to a deleted Destination: 
temp-queue://ID:agnus.o81.5-57628-1455753254297-7:1:99
        at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1904)
        at 
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:288)
        at 
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:223)
        at 
org.apache.activemq.jms.pool.PooledProducer.send(PooledProducer.java:95)
        at 
org.apache.activemq.jms.pool.PooledProducer.send(PooledProducer.java:66)
        at 
org.deku.leoz.node.data.sync.EntityPublisher.onMessage(EntityPublisher.kt:99)
        at 
sx.jms.listeners.SpringJmsListener.access$onMessage(SpringJmsListener.kt:18)
        at 
sx.jms.listeners.SpringJmsListener$start$1.onMessage(SpringJmsListener.kt:55)
...
2016-02-18 01:15:27,699 136638 ActiveMQ VMTransport: 
vm://leoz-aq-86c3ca5c3a347577744055d910d00c6fa9811a53#3-4 
org.apache.activemq.broker.region.AbstractRegion DEBUG - 
leoz-aq-86c3ca5c3a347577744055d910d00c6fa9811a53 removing destination: 
temp-queue://ID:agnus.o81.5-57628-1455753254297-7:1:99
...



> Spurious InvalidDestinationException publishing to a temp queue from a new 
> connection
> -------------------------------------------------------------------------------------
>
>                 Key: AMQ-6155
>                 URL: https://issues.apache.org/jira/browse/AMQ-6155
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.10.2, 5.13.0
>         Environment: Windows, OS X
>            Reporter: Kevin Bowman
>         Attachments: AmqTempRaceConditionMinimalTest.java
>
>
> When a new connection is opened for the purpose of sending a message to a 
> temporary queue it sometimes fails with the following exception (stack trace 
> is from v5.13.0):
>  javax.jms.InvalidDestinationException: Cannot publish to a deleted 
> Destination: temp-queue://ID:Potomac.local-59943-1454448412194-1:1:96
>       at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1904)
>       at 
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:288)
>       at 
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:223)
>       at 
> org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:241)
> The actual problem appears to be in ActiveMQConnection.isDeleted().  Because 
> the connection being used to send to the temp queue is not the connection 
> under which the temp queue was created, it's dependent on AdvisoryConsumer to 
> populate the activeTempDestinations map before the send() call is made.  The 
> AdvisoryConsumer gets called in a separate thread, asynchronous with the main 
> thread, so this constitutes a race condition.  If the send() call is made 
> before AdvisoryConsumer can notify the new connection of all existing temp 
> queues then it will throw an InvalidDestinationException even though the temp 
> queue does actually exist.
> Calling setWatchTopicAdvisories(false) on the sending connection's factory 
> alleviates the problem and the program can run indefinitely with no errors.  
> Also, adding a delay before the MessageProducer.send() call can alleviate the 
> error somewhat, but with a small enough delay it will still happen eventually.
> I noticed this first in an environment I don't have full control over.  It 
> happened the first time, every time, for reasons I still don't quite 
> understand.  I have written a small test program that reproduces the error 
> outside of the original environment, but it runs in a loop and it takes a few 
> hundred iterations for it to occur.



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

Reply via email to