Locked messages

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Locked messages

Matthew
Hi - could you please let me know under what circumstances a message gets 'Locked' (and has a padlock in the queue browser)?

I have a fairly simple requirement to send a message with a temporary queue on the JMSReplyTO which is then used to send a response.  My guess is that the problem is arising because in my test environment we're running the client and server in the JVM (swift is on another box) and somehow the initial receiver is hanging on to the message.. but I don't really have a starting point having looked through the documentation...

any help would be appreciated - I've had to set up a permanent 'response' queue for now with selectors.

Many Thanks

Met.
Reply | Threaded
Open this post in threaded view
|

Re: Locked messages

IIT Software
Administrator
A message is locked when it was delivered to the client-side consumer cache (prefetching) but was not consumed yet by the JMS client app.

If you don't receive a message, a common mistake is that did not start the connection....
Reply | Threaded
Open this post in threaded view
|

Re: Locked messages

Matthew
Hmm i'm using the Spring JmsTemplate and the connection is started by the ESB.. I can see the connection in the Swift explorer...

would it cause an issue if the client and server are using the same connection?
Reply | Threaded
Open this post in threaded view
|

Re: Locked messages

IIT Software
Administrator
No, it doesn't matter whether requestor/replier are using the same connection. If you see the reply message in your reply queue with SwiftMQ Explorer and the message is locked, the message is in the client-side cache but not consumed yet. Under JMS Swiftlet/Usage you should see whether the resp. connection has been started or not.

Please check out SwiftMQ's request/response samples in "samples/router_network" of you distribution. Files P2PRequestor.java and P2PReplier.java. They are using 2 routers. In order to run it on a single router, specify connection factory, queue name etc on the command line.
Reply | Threaded
Open this post in threaded view
|

Re: Locked messages

Matthew
The connection is started - things only go wrong when I use the temporary Queue.  As soon as I swap the temporary queue for a predefined 'reply' queue it all works perfectly.  

Regarding temporaryQueues, i've read a number of articles that still use the messageID and correlationID when using the JMSReplyTo with temporary queues.. strictly this seems unnecessary as only the recipient could ever know the temporary queue existed??
Reply | Threaded
Open this post in threaded view
|

Re: Locked messages

IIT Software
Administrator
It works with temporary queues/topics. That's basic JMS 101 and works since years (our JNDI uses it under the covers). There must be something wrong with your requestor client. Did you check the P2PRequestor example? Run it, please. And then check what you make different. Basically you must create the temp queue, set it in JMSReplyTo, send the request, create a QueueReceiver on the temp. queue and call receive.

JMSMessageID/CorrelationID is nit required for request/reply.
Reply | Threaded
Open this post in threaded view
|

Re: Locked messages

Matthew
Yup - should be that simple eh!

I will revisit at some point this week and see what i was doing wrong.. no doubt when I go and try it again, it'll work first time!

I did have a look at the P2PRequestor and couldn't see any difference - i'll report back when I take another look.