Trying to track which users write to what Queues

Posted by jasonburrows on 27-Apr-2010 13:34

Hi All -

I'm trying to programmatically track what users are writing to our queues.  Specifically, in practice who is actually writing to the queue, not who has access rights to the queue.  I'm also trying to do this without making any changes to the clients using the queues or the messaging that is already in place.

The closest I can get (and the track I've been on for a bit) is to use the Management Notification system.  Using the IBrokerProxy interface here I can tell who is reading from the queue by listening for application.session.EndReceive/StartReceive notifications, but I've been unable to find corresponding notifications for when a message is sent.  If I had the exact same notifications for the message being sent I could extract the userId from the notification and I'd be good to go.

It is very likely I'm missing something obvious.  Any tips?

Thanks!

All Replies

Posted by Bill Wood on 28-Apr-2010 14:03

If you enable JMSUserID for the broker, then the messages in the queue will have the name of the sending user.

Posted by jasonburrows on 29-Apr-2010 10:11

I'm hoping to accomplish this without making changes to every consumer, and having a secondary component try to intercept every message to every queue just to compile a list of the user IDs seems a bit heavy handed.  Also there would be no guarantee that I'd get to the message before the existing consumers.

If this was being done from the ground up then that solution would be fine - but ideally I want something I can slap on to an existing system without making changes to that system.  The notification system seems to be my best bet, but its missing the notifications I'm interested in (provides a receive notification but no send notification).   ...or even if the receive notification provided the sender ID as well - that would be sufficient.

Posted by tsteinbo on 10-May-2010 06:19

In Sonic 8.0 we added AOP hooks for the clients. Maybe that would help you?

Posted by jasonburrows on 10-May-2010 10:05

It would help - we're not in a position to upgrade right now, but its nice to know that's there.

Thanks!

This thread is closed