Back Forum Reply New

Switch off DefaultMessageListenerContainer

Hello,
  I need to stop DefaultMessageListenerContainer for couple hours during the day. the idea is to write a script which will stop the running instance executing if(listener.isRunning())   listener.stop()

I need another script to restart it.

How I can  get current running insatnce from separate java class (I will execute it in a shell script)Regards
Michal

Hi,

in this case i would suggest to use a scheduler. There you can have two MethodInvokingJobDetailFactoryBean beans which executes the stop and the start method. You can configure them separatly through the quartz scheduler.

Have a look here
sp...cheduling.html

You can reach the DMLC through the ApplicationContext, for starting and stopping it.

rgds
agim

Thank you very much. It's a very good alternative and starting point.

I have just realized I need to stop and start process manually from time to time. I like the ide of scheduler, but manual interference in required.

Any idea ?

Regards

Hi,

i have used jmx for this particular case. You can export the DMLC as a jmx bean. With the InterfaceBasedMBeanInfoAssembler you cna export the Interface  org..context.LifeCycle which has the start/stop/isRunning Methods.

Have a look here sp...interface-java

After exporting the DMLC you can start and stop the container through a jmx client (i.e. jconsole which is provided through teh standart jdk).

best rgds
agim

I will gove it a try. Cheers

I would much appreciate if you send my an example. I am strugling with config, and still can't see it in JConsole.  Do I have to extend DLMC to use InterfaceBasedMBeanInfoAssembler  ?

Regards

I managed to export DLMC but my JConsole can't see it.

Hi,

this is strange. Do you start the vm with the jmx specific options like the following  
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4446 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

rgds
agim

It helped. Thank you !
¥
Back Forum Reply New