1

I'm trying to implement a new application using JMS under activeMQ 5.8.0. There are several applications configured as Producers (ie to dump messages in an MQ), two topics, and then the Consumers are configured to look at their VirtualTopic which is created dynamically on Tomcat server start.

Example flow would be:

Producer1 (Tomcat) --JMS--> ActiveMQ.VirtualTopic

Consumer.VirtualTopic1 --JMS--> Consumer1 (Tomcat)
Consumer.VirtualTopic2 --JMS--> Consumer2 (Tomcat)

We wanted the flexibility to be able to start up any number of Consumers and have ActiveMQ dynamically send to them. This is working. However, when a Consumer server is shut down (either as a result of it not being needed anymore, a server crash, network outage etc), I want AMQ to stop putting messages on its VirtualTopic as flow control is kicking in and is no longer consuming messages from the Producer.

I have my activemq.xml configured with:

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" schedulePeriodForDestinationPurge="10000">

<policyEntry queue=">"  gcInactiveDestinations="true"  inactiveTimoutBeforeGC="30000" />

I would therefore expect a server to be marked as inactive within 40 seconds of a Tomcat node being stopped (and number of consumers being marked as zero), but it's not happening. Have I missed something?

Thanks!

damian
  • 11
  • 4

1 Answers1

0

I found the answer myself with a bit more ActiveMQ familiarity. The queue does automatically delete, but only if there are no pending messages. The application this solution was implemented for deals with a constant stream of messages (somewhere between 20 - 5000 per second), so there is never a window for the queue to be removed.

damian
  • 11
  • 4