You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Shannon Gallagher <sh...@connexta.com> on 2018/10/22 22:15:38 UTC

Get java subject from remote interceptor

Hello,

I am trying to get a java subject (connection.getSubject()) in a remote
interceptor and it is always null. Ultimately, I would like to prevent
messages from being consumed if the subject's associated principals do not
match what is required by the message (as defined in the message).  



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

Re: Get java subject from remote interceptor

Posted by Justin Bertram <jb...@apache.org>.
I assume you're asking about ActiveMQ Artemis.  If that's the case, it's
worth noting that
org.apache.activemq.artemis.spi.core.protocol.RemotingConnection#getSubject
is only implemented for AMQP connections and it was added when Kerberos
support was implemented. Nothing else in the broker utilizes that method.

In general, security is enforced on an address or queue basis rather than
per-message.

That said, you may be able to implement the functionality you want using a
broker plugin [1] instead of a remote interceptor.


Justin

[1] https://activemq.apache.org/artemis/docs/latest/broker-plugins.html

On Mon, Oct 22, 2018 at 5:15 PM Shannon Gallagher <
shannon.gallagher@connexta.com> wrote:

> Hello,
>
> I am trying to get a java subject (connection.getSubject()) in a remote
> interceptor and it is always null. Ultimately, I would like to prevent
> messages from being consumed if the subject's associated principals do not
> match what is required by the message (as defined in the message).
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>