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 » Pooling JMS Connections

Post new topic  Reply to topic
 Pooling JMS Connections « View previous topic :: View next topic » 
Author Message
JohnRodey
PostPosted: Thu Jul 21, 2005 10:17 am    Post subject: Pooling JMS Connections Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Does anyone know if it is possible to pool JMS connections to MQ without the use of an app server.

I noticed that there is a setting in the jndi qcf context to "useconnpooling" although this is by default set to yes, and it doesn't seem to enhance performance.

Since it is very expensive to create new connections does MQ offer a way to pool these connections?

I looked through the Using Java guide and only saw info on Java base being pooled. Any help is appreciated.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jul 21, 2005 10:20 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Look at the Application Server Facilities documentation in the Using Java manual.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 21, 2005 12:10 pm    Post subject: Reply with quote

Grand High Poobah

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

You could write your own pooling logic that would need to implement the J2EE resource pooling contract.

Quite a task.

Alternatives: Do not close the connections open and close the sessions.
Keep a number of connections at the ready in a custom pool and use specific logic when it is returned to the pool. However unless you go the J2EE route this will mean changes in your code...

Enjoy
Back to top
View user's profile Send private message Send e-mail
JohnRodey
PostPosted: Thu Nov 17, 2005 12:11 pm    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Jeff, ...or to anyone who can help =)


What I want to do is be able to do send()'s and receive()'s through JMS (no app servers) without having to create a connection to MQ everytime, or ever for that matter. I would like my code to say "get me a connection from a pool" rather then "create me connection".

I looked into the Application Server Facilities and the sample applications. The sample applications only show how to create an application that acts like an MDB. This isn't the functionality I am looking for. The Load1.java application, which is more like the logic that I want to add connection pooling to, simply creates a connection. Is there any examples of how to aquire this functionality? Is it possible?

Thanks for any help!!!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Nov 17, 2005 12:21 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Your app is going to have to create a connection at some point - at least one - no matter what.

There's no way, that I know of, to "store" an active connection while your application is not running. The only way to do it is to have some piece of code initialize connections, and then stay running. Then you can retrieve a connection, use it, and give it back to the pool.

It gets even more complicated, and may not be possible, to pass a connection between processes. So you can't have one process make connections, and then hand those connections over to another process.

The only thing you can do is create a long running delegate, that will act as your sender/receiver, and merely exchange data with your application, rather than connections.

But that's a lot like "acting like an MDB", and you said you don't want that.

If you consider the source of Load1.java, and you consider having it create multiple conenctions at start, and then store those connections in a collection, and then adding methods to fetch a free connection from the collection and then add it back to the collection... Then you start rewriting some of the things that are already available through the Application Server Facilities... and why reinvent the wheel?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JohnRodey
PostPosted: Thu Nov 17, 2005 12:47 pm    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

So if I have applications that send requests to services to do work and wait for a response could ASF be of any assistance?

The only side I care about is the requestor side. The services are always running and talking to the same QM, so they can simply hold their connections forever so performance isnt an issue there.

The ASF samples only show examples of OnMessage applications (MDBs) making use of receiving messages, not sending.

These requestors might only have to send one message, and even if they have to send more than one they might be sending to multiple QM's. The requestors are coming up and down all the time.

So is ASF useful in my scenario? It seems like ASF (at least one of its main features) is for creating a pool of MDBs. correct or no?

Thanks Jeff!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Nov 17, 2005 2:15 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

From what I recall from the last time I looked at it, the ASF provided a general purpose connection pool.

Let me reiterate a bit about my earlier point though. If your "services" are running all the time, and your "requesters" are starting and stopping, then they are in different processes. And you can't share connections between processes.

So you will have to essentially invoke the service by establishing your own connection to the service, and then passing all of your data to the service... which is not necessarily going to be any faster or cheaper than an MQ connection followed by an MQ Put.

What type of thing is initiating the requestor? Maybe you should look at building a tighter integration between the requestor invoker and the services.
_________________
I am *not* the model of the modern major general.
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 » Pooling JMS Connections
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.