Discussion:
Timeout for sending messages / creating connections on a JMS MQ Queue
(too old to reply)
n***@techno.ms
2007-08-01 10:17:46 UTC
Permalink
Hi!

In our application we try to send messages to a MQ JMS Queue to a remote system. In case of network errors, however, we want to save the message somewhere else for now and continue.

The trouble however is that we did not find a timeout setting for the sending of JMS messages. Thus, the sending of the message will hang in case of connection problems for about two minutes, before sending a timeout. This is much too long for our purposes, since this happens within a webservice call. What can we do?

There is a timeout setting at
WebSphere-MQ-Messaging-Provider > connection factories for mq queues > ... > connection pools,
but this doesn't seem to apply in this case. We both want to reduce the timeout for creating connections and for sending a message.

Thanks for any help!

Best regards,

Hans-Peter Stoerr

PS: We are using Websphere Application Server 6.0
Brian S Paskin
2007-08-01 10:48:59 UTC
Permalink
Hi,

Under the Connection Pool properties in the Queue Connection Factory has a Connection Timeout setting. The default is 180 seconds. Set this to the value you wish. If a connection cannot be established within the value limit it will throw a ConnectionWaitTimeoutException.

Brian
Yuriy Petrov
2007-08-01 12:21:20 UTC
Permalink
Post by n***@techno.ms
...
In our application we try to send messages to a MQ JMS Queue to a remote system. In case of network errors, however, we want to save the message somewhere else for now and continue.
...
What do you mean when you say "remote system" - remote queue or remote queue manager?

If you mean "remote queue" but you have local queue manager then use "binding" transport type and
you are already in a good shape - just use "binding" transport type when you configure connection
factories. Local queue manager will take care about all problems that may happen when it delivers
the message to the remote queue. Actually, this is the main purpose of MQ - _reliable_ message
delivery and MQ provides this pretty well when all message producers and receivers talk to their
local queue managers.

If you don't have local queue manager, you should probably consider to install local queue manager
rather than reinventing the wheel.
n***@techno.ms
2007-08-03 08:57:12 UTC
Permalink
Post by Yuriy Petrov
If you don't have local queue manager, you should
probably consider to install local queue manager
rather than reinventing the wheel.
Thank you, we will indeed switch from a remote queue manager to a local queue manager with a remote queue.
Post by Yuriy Petrov
Under the Connection Pool properties in the Queue
Connection Factory has a Connection Timeout setting.
The default is 180 seconds.
Yes, we tried that, but it doesn't help. The detailed documentation says this is a timeout when you try get a connection from the pool and the pool is maxed out. In our tests it did not have an effect if you could get a connection from the pool and try to connect to the queue.

Best regards,

Hans-Peter Stoerr
d***@bigfoot.com
2007-08-16 11:39:42 UTC
Permalink
Post by n***@techno.ms
Post by Yuriy Petrov
If you don't have local queue manager, you should
probably consider to install local queue manager
rather than reinventing the wheel.
Thank you, we will indeed switch from a remote queue manager to a local queue manager with a remote queue.
Post by Yuriy Petrov
Under the Connection Pool properties in the Queue
Connection Factory has a Connection Timeout setting.
The default is 180 seconds.
Yes, we tried that, but it doesn't help. The detailed documentation says this is a timeout when you try get a connection from the pool and the pool is maxed out. In our tests it did not have an effect if you could get a connection from the pool and try to connect to the queue.
Best regards,
Hans-Peter Stoerr
Hans-Peter,

We've encountered this as well. We have number of JVMs that subscribe
on startup and if something is misconfigured it takes a lot of time to
start (i.e. each connection times out. I'm think I'll contact IBM to
see if they can let me know a way of overriding....

Regards,

Derek.
d***@bigfoot.com
2007-08-17 08:49:27 UTC
Permalink
Post by d***@bigfoot.com
Post by n***@techno.ms
Post by Yuriy Petrov
If you don't have local queue manager, you should
probably consider to install local queue manager
rather than reinventing the wheel.
Thank you, we will indeed switch from a remote queue manager to a local queue manager with a remote queue.
Post by Yuriy Petrov
Under the Connection Pool properties in the Queue
Connection Factory has a Connection Timeout setting.
The default is 180 seconds.
Yes, we tried that, but it doesn't help. The detailed documentation says this is a timeout when you try get a connection from the pool and the pool is maxed out. In our tests it did not have an effect if you could get a connection from the pool and try to connect to the queue.
Best regards,
Hans-Peter Stoerr
Hans-Peter,
We've encountered this as well. We have number of JVMs that subscribe
on startup and if something is misconfigured it takes a lot of time to
start (i.e. each connection times out. I'm think I'll contact IBM to
see if they can let me know a way of overriding....
Regards,
Derek.
I had another look around and discovered there's a public
setBrokerTimeout(int ms) method on com.ibm.mq.jms.MQSession. This
defaults to 120000ms (2mins). this is the base class for QueueSession
and TopicSession so you can get at the method by casting.

Regards,

Derek.

m***@cpsi-md.com
2007-08-01 13:31:37 UTC
Permalink
I am reaching out to the MQ user community to see if there is anyone
that might be interested in some employment opportunities in the
Baltimore area.

Please visit our web site - www.cpsi-md.com
Post by n***@techno.ms
Hi!
In our application we try to send messages to a MQ JMS Queue to a remote system. In case of network errors, however, we want to save the message somewhere else for now and continue.
The trouble however is that we did not find a timeout setting for the sending of JMS messages. Thus, the sending of the message will hang in case of connection problems for about two minutes, before sending a timeout. This is much too long for our purposes, since this happens within a webservice call. What can we do?
There is a timeout setting at
WebSphere-MQ-Messaging-Provider > connection factories for mq queues > ... > connection pools,
but this doesn't seem to apply in this case. We both want to reduce the timeout for creating connections and for sending a message.
Thanks for any help!
Best regards,
Hans-Peter Stoerr
PS: We are using Websphere Application Server 6.0
Loading...