Announcement Announcement Module
Collapse
No announcement yet.
jms:outbound-gateway - temporary queues never deleted Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jms:outbound-gateway - temporary queues never deleted

    Hello,
    Actually I'm using jms:outbound-gateway to create a request-reply service with spring integration (2.0.5) ; it works fine. But when I've decided to monitor with JConsole my active-mq broker, I've noticed tempQueues are increasing for ever.

    Code:
    <beans:bean id="queue.myService.entry" class="org.apache.activemq.command.ActiveMQQueue">
      <beans:constructor-arg value="queue.myService.entry"/>
    </beans:bean>
    
    <beans:bean id="queue.myService.exit" class="org.apache.activemq.command.ActiveMQQueue">
      <beans:constructor-arg value="queue.myService.exit/>
    </beans:bean>
    
    <jms:inbound-gateway id="myService" connection-factory="brokerDMZ"
      request-destination="queue.myService.entry"
      request-channel="myService.channel"
      reply-timeout="15000" 
      reply-time-to-live="15000"
      request-timeout="15000" 
      concurrent-consumers="100"
      max-concurrent-consumers="100"
      max-messages-per-task="100" />
                               
     <channel id="myService.channel"  />
    
     <jms:outbound-gateway id="myServiceExit" connection-factory="brokerIntranet"
       request-destination="queue.myService.exit"  
       request-channel="myService.channel"
       reply-timeout="15000"   
       request-timeout="15000" 
       time-to-live="15000" 
       receive-timeout="15000" />
    It seems that jms:outbound-gateway creates temporary queues in order to get the reply, but then doesn't delete them.
    I can see it in Jconsole in the tempQueues list.

  • #2
    what version of ActiveMq are you using?

    Comment


    • #3
      We are closing temporary queues:
      Code:
      finally {
      	JmsUtils.closeSession(session);	
      	ConnectionFactoryUtils.releaseConnection(connection, this.connectionFactory, true);
      	this.deleteDestinationIfTemporary(replyTo);
      }
      However if you are using CachingConnectionFactory consumers are cached by default so the call to delete temp queue results in exception:

      javax.jms.JMSException: A consumer is consuming from the temporary destination

      So you can set cacheConsumers to false

      Code:
      <property name="cacheConsumers" value="false"/>
      Ot use raw ActiveMq connection factory

      Comment


      • #4
        ActiveMQ 5.3.0

        Comment


        • #5
          In deed, I was using a CachingConnectionFactory and your advice solved my problem.
          Thanks
          BEST REGARDS

          Comment

          Working...
          X