A
Alex Molochnikov
My app sends a heartbeat-type message to a JMS topic connection once a
minute. What is the best strategy for opening/closing the connection:
1. Create the connection, topic session and publisher just before the
message is sent, after that immediately close it, or
2. Create these objects once, and keep them for the app's lifetime.
I did some time measurements in JBoss, using System.currentTimeMillis(), but
at the millisecond level the time consumption is measurable only in
connectionFactory.createTopicConnection() and
connection.createTopicSession() calls (some 16 ms each on my machine).
What are the effects of keeping the connection open forever? Is is akin the
data source connection (i.e. limited communal resource, not to be
squandered)?
Any clues are greatly appreciated.
Alex Molochnikov
Gestalt Corporation
minute. What is the best strategy for opening/closing the connection:
1. Create the connection, topic session and publisher just before the
message is sent, after that immediately close it, or
2. Create these objects once, and keep them for the app's lifetime.
I did some time measurements in JBoss, using System.currentTimeMillis(), but
at the millisecond level the time consumption is measurable only in
connectionFactory.createTopicConnection() and
connection.createTopicSession() calls (some 16 ms each on my machine).
What are the effects of keeping the connection open forever? Is is akin the
data source connection (i.e. limited communal resource, not to be
squandered)?
Any clues are greatly appreciated.
Alex Molochnikov
Gestalt Corporation