datastax / pulsar-jms

DataStax Starlight for JMS, a JMS API for Apache Pulsar ®
Apache License 2.0
48 stars 21 forks source link

Connection optimization for JBOSS Consumers. #77

Open akhil1000 opened 1 year ago

akhil1000 commented 1 year ago

Currently, we are seeing a high number of connections on the Broker so see if you can optimize.

We would like to have a way to control the number of connections or sessions using MaxSessions.

eolivelli commented 1 year ago

How any MDBs you have ?

for each MDS (endPoint) we try to re-use the same PulsarConnectionFactory. The PulsarConnectionFactory holds an instance of the Java Pulsar Client, that maintains the pool of connections.

https://github.com/datastax/pulsar-jms/blob/e59d6d0fb682eb741e8ad84705aedc81730303eb/resource-adapter/src/main/java/com/datastax/oss/pulsar/jms/rar/PulsarResourceAdapter.java#L97

Are you configuring the MDBs with the same "Configuration" ? if you have the same configuration and you simply change the destination I would expect that you have only one PulsarClient.

Each PulsarClient opens only 1 connection to each broker se connectionsPerBroker configuration

akhil1000 commented 1 year ago

I do not see anything logged for below line log.info( "Activate endpoint {} {} configuration {}",

Is there a way we can log - number of Connectionfactories/Sessions and other metrics in resource adapter to collect the meterics ?

akhil1000 commented 1 year ago

There are around 990 MDBs