Details
-
Story
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
None
-
Documentation (Ref Guide, User Guide, etc.)
Description
Hi,
Below are a few good practices while producing messages to AMQ cluster using Java code deployed in EAP.
- It is always recommended to using JNDI connection while making connection to the AMQ broker.
- In the EAP, create a pooled connection factory and create a JNDI against it. This JNDI can then be used in the application to make connection to the AMQ broker cluster.
- The JNDI connection should be used in a stateless java bean.
- When the bean is instantiated as an EJB, the EAP takes care of the lifecycle of the bean.
- This helps to distribute the load of messages amongst the brokers depending on the number of messages that are being sent and the frequency of the messages.
Basically, this setup allows EAP to manage all the connections to AMQ.
Sample application using the recommended practices: link AMQ Java Producer