Start and Stop JMS Listener using Spring -


So the question is how to stop temporarily and the way to fall using spring to create a JM listener:

  & lt; Amq: connectionFactory id = "exampleJmsFactory" brokerURL = "tcp: // $ {jms.broker.url}" /> & Lt; JMS: Listener-Container Synagimation = "1" Connection-factory = "Example JMMFCR" Destination-Type = "Queue" Message-converter = "Example Message Converter" & gt; & Lt; JMS: listeners destination = "Coming example.client.q." Rif = "Example Products Message Consumer" method = "Consumption" /> & Lt; / Jms: listener-container & gt; & Lt; Bean id = "Example Products Message Consumer" class = "com.unic.example.jms.receive.JmsExampleProductsMessageConsumer" scope = "tenant" />   

So what is the problem originally? We have an init / update mechanism that the client can run at any time and this can slow down init / update. I consume any message I want to stop doing because the system is useless at the moment and if any message comes it will be lost

So how can I stop the whole connection using the listener or listener container or API. I found out that a Class Abbott JMS Listening Container is a Stop / Start but how can I get it? I mean that none of this JM: the name of the listener and listener's containers or anything else is such.

You can specify an ID to the listener, then get a reference to it, Either by getBean phone or injection it. This will give you an object JMMS listing container on which you can call start / stop calls.

Comments