I would like to add a header property prior to messages being inserted into a jms queue. The problem is that I do not have control over the client application. Is there any way on the server side to recieve the jms message from the client, run some code to add the property, and then continue to insert the message in the queue?
What I am really trying to accomplish, is to get the username for the user that sent a message into a queue at the time that is is recieved by the queue listener on the other side. My solution is to add a username string property to the header. If there is a better way to do this , I have not been able to find it.
Any help is appreciated.
There is an example interceptor on the WIKI.
But the user/password have been discarded by the time you send messages
(replaced with a security token) so you would need to keep your own cross reference
of which ConnectionTokens map to which users.