activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: How can I retrieve a Stomp username when a new Connection is made?
Date Thu, 29 Nov 2012 18:48:00 GMT
Yes, the advisory broker will delete the username/password from a
connectionInfo before dispatching to the advisories.

Since you're creating the broker in code, are you asking for how to
retrieve the username/password through the BrokerService object?

You can retrieve the username for a connection through jmx, btw...


On Thu, Nov 29, 2012 at 11:11 AM, prgtrdr <prgtrdr@gmail.com> wrote:

> I'm stuck on something that is probably obvious but I just can't figure out
> how to do it.
>
> What I want to do is retrieve the userName from an incoming Stomp
> connection.  I am creating the broker in my code and have also set up
> monitoring Advisory messages.  The Advisory onMessage() function receives
> the ConnectionInfo message but the userName and password are deleted from
> the message, and the ConnectionInfo.getUserName() returns a null string.
>
> My guess is to get the userName I have to somehow lookup the Connection
> object based on the ConnectionId contained in the Advisory ConnectionInfo
> message, then I can get the userName from the Connection.
>
> Is that right?  Or is there an easier way?  If it's right, how do I lookup
> the Connection object in the Advisory onMessage callback?
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-can-I-retrieve-a-Stomp-username-when-a-new-Connection-is-made-tp4659949.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message