How to invoke broadcast EJB at all JBoss cluster members

According to a title, if have to invoke all ejb beans of a given type at once on all cluster members, below is a quiet simple way how to do it.

1. Import into your project required modules/dependencies

Maven dependencies

Runtime JBoss modules depencies

Defined  jboss-deployment-strucutre.xml file:

Dependencies might be alternatively defined in MANIFEST.MF as entry:

2.  Implement service that will invoke method on all cluster members

 Important notes on implementation:

  • JmsAdapter is an @Stateless EJB
  • Broadcast method is invoked synchronously on all cluster members, but there is an async equivalent : callAsynchMethodOnCluster
  • Implementation of broadcast requires private JBoss modules which are not supported by Red Hat

 

Leave a Reply


2 × one =