[ARTEMIS] Get name of consumer in an interceptor

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

[ARTEMIS] Get name of consumer in an interceptor

Phil Crowder
I'm trying to get the consumer's user id/ name that is consuming messages on
topic queue. I can see a userId on the Message object but it looks like a
UUID. Is there a way to map the UUID to the connected consumer? Should I
look at something else? Or is there another way to get this information?

I was also trying to look at the buffer on the Message object but I get a
NoSuchMethodError exception using the getBuffer method.

I'm using Artemis 2.5 and my jar is in the artemis instance's lib directory.
It is calling the interceptor.





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: [ARTEMIS] Get name of consumer in an interceptor

jbertram
As discussed in IRC I think your best bet is to use a broker plugin.


Justin

On Tue, Apr 24, 2018 at 9:54 AM, Phil Crowder <[hidden email]>
wrote:

> I'm trying to get the consumer's user id/ name that is consuming messages
> on
> topic queue. I can see a userId on the Message object but it looks like a
> UUID. Is there a way to map the UUID to the connected consumer? Should I
> look at something else? Or is there another way to get this information?
>
> I was also trying to look at the buffer on the Message object but I get a
> NoSuchMethodError exception using the getBuffer method.
>
> I'm using Artemis 2.5 and my jar is in the artemis instance's lib
> directory.
> It is calling the interceptor.
>
>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>
Reply | Threaded
Open this post in threaded view
|

Re: [ARTEMIS] Get name of consumer in an interceptor

Phil Crowder
So the broker plugin does return the data that i need. However, the
beforeDeliver and afterDeliver methods are firing when a JMS subscription by
a client is made and not when the message is consumed by a JMS client. I
have verified this, I believe, by

1. Subscribing the the topic with a JMS client.
2. Sending messages to the topic with a JMS client (different one than the
consumer in step 1).
3. The beforeDeliver and afterDeliver methods are executed ie no JMS client
consume called.

If I add a JMS client consume call, there is no difference ie. the
beforeDeliver and afterDeliver are not called again.

Is that what you would expect? It is not what I expected.

Phil



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html