You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Phil Crowder <pc...@hotmail.com> on 2018/04/24 14:54:55 UTC

[ARTEMIS] Get name of consumer in an interceptor

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

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

Posted by Phil Crowder <pc...@hotmail.com>.
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

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

Posted by Justin Bertram <jb...@apache.org>.
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 <pc...@hotmail.com>
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
>