aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes When does our JMS application actually initiates/starts the connection with queue? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "When does our JMS application actually initiates/starts the connection with queue?" Watch "When does our JMS application actually initiates/starts the connection with queue?" New topic
Author

When does our JMS application actually initiates/starts the connection with queue?

Srinath Kannan
Greenhorn

Joined: Jan 11, 2011
Posts: 14

Hi,

I have created a JMS application to interface with MQ series for sending/receiving messages. The application works fine.

I was wondering when does our application actually interfaces [starts a connection] with MQ

Is it when after we create the queue session object or the queue connection object or when we call the start() method from queueConnection reference?

There are "for loops" inside message sending program, which keep sending messages to same queue & queue manager until a condition is reached. So i was worried if i am opening the connection un-necessarily every time when i send each message for each iteration!

I wanted to make sure that i use the same session and connection for each iteration in the loop because the queue and queue manager name are the same! I assume that creating connection/sessions each time will degrade performance and its not necessary!



So in the above shown code, at which line the actual connection with MQ starts?

Is it Line no 6 or 7 or 8 or 12 or 13?

I can put that line top of the message sending method once for all, so that i am avoiding performance issues!.





Regards
Srinath
Vladimir Galcenco
Greenhorn

Joined: Mar 23, 2011
Posts: 4
Can you start your code in debug mode? Then after stepping through each line use netstat command in your cmd to see when the connection is created?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When does our JMS application actually initiates/starts the connection with queue?