ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS Performance on Client connection

Post new topic  Reply to topic
 JMS Performance on Client connection « View previous topic :: View next topic » 
Author Message
tapak
PostPosted: Wed Sep 13, 2006 1:03 pm    Post subject: JMS Performance on Client connection Reply with quote

Centurion

Joined: 26 Oct 2005
Posts: 149
Location: Hartford,CT

I am creating 5 threads to read messages from the queue . Should I create a separate client connection for each thread or can I use the same connection for each thread . Which is better configuration for performance . What are the factors to be considered in determining the no of client connections to a queue manager.
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Sep 13, 2006 1:25 pm    Post subject: Re: JMS Performance on Client connection Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

tapak wrote:
I am creating 5 threads to read messages from the queue . Should I create a separate client connection for each thread or can I use the same connection for each thread . Which is better configuration for performance . What are the factors to be considered in determining the no of client connections to a queue manager.

If you use one JMS Connection, and create 5 Sessions from the Connection, this will result in 5 MQI HConns being used. Each of these can be used independently - ie. you can use each Session on its own thread, and there will be no need to serialize between them. Did this answer your question(s)?
Back to top
View user's profile Send private message
tapak
PostPosted: Wed Sep 13, 2006 1:46 pm    Post subject: Reply with quote

Centurion

Joined: 26 Oct 2005
Posts: 149
Location: Hartford,CT

Thanks Vic ,

Instead of creating 5 sessions , is it possible to create 5 Reciever objects in different threads from a single session (single connection). If yes , does it perform better compared to using 5 connections in different threads.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Sep 13, 2006 4:06 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

For reason of transactionality I would not create 5 receivers from the same session. On top of this, as the threads would read from the same queue, they would be single threaded for receiving messages from the queue. Exactly what you want to avoid...

Creating a session from a connection consumes nearly no time. Establishing the connection is costly.

Create 5 runnable objects and pass in the connection. Let each thread then create it's own session.

Enjoy
_________________
MQ & Broker admin


Last edited by fjb_saper on Thu Sep 14, 2006 2:46 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
mvic
PostPosted: Thu Sep 14, 2006 1:07 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

tapak wrote:
Instead of creating 5 sessions , is it possible to create 5 Reciever objects in different threads from a single session (single connection).

If I remember correctly, JMS disallows use of the same Session concurrently on more than one thread. I expect you'll be allowed to create 5 Receivers, but you'll not be allowed to call them concurrently.
Back to top
View user's profile Send private message
tapak
PostPosted: Fri Sep 15, 2006 5:35 am    Post subject: Reply with quote

Centurion

Joined: 26 Oct 2005
Posts: 149
Location: Hartford,CT

Thanks for the info.
Back to top
View user's profile Send private message
tapak
PostPosted: Fri Sep 15, 2006 5:38 am    Post subject: Reply with quote

Centurion

Joined: 26 Oct 2005
Posts: 149
Location: Hartford,CT

Does Java MQ API can be used to create threads using a single client connections.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 15, 2006 5:46 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can only perform one operation at a time over a single connection. So if you use the same connection in two threads, and one thread is doing a GET with WAIT, the other thread is blocked until the GET returns.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
tapak
PostPosted: Fri Sep 15, 2006 6:01 am    Post subject: Reply with quote

Centurion

Joined: 26 Oct 2005
Posts: 149
Location: Hartford,CT

So if the transaction is simple it is better to use separate connection for each thread. And if the transacion is complex (like lot of database operations) same connection can be used in multiple thread for Java API. Am I right ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS Performance on Client connection
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.