Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveMQ, multiple session vs multiple connection

I want to use ActiveMQ in my current project, however I am little confused as to when to take advantage of multiple connections. Since we can create multiple producers in a single connection, then whats the need of having multiple connections.

I tried to find it online but unable to find any useful resource which can help me to understand it in depth.

It would be really helpful if someone can share his practical experiences of working with activemq and help us in understanding, when to create multiple connections for each producer and when to create multiple producer in a same connection.

like image 725
AmanSinghal Avatar asked Sep 13 '25 12:09

AmanSinghal


1 Answers

Connections:

  • Useful for multi-threaded applications to increase overall throughput.
  • Separation of identity for authn and authz (user: "tickets" vs user: "billing")

Sessions:

  • Separation of transaction boundaries

Multiple Producers / Consumers

  • Allow for working with multiple destinations
  • Multiple consumers allow for parallel processing
  • Limited value in multiple producers in most use cases

Note: In JMS 2.0, the JMSContext provides what is essentially a combined connection+session.

like image 183
Matt Pavlovich Avatar answered Sep 17 '25 04:09

Matt Pavlovich