Activemq or Artemis lifecycle events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Activemq or Artemis lifecycle events

preben
Hi

I'm have a use case where i need simple messaging system embedded in a spring boot app.

The app. has to be HA, so I want to have 2 instances active for http requests.
Messaging between the instances is setup as master/slave with kahadb and shared filesystem.
 
At the same time there is some logic that can only run on one instance at a time since it is statefull, calculated, and realtime clock based.

Is there any broker lifecycle events that one can hook into to listen for broker events. eg. determine which instance becomes master and which slave ?

I was thinking of using such events on app. startup to start the processing engine on the instance that becomes the master.

Best,
Preben

/Preben

Reply | Threaded
Open this post in threaded view
|

Re: Activemq or Artemis lifecycle events

Justin Bertram-2
I can only really speak in regards to Artemis as I'm only familiar with it's internals.

You can implement org.apache.activemq.artemis.core.server.ActivateCallback and pass it to org.apache.activemq.artemis.core.server.ActiveMQServer#registerActivateCallback to be notified of your embedded broker's activation.


Justin

----- Original Message -----
From: "preben" <[hidden email]>
To: [hidden email]
Sent: Friday, January 13, 2017 2:43:21 PM
Subject: Activemq or Artemis lifecycle events

Hi

I'm have a use case where i need simple messaging system embedded in a
spring boot app.

The app. has to be HA, so I want to have 2 instances active for http
requests.
Messaging between the instances is setup as master/slave with kahadb and
shared filesystem.
 
At the same time there is some logic that can only run on one instance at a
time since it is statefull, calculated, and realtime clock based.

Is there any broker lifecycle events that one can hook into to listen for
broker events. eg. determine which instance becomes master and which slave ?

I was thinking of using such events on app. startup to start the processing
engine on the instance that becomes the master.

Best,
Preben

/Preben





--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-or-Artemis-lifecycle-events-tp4721058.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Activemq or Artemis lifecycle events

preben
Thanks Justin

I'm not so familiar with Artemis, but what would be the equivalent of activemq master/slave topology in the Artemis world, would that be live backup groups (only one should be master) ?

Would the eg. ActivateCallback#activationComplete callback only be called on the broker that becomes master ?

/preben
Reply | Threaded
Open this post in threaded view
|

Re: Activemq or Artemis lifecycle events

Justin Bertram-2
Artemis live/backup using shared journal storage I believe should be closest to what you were looking at with ActiveMQ 5.x.

And yes, ActivateCallback#activationComplete should only be called when a broker completely activates (i.e. becomes live in the live/backup use-case).


Justin

----- Original Message -----
From: "preben" <[hidden email]>
To: [hidden email]
Sent: Friday, January 13, 2017 3:26:05 PM
Subject: Re: Activemq or Artemis lifecycle events

Thanks Justin

I'm not so familiar with Artemis, but what would be the equivalent of
activemq master/slave topology in the Artemis world, would that be live
backup groups (only one should be master) ?

Would the eg. ActivateCallback#activationComplete callback only be called on
the broker that becomes master ?

/preben



--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-or-Artemis-lifecycle-events-tp4721058p4721060.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.