We are looking into a way to implement some sort of connection pooling to a
message queue, through JMS.
We are thinking of the following architecture:
Create a stateless session bean which would represent a single queue manager
(we are using JMS over MQSeries, where every queue has to be created under a
queue manager). On creation of the bean, it would create a QueueFactory
object (or extract it from the JNDI), and create a QueueConnection from it.
It would save the QueueConnection as a private member, hence the connection
would be created once - on the creation of the bean. The bean would have the
following public interface:
putToQueue(String queueName, String message)
Whenever another EJB bean (or any other client, for that matter) would want
to insert something to a queue it would call that method.
We are using the fact that session beans are not frequently removed (but are
returned to their pool until the next relevant invocation), hence we would
have some sort of a connection pooling - which is based on the application
server's pool of the session bean.
The drawbacks of this design is that we are creating a pool which is based
on the application server's capability of holding live instances of the
bean, and not on the messaging queue's capability of holding open
connections.
We would appreciate any comment on this idea.
Thanks,
Ohad.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".