I believe it would be possible to write a custom interceptor (see https://activemq.apache.org/interceptors) that rejected incoming messages and incoming connections. (Maybe rejecting incoming connections would be enough, because you can't send a message without an established connection.) If you restart the broker when you apply it, that should give you what you need.
Alternatively, you could put a reverse proxy such as Nginx in front of the broker, and then modify its configuration to disable/re-enable the OpenWire port. Then JMX and web console connections could go through but protocol connections would be stopped. Tim On Thu, Oct 21, 2021, 2:47 AM Bauer, Hannes <h...@tangro.de> wrote: > Hello, > > I am working on an application that is using ActiveMQ 5.16.3 and I am > tasked with implementing a feature that should pause the whole message > process. > > > > In the application we have producers and message driven beans as > consumers. The goal is to stop the consumption of messages as well as the > acceptance of new messages in the queues. > > At first, I was hoping that pausing a queue would do exactly that, but I > quickly learned that that only stops messages from being delivered. > > And now I need an option to also prevent queues from accepting new > messages. > > > > What I am trying to achieve in the end is somewhat like this existing > thread > > > https://lists.apache.org/thread.html/r615e1b6c2cdf6341ac69935f24190a865147b32e3b95dfb35c86383e%40%3Cusers.activemq.apache.org%3E > > But the proposed solution with multiple brokers and a failover is not > applicable/feasible in our use case. > > > > So far, the only other option I found is to stop the complete broker by > stopping the windows service. > > But this obviously creates new challenges since we can no longer get > information on the size of the queues for example. > > > > Is there another way to stop the consumption and creation of messages? > > Ideally with an instant exception when a sent is attempted on a queue that > is stopped? > > > > Any help/hints are greatly appreciated > > > > Regards > > Hannes > > > > > > *Hannes Bauer*Entwicklung > h...@tangro.de > Fon +49 6221 1333 666 > www.tangro.de > <https://www.linkedin.com/company/3731516/> > <https://www.linkedin.com/company/3731516/> > <https://www.xing.com/companies/tangrosoftwarecomponentsgmbh> > <https://www.youtube.com/channel/UCsxrvLKxYpQ-KYK8uGQ8tVQ> > <https://twitter.com/tangro_software> <https://www.tangro.de/newsletter/> > <https://www.tangro.de/newsletter/> > > *tangro software components gmbh*, Speyerer Straße 4, 69115 Heidelberg > Geschäftsführer: Andreas Schumann, Registergericht: Mannheim, HRB 336064 > (Sitz: Heidelberg) > >