Nice article !
Btw, you can submit a patch, if you want ;)

Cheers,
Guillaume Nodet

Raman Gupta wrote:

[EMAIL PROTECTED] wrote:
Dnia Tue, 01 Nov 2005 19:11:06 -0500, Raman Gupta napisaƂ(a):

Guillaume Nodet wrote:

Raman Gupta wrote:

Hi, is there a way to start/stop a JCAConnector at runtime?
The only way to stop a connector in jca, afaik, is to activate / deactivate the endpoint. This is what is done when you create / detroy a JCAConnector. This object is light weight, and you
should create / destroy them when needed.
Normally this would be fine, but my JCAConnector's are created by
Spring as singletons when the application context loads. So it
would be nice to be able to active/deactive the endpoint by calling
methods on the connector.

I've ended up using a supporting factory bean that is configured the
same way as a JCAConnector. The factory bean manually configures and
returns JCAConnector's when a startConsumption method is called, and
destroys the JCAConnector when stopConsumption is called. Fully
described here:

http://jroller.com/page/rocketraman/?anchor=spring_and_jencks_jcaconnector_s

I solved the problem by exporting JCAConnector as JMX bean (via
Spring MBeanExporter). I can call destroy() method which deactivates
endpoint and afterPropertiesSet() method which activates it. However,
I had to modify ActiveMQResourceAdapter class (I'm using AMQ 3.1),
because I was unable to activate previously deactivated endpoint -
there is a workers map which wasn't cleaned after deactivation.

Thanks for the suggestion. But I don't like this solution for two
reasons. First, I'd rather not have to keep around a modified version of
the ActiveMQ codebase. Second, I need this to also work for other RA's,
such as the genericjmsra.

Cheers,
Raman



Reply via email to