advisory messages username logging

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

advisory messages username logging

osatien
hello i want to log every user that connects to an  specific queue, i think
that it is dont by reading advisory messages or by doing a plugin that
intercepts calls to the broker. (BrokerFilter) the first try is  reading
advisory .. but the username is not setted receiving null....any help????
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

christopher.l.shannon
Advisory messages delivered to ActiveMQ.Advisory.Connection will contain a
ConnectionInfo object as part of the data structure field of the message.
That object will contain the user name used for the new connection.
Passwords will always be cleared, however.

On Tue, Jun 16, 2015 at 5:41 AM, ALi <[hidden email]> wrote:

> hello i want to log every user that connects to an  specific queue, i think
> that it is dont by reading advisory messages or by doing a plugin that
> intercepts calls to the broker. (BrokerFilter) the first try is  reading
> advisory .. but the username is not setted receiving null....any help????
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

osatien
i dont know where .... i am connecting with stomp and ws ..... this is what
this log shows:

(using camel to print message)

<route>
<from
uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
/>
   <convertBodyTo type="java.lang.String"/>
   <transform>
      <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.header.user}
${in.body} ${in.headers} \r\n</simple>
   </transform>
   <to
uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
/>
</route>


20150616-01-16-27   ActiveMQMessage {commandId = 0, responseRequired =
false, messageId = ID:COMPUTER-62265-1434453235120-1:1:0:0:10,
originalDestination = null, originalTransactionId = null, producerId =
ID:COMPUTER-62265-1434453235120-1:1:0:0, destination =
topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434453387887,
brokerOutTime = 1434453387890, correlationId = null, replyTo = null,
persistent = false, type = Advisory, priority = 0, groupID = null,
groupSequence = 0, targetConsumerId = null, compressed = false, userID =
null, content = null, marshalledProperties = null, dataStructure =
ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
ID:COMPUTER-62265-1434453235120-6:1:-1:1, destination = queue://TEST.Q,
prefetchSize = 1000, maximumPendingMessageLimit = 0, browser = false,
dispatchAsync = true, selector = null, subscriptionName = null, noLocal =
false, exclusive = false, retroactive = false, priority = 0, brokerPath =
null, optimizedAcknowledge = false, noRangeAcks = false,
additionalPredicate = null}, redeliveryCounter = 0, size = 1024, properties
= {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
originBrokerId=ID:COMPUTER-62265-1434453235120-0:1,
originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
true, droppable = false}  ::::{originBrokerURL=tcp://127.0.0.1:61616,
JMSRedelivered=false,
breadcrumbId=ID:COMPUTER-62265-1434453235120-1:1:0:0:10, JMSType=Advisory,
JMSDeliveryMode=1, JMSCorrelationID=null, JMSReplyTo=null,
JMSXGroupID=null, JMSMessageID=ID:COMPUTER-62265-1434453235120-1:1:0:0:10,
originBrokerId=ID:COMPUTER-62265-1434453235120-0:1,
originBrokerName=amq-broker, consumerCount=1, JMSTimestamp=0,
JMSExpiration=0,
JMSDestination=topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q,
JMSPriority=0}::{originBrokerURL=tcp://127.0.0.1:61616,
JMSRedelivered=false,
breadcrumbId=ID:COMPUTER-62265-1434453235120-1:1:0:0:10, JMSType=Advisory,
JMSDeliveryMode=1, JMSCorrelationID=null, JMSReplyTo=null,
JMSXGroupID=null, JMSMessageID=ID:COMPUTER-62265-1434453235120-1:1:0:0:10,
originBrokerId=ID:COMPUTER-62265-1434453235120-0:1,
originBrokerName=amq-broker, consumerCount=1, JMSTimestamp=0,
JMSExpiration=0,
JMSDestination=topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q,
JMSPriority=0}


perhaps the headers are twice (i dont remember my last editiion) and i dont
see the user in this log (guest)

the username in jmx is null






On Tue, Jun 16, 2015 at 1:42 PM, Christopher Shannon <
[hidden email]> wrote:

> Advisory messages delivered to ActiveMQ.Advisory.Connection will contain a
> ConnectionInfo object as part of the data structure field of the message.
> That object will contain the user name used for the new connection.
> Passwords will always be cleared, however.
>
> On Tue, Jun 16, 2015 at 5:41 AM, ALi <[hidden email]> wrote:
>
> > hello i want to log every user that connects to an  specific queue, i
> think
> > that it is dont by reading advisory messages or by doing a plugin that
> > intercepts calls to the broker. (BrokerFilter) the first try is  reading
> > advisory .. but the username is not setted receiving null....any help????
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

christopher.l.shannon
The advisory topic "ActiveMQ.Advisory.Consumer.Queue.TEST.Q" will send
messages alerting you of new consumers and you will receive a
"ConsumerInfo" object which won't contain the user name.  That will contain
a reference to the consumerId instead, since the connection was already
created.  The consumerId will contain the connectionId.  There can be
multiple consumers per connection which all share the same user name which
is why you need to listen for connection advisories on
ActiveMQ.Advisory.Connection
topic if you want to know what user name was used to connect.

If you want to know the user name for when new consumers come online then
you will need to keep track of the connections first and match it up.  If
you listen on ActiveMQ.Advisory.Connection, you could keep track of
connectionIds and associated user names.  Then, when you receive a message
on ActiveMQ.Advisory.Consumer.Queue.TEST.Q, the consumer info object will
contain the ConsumerId (which contains connection id) and you can then use
that to look up the user name that matches up with the connection.

The other alternative besides using advisories is to do something similar
with a BrokerFilter (as you mentioned in your first message) but it will be
the same strategy.  You would need to keep track of new connections in the
addConnection method (which passes a ConnectionInfo object to the method
and will have the user name for the connection) and then in the addConsumer
method you can look up the connection associated with the ConsumerInfo that
is passed to that method.

On Tue, Jun 16, 2015 at 8:05 AM, ALi <[hidden email]> wrote:

> i dont know where .... i am connecting with stomp and ws ..... this is what
> this log shows:
>
> (using camel to print message)
>
> <route>
> <from
>
> uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
> />
>    <convertBodyTo type="java.lang.String"/>
>    <transform>
>       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.header.user}
> ${in.body} ${in.headers} \r\n</simple>
>    </transform>
>    <to
>
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> />
> </route>
>
>
> 20150616-01-16-27   ActiveMQMessage {commandId = 0, responseRequired =
> false, messageId = ID:COMPUTER-62265-1434453235120-1:1:0:0:10,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:COMPUTER-62265-1434453235120-1:1:0:0, destination =
> topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
> expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434453387887,
> brokerOutTime = 1434453387890, correlationId = null, replyTo = null,
> persistent = false, type = Advisory, priority = 0, groupID = null,
> groupSequence = 0, targetConsumerId = null, compressed = false, userID =
> null, content = null, marshalledProperties = null, dataStructure =
> ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
> ID:COMPUTER-62265-1434453235120-6:1:-1:1, destination = queue://TEST.Q,
> prefetchSize = 1000, maximumPendingMessageLimit = 0, browser = false,
> dispatchAsync = true, selector = null, subscriptionName = null, noLocal =
> false, exclusive = false, retroactive = false, priority = 0, brokerPath =
> null, optimizedAcknowledge = false, noRangeAcks = false,
> additionalPredicate = null}, redeliveryCounter = 0, size = 1024, properties
> = {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
> originBrokerId=ID:COMPUTER-62265-1434453235120-0:1,
> originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
> true, droppable = false}  ::::{originBrokerURL=tcp://127.0.0.1:61616,
> JMSRedelivered=false,
> breadcrumbId=ID:COMPUTER-62265-1434453235120-1:1:0:0:10, JMSType=Advisory,
> JMSDeliveryMode=1, JMSCorrelationID=null, JMSReplyTo=null,
> JMSXGroupID=null, JMSMessageID=ID:COMPUTER-62265-1434453235120-1:1:0:0:10,
> originBrokerId=ID:COMPUTER-62265-1434453235120-0:1,
> originBrokerName=amq-broker, consumerCount=1, JMSTimestamp=0,
> JMSExpiration=0,
> JMSDestination=topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q,
> JMSPriority=0}::{originBrokerURL=tcp://127.0.0.1:61616,
> JMSRedelivered=false,
> breadcrumbId=ID:COMPUTER-62265-1434453235120-1:1:0:0:10, JMSType=Advisory,
> JMSDeliveryMode=1, JMSCorrelationID=null, JMSReplyTo=null,
> JMSXGroupID=null, JMSMessageID=ID:COMPUTER-62265-1434453235120-1:1:0:0:10,
> originBrokerId=ID:COMPUTER-62265-1434453235120-0:1,
> originBrokerName=amq-broker, consumerCount=1, JMSTimestamp=0,
> JMSExpiration=0,
> JMSDestination=topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q,
> JMSPriority=0}
>
>
> perhaps the headers are twice (i dont remember my last editiion) and i dont
> see the user in this log (guest)
>
> the username in jmx is null
>
>
>
>
>
>
> On Tue, Jun 16, 2015 at 1:42 PM, Christopher Shannon <
> [hidden email]> wrote:
>
> > Advisory messages delivered to ActiveMQ.Advisory.Connection will contain
> a
> > ConnectionInfo object as part of the data structure field of the message.
> > That object will contain the user name used for the new connection.
> > Passwords will always be cleared, however.
> >
> > On Tue, Jun 16, 2015 at 5:41 AM, ALi <[hidden email]> wrote:
> >
> > > hello i want to log every user that connects to an  specific queue, i
> > think
> > > that it is dont by reading advisory messages or by doing a plugin that
> > > intercepts calls to the broker. (BrokerFilter) the first try is
> reading
> > > advisory .. but the username is not setted receiving null....any
> help????
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

osatien
Thank you very nice explanation I will try in this manner
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

christopher.l.shannon
No problem, let me know if you have any more questions.

Chris

On Tue, Jun 16, 2015 at 9:13 AM, ALi <[hidden email]> wrote:

> Thank you very nice explanation I will try in this manner
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

osatien
this is what i see with this two routes

<route>
<from
uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
/>
   <convertBodyTo type="java.lang.String"/>
   <transform>
      <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}   ${in.body}  \r\n</simple>
   </transform>
   <to
uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
/>
</route>
<route>
<from uri="activemq:topic:ActiveMQ.Advisory.Connection" />
   <convertBodyTo type="java.lang.String"/>
   <transform>
      <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.body} \r\n</simple>
   </transform>
   <to
uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
/>
</route>




20150617-08-31-04

20150617-08-31-37

20150617-08-31-37   ActiveMQMessage {commandId = 0, responseRequired =
false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:11,
originalDestination = null, originalTransactionId = null, producerId =
ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434522697947,
brokerOutTime = 1434522697947, correlationId = null, replyTo = null,
persistent = false, type = Advisory, priority = 0, groupID = null,
groupSequence = 0, targetConsumerId = null, compressed = false, userID =
null, content = null, marshalledProperties = null, dataStructure =
ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
ID:COMPUTER-61030-1434522661496-4:1:-1:1, destination = queue://TEST.Q,
prefetchSize = 1000, maximumPendingMessageLimit = 0, browser = false,
dispatchAsync = true, selector = null, subscriptionName = null, noLocal =
false, exclusive = false, retroactive = false, priority = 0, brokerPath =
null, optimizedAcknowledge = false, noRangeAcks = false,
additionalPredicate = null}, redeliveryCounter = 0, size = 1024, properties
= {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
true, droppable = false}

20150617-08-33-20   ActiveMQMessage {commandId = 0, responseRequired =
false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:12,
originalDestination = null, originalTransactionId = null, producerId =
ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434522800355,
brokerOutTime = 1434522800355, correlationId = null, replyTo = null,
persistent = false, type = Advisory, priority = 0, groupID = null,
groupSequence = 0, targetConsumerId = null, compressed = false, userID =
null, content = null, marshalledProperties = null, dataStructure =
RemoveInfo {commandId = 0, responseRequired = false, objectId =
ID:COMPUTER-61030-1434522661496-4:1:-1:1, lastDeliveredSequenceId = 0},
redeliveryCounter = 0, size = 1024, properties = {consumerCount=0,
originBrokerURL=tcp://127.0.0.1:61616,
originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
true, droppable = false}

20150617-08-33-20




it seems that connection messages arent "printable"????




On Tue, Jun 16, 2015 at 4:00 PM, Christopher Shannon <
[hidden email]> wrote:

> No problem, let me know if you have any more questions.
>
> Chris
>
> On Tue, Jun 16, 2015 at 9:13 AM, ALi <[hidden email]> wrote:
>
> > Thank you very nice explanation I will try in this manner
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

osatien
it seems that the headers are set with no message ...... but in the headers
i dont see the username (guest) only headers of the message

On Wed, Jun 17, 2015 at 8:37 AM, ALi <[hidden email]> wrote:

> this is what i see with this two routes
>
> <route>
> <from
> uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
> />
>    <convertBodyTo type="java.lang.String"/>
>    <transform>
>       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}   ${in.body}  \r\n</simple>
>    </transform>
>    <to
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> />
> </route>
> <route>
> <from uri="activemq:topic:ActiveMQ.Advisory.Connection" />
>    <convertBodyTo type="java.lang.String"/>
>    <transform>
>       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.body} \r\n</simple>
>    </transform>
>    <to
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> />
> </route>
>
>
>
>
> 20150617-08-31-04
>
> 20150617-08-31-37
>
> 20150617-08-31-37   ActiveMQMessage {commandId = 0, responseRequired =
> false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:11,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
> expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434522697947,
> brokerOutTime = 1434522697947, correlationId = null, replyTo = null,
> persistent = false, type = Advisory, priority = 0, groupID = null,
> groupSequence = 0, targetConsumerId = null, compressed = false, userID =
> null, content = null, marshalledProperties = null, dataStructure =
> ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
> ID:COMPUTER-61030-1434522661496-4:1:-1:1, destination = queue://TEST.Q,
> prefetchSize = 1000, maximumPendingMessageLimit = 0, browser = false,
> dispatchAsync = true, selector = null, subscriptionName = null, noLocal =
> false, exclusive = false, retroactive = false, priority = 0, brokerPath =
> null, optimizedAcknowledge = false, noRangeAcks = false,
> additionalPredicate = null}, redeliveryCounter = 0, size = 1024, properties
> = {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
> originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
> true, droppable = false}
>
> 20150617-08-33-20   ActiveMQMessage {commandId = 0, responseRequired =
> false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:12,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
> expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434522800355,
> brokerOutTime = 1434522800355, correlationId = null, replyTo = null,
> persistent = false, type = Advisory, priority = 0, groupID = null,
> groupSequence = 0, targetConsumerId = null, compressed = false, userID =
> null, content = null, marshalledProperties = null, dataStructure =
> RemoveInfo {commandId = 0, responseRequired = false, objectId =
> ID:COMPUTER-61030-1434522661496-4:1:-1:1, lastDeliveredSequenceId = 0},
> redeliveryCounter = 0, size = 1024, properties = {consumerCount=0,
> originBrokerURL=tcp://127.0.0.1:61616,
> originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
> true, droppable = false}
>
> 20150617-08-33-20
>
>
>
>
> it seems that connection messages arent "printable"????
>
>
>
>
> On Tue, Jun 16, 2015 at 4:00 PM, Christopher Shannon <
> [hidden email]> wrote:
>
>> No problem, let me know if you have any more questions.
>>
>> Chris
>>
>> On Tue, Jun 16, 2015 at 9:13 AM, ALi <[hidden email]> wrote:
>>
>> > Thank you very nice explanation I will try in this manner
>> >
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

christopher.l.shannon
If the user name has been set it would be under the dataStructure field
inside the ConnectionInfo object.  Just like in your previous message you
can see a ConsumerInfo object when listening for new consumers.  Are you
sure you are setting the user name/credentials when making a connection?
When I test this out I am getting the user name in that object on the
advisory.

On Wed, Jun 17, 2015 at 2:45 AM, ALi <[hidden email]> wrote:

> it seems that the headers are set with no message ...... but in the headers
> i dont see the username (guest) only headers of the message
>
> On Wed, Jun 17, 2015 at 8:37 AM, ALi <[hidden email]> wrote:
>
> > this is what i see with this two routes
> >
> > <route>
> > <from
> >
> uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
> > />
> >    <convertBodyTo type="java.lang.String"/>
> >    <transform>
> >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}   ${in.body}
> \r\n</simple>
> >    </transform>
> >    <to
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > />
> > </route>
> > <route>
> > <from uri="activemq:topic:ActiveMQ.Advisory.Connection" />
> >    <convertBodyTo type="java.lang.String"/>
> >    <transform>
> >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.body} \r\n</simple>
> >    </transform>
> >    <to
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > />
> > </route>
> >
> >
> >
> >
> > 20150617-08-31-04
> >
> > 20150617-08-31-37
> >
> > 20150617-08-31-37   ActiveMQMessage {commandId = 0, responseRequired =
> > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:11,
> > originalDestination = null, originalTransactionId = null, producerId =
> > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
> > expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434522697947,
> > brokerOutTime = 1434522697947, correlationId = null, replyTo = null,
> > persistent = false, type = Advisory, priority = 0, groupID = null,
> > groupSequence = 0, targetConsumerId = null, compressed = false, userID =
> > null, content = null, marshalledProperties = null, dataStructure =
> > ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
> > ID:COMPUTER-61030-1434522661496-4:1:-1:1, destination = queue://TEST.Q,
> > prefetchSize = 1000, maximumPendingMessageLimit = 0, browser = false,
> > dispatchAsync = true, selector = null, subscriptionName = null, noLocal =
> > false, exclusive = false, retroactive = false, priority = 0, brokerPath =
> > null, optimizedAcknowledge = false, noRangeAcks = false,
> > additionalPredicate = null}, redeliveryCounter = 0, size = 1024,
> properties
> > = {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
> > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
> > true, droppable = false}
> >
> > 20150617-08-33-20   ActiveMQMessage {commandId = 0, responseRequired =
> > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:12,
> > originalDestination = null, originalTransactionId = null, producerId =
> > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
> > expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1434522800355,
> > brokerOutTime = 1434522800355, correlationId = null, replyTo = null,
> > persistent = false, type = Advisory, priority = 0, groupID = null,
> > groupSequence = 0, targetConsumerId = null, compressed = false, userID =
> > null, content = null, marshalledProperties = null, dataStructure =
> > RemoveInfo {commandId = 0, responseRequired = false, objectId =
> > ID:COMPUTER-61030-1434522661496-4:1:-1:1, lastDeliveredSequenceId = 0},
> > redeliveryCounter = 0, size = 1024, properties = {consumerCount=0,
> > originBrokerURL=tcp://127.0.0.1:61616,
> > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
> > true, droppable = false}
> >
> > 20150617-08-33-20
> >
> >
> >
> >
> > it seems that connection messages arent "printable"????
> >
> >
> >
> >
> > On Tue, Jun 16, 2015 at 4:00 PM, Christopher Shannon <
> > [hidden email]> wrote:
> >
> >> No problem, let me know if you have any more questions.
> >>
> >> Chris
> >>
> >> On Tue, Jun 16, 2015 at 9:13 AM, ALi <[hidden email]> wrote:
> >>
> >> > Thank you very nice explanation I will try in this manner
> >> >
> >>
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

osatien
i think yes ... because if i dont put user i am unable to get access (using
web socket in the demo application)

so it must be set .... or perhaps the ws doesnt set user????? that is why i
am asking .... when connecting ... the connectioninfo is not in  the
advisory of connection (perhaps it must be in the  connection if i make a
filter but i wanted to do it "by configuration" just to log the user that
connects to a topic/queue)

On Wed, Jun 17, 2015 at 1:23 PM, Christopher Shannon <
[hidden email]> wrote:

> If the user name has been set it would be under the dataStructure field
> inside the ConnectionInfo object.  Just like in your previous message you
> can see a ConsumerInfo object when listening for new consumers.  Are you
> sure you are setting the user name/credentials when making a connection?
> When I test this out I am getting the user name in that object on the
> advisory.
>
> On Wed, Jun 17, 2015 at 2:45 AM, ALi <[hidden email]> wrote:
>
> > it seems that the headers are set with no message ...... but in the
> headers
> > i dont see the username (guest) only headers of the message
> >
> > On Wed, Jun 17, 2015 at 8:37 AM, ALi <[hidden email]> wrote:
> >
> > > this is what i see with this two routes
> > >
> > > <route>
> > > <from
> > >
> >
> uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
> > > />
> > >    <convertBodyTo type="java.lang.String"/>
> > >    <transform>
> > >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}   ${in.body}
> > \r\n</simple>
> > >    </transform>
> > >    <to
> > >
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > > />
> > > </route>
> > > <route>
> > > <from uri="activemq:topic:ActiveMQ.Advisory.Connection" />
> > >    <convertBodyTo type="java.lang.String"/>
> > >    <transform>
> > >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.body}
> \r\n</simple>
> > >    </transform>
> > >    <to
> > >
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > > />
> > > </route>
> > >
> > >
> > >
> > >
> > > 20150617-08-31-04
> > >
> > > 20150617-08-31-37
> > >
> > > 20150617-08-31-37   ActiveMQMessage {commandId = 0, responseRequired =
> > > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:11,
> > > originalDestination = null, originalTransactionId = null, producerId =
> > > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
> > > expiration = 0, timestamp = 0, arrival = 0, brokerInTime =
> 1434522697947,
> > > brokerOutTime = 1434522697947, correlationId = null, replyTo = null,
> > > persistent = false, type = Advisory, priority = 0, groupID = null,
> > > groupSequence = 0, targetConsumerId = null, compressed = false, userID
> =
> > > null, content = null, marshalledProperties = null, dataStructure =
> > > ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
> > > ID:COMPUTER-61030-1434522661496-4:1:-1:1, destination = queue://TEST.Q,
> > > prefetchSize = 1000, maximumPendingMessageLimit = 0, browser = false,
> > > dispatchAsync = true, selector = null, subscriptionName = null,
> noLocal =
> > > false, exclusive = false, retroactive = false, priority = 0,
> brokerPath =
> > > null, optimizedAcknowledge = false, noRangeAcks = false,
> > > additionalPredicate = null}, redeliveryCounter = 0, size = 1024,
> > properties
> > > = {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
> > > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > > originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
> > > true, droppable = false}
> > >
> > > 20150617-08-33-20   ActiveMQMessage {commandId = 0, responseRequired =
> > > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:12,
> > > originalDestination = null, originalTransactionId = null, producerId =
> > > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId = null,
> > > expiration = 0, timestamp = 0, arrival = 0, brokerInTime =
> 1434522800355,
> > > brokerOutTime = 1434522800355, correlationId = null, replyTo = null,
> > > persistent = false, type = Advisory, priority = 0, groupID = null,
> > > groupSequence = 0, targetConsumerId = null, compressed = false, userID
> =
> > > null, content = null, marshalledProperties = null, dataStructure =
> > > RemoveInfo {commandId = 0, responseRequired = false, objectId =
> > > ID:COMPUTER-61030-1434522661496-4:1:-1:1, lastDeliveredSequenceId = 0},
> > > redeliveryCounter = 0, size = 1024, properties = {consumerCount=0,
> > > originBrokerURL=tcp://127.0.0.1:61616,
> > > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > > originBrokerName=amq-broker}, readOnlyProperties = true, readOnlyBody =
> > > true, droppable = false}
> > >
> > > 20150617-08-33-20
> > >
> > >
> > >
> > >
> > > it seems that connection messages arent "printable"????
> > >
> > >
> > >
> > >
> > > On Tue, Jun 16, 2015 at 4:00 PM, Christopher Shannon <
> > > [hidden email]> wrote:
> > >
> > >> No problem, let me know if you have any more questions.
> > >>
> > >> Chris
> > >>
> > >> On Tue, Jun 16, 2015 at 9:13 AM, ALi <[hidden email]> wrote:
> > >>
> > >> > Thank you very nice explanation I will try in this manner
> > >> >
> > >>
> > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

christopher.l.shannon
What do your STOMP headers look like?  If you use the header property
called "login", then the use name should be set in the ConnectionInfo on
the advisory.  I just double checked this and ran a test using STOMP over
WS and I did indeed get an advisory message with the user name property set.

On Wed, Jun 17, 2015 at 7:29 AM, ALi <[hidden email]> wrote:

> i think yes ... because if i dont put user i am unable to get access (using
> web socket in the demo application)
>
> so it must be set .... or perhaps the ws doesnt set user????? that is why i
> am asking .... when connecting ... the connectioninfo is not in  the
> advisory of connection (perhaps it must be in the  connection if i make a
> filter but i wanted to do it "by configuration" just to log the user that
> connects to a topic/queue)
>
> On Wed, Jun 17, 2015 at 1:23 PM, Christopher Shannon <
> [hidden email]> wrote:
>
> > If the user name has been set it would be under the dataStructure field
> > inside the ConnectionInfo object.  Just like in your previous message you
> > can see a ConsumerInfo object when listening for new consumers.  Are you
> > sure you are setting the user name/credentials when making a connection?
> > When I test this out I am getting the user name in that object on the
> > advisory.
> >
> > On Wed, Jun 17, 2015 at 2:45 AM, ALi <[hidden email]> wrote:
> >
> > > it seems that the headers are set with no message ...... but in the
> > headers
> > > i dont see the username (guest) only headers of the message
> > >
> > > On Wed, Jun 17, 2015 at 8:37 AM, ALi <[hidden email]> wrote:
> > >
> > > > this is what i see with this two routes
> > > >
> > > > <route>
> > > > <from
> > > >
> > >
> >
> uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
> > > > />
> > > >    <convertBodyTo type="java.lang.String"/>
> > > >    <transform>
> > > >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}   ${in.body}
> > > \r\n</simple>
> > > >    </transform>
> > > >    <to
> > > >
> > >
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > > > />
> > > > </route>
> > > > <route>
> > > > <from uri="activemq:topic:ActiveMQ.Advisory.Connection" />
> > > >    <convertBodyTo type="java.lang.String"/>
> > > >    <transform>
> > > >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.body}
> > \r\n</simple>
> > > >    </transform>
> > > >    <to
> > > >
> > >
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > > > />
> > > > </route>
> > > >
> > > >
> > > >
> > > >
> > > > 20150617-08-31-04
> > > >
> > > > 20150617-08-31-37
> > > >
> > > > 20150617-08-31-37   ActiveMQMessage {commandId = 0, responseRequired
> =
> > > > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:11,
> > > > originalDestination = null, originalTransactionId = null, producerId
> =
> > > > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > > > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId =
> null,
> > > > expiration = 0, timestamp = 0, arrival = 0, brokerInTime =
> > 1434522697947,
> > > > brokerOutTime = 1434522697947, correlationId = null, replyTo = null,
> > > > persistent = false, type = Advisory, priority = 0, groupID = null,
> > > > groupSequence = 0, targetConsumerId = null, compressed = false,
> userID
> > =
> > > > null, content = null, marshalledProperties = null, dataStructure =
> > > > ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
> > > > ID:COMPUTER-61030-1434522661496-4:1:-1:1, destination =
> queue://TEST.Q,
> > > > prefetchSize = 1000, maximumPendingMessageLimit = 0, browser = false,
> > > > dispatchAsync = true, selector = null, subscriptionName = null,
> > noLocal =
> > > > false, exclusive = false, retroactive = false, priority = 0,
> > brokerPath =
> > > > null, optimizedAcknowledge = false, noRangeAcks = false,
> > > > additionalPredicate = null}, redeliveryCounter = 0, size = 1024,
> > > properties
> > > > = {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
> > > > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > > > originBrokerName=amq-broker}, readOnlyProperties = true,
> readOnlyBody =
> > > > true, droppable = false}
> > > >
> > > > 20150617-08-33-20   ActiveMQMessage {commandId = 0, responseRequired
> =
> > > > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:12,
> > > > originalDestination = null, originalTransactionId = null, producerId
> =
> > > > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > > > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId =
> null,
> > > > expiration = 0, timestamp = 0, arrival = 0, brokerInTime =
> > 1434522800355,
> > > > brokerOutTime = 1434522800355, correlationId = null, replyTo = null,
> > > > persistent = false, type = Advisory, priority = 0, groupID = null,
> > > > groupSequence = 0, targetConsumerId = null, compressed = false,
> userID
> > =
> > > > null, content = null, marshalledProperties = null, dataStructure =
> > > > RemoveInfo {commandId = 0, responseRequired = false, objectId =
> > > > ID:COMPUTER-61030-1434522661496-4:1:-1:1, lastDeliveredSequenceId =
> 0},
> > > > redeliveryCounter = 0, size = 1024, properties = {consumerCount=0,
> > > > originBrokerURL=tcp://127.0.0.1:61616,
> > > > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > > > originBrokerName=amq-broker}, readOnlyProperties = true,
> readOnlyBody =
> > > > true, droppable = false}
> > > >
> > > > 20150617-08-33-20
> > > >
> > > >
> > > >
> > > >
> > > > it seems that connection messages arent "printable"????
> > > >
> > > >
> > > >
> > > >
> > > > On Tue, Jun 16, 2015 at 4:00 PM, Christopher Shannon <
> > > > [hidden email]> wrote:
> > > >
> > > >> No problem, let me know if you have any more questions.
> > > >>
> > > >> Chris
> > > >>
> > > >> On Tue, Jun 16, 2015 at 9:13 AM, ALi <[hidden email]> wrote:
> > > >>
> > > >> > Thank you very nice explanation I will try in this manner
> > > >> >
> > > >>
> > > >
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: advisory messages username logging

osatien
i am unable to see username neither with stomp with ws neither with tcp
.....

i am putting this rule to camel so i can see it in file ..... and no
solution :(


<route>
<from
uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
/>
   <convertBodyTo type="java.lang.String"/>
   <transform>
      <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}   ${in.body}  ::${headers}
\r\n</simple>
   </transform>
   <to uri="log:input" />
   <to
uri="file://c:/compartida/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
/>

</route>
<route>
<from uri="activemq:topic:ActiveMQ.Advisory.Connection" />
   <convertBodyTo type="java.lang.String"/>
   <transform>
      <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.body}
:::${headers}\r\n</simple>
   </transform>

   <to
uri="file://c:/compartida/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
/>

</route>


can you test this please??? or how do you see the username? explain it to
me please :)

many thanks

On Wed, Jun 17, 2015 at 4:20 PM, Christopher Shannon <
[hidden email]> wrote:

> What do your STOMP headers look like?  If you use the header property
> called "login", then the use name should be set in the ConnectionInfo on
> the advisory.  I just double checked this and ran a test using STOMP over
> WS and I did indeed get an advisory message with the user name property
> set.
>
> On Wed, Jun 17, 2015 at 7:29 AM, ALi <[hidden email]> wrote:
>
> > i think yes ... because if i dont put user i am unable to get access
> (using
> > web socket in the demo application)
> >
> > so it must be set .... or perhaps the ws doesnt set user????? that is
> why i
> > am asking .... when connecting ... the connectioninfo is not in  the
> > advisory of connection (perhaps it must be in the  connection if i make a
> > filter but i wanted to do it "by configuration" just to log the user that
> > connects to a topic/queue)
> >
> > On Wed, Jun 17, 2015 at 1:23 PM, Christopher Shannon <
> > [hidden email]> wrote:
> >
> > > If the user name has been set it would be under the dataStructure field
> > > inside the ConnectionInfo object.  Just like in your previous message
> you
> > > can see a ConsumerInfo object when listening for new consumers.  Are
> you
> > > sure you are setting the user name/credentials when making a
> connection?
> > > When I test this out I am getting the user name in that object on the
> > > advisory.
> > >
> > > On Wed, Jun 17, 2015 at 2:45 AM, ALi <[hidden email]> wrote:
> > >
> > > > it seems that the headers are set with no message ...... but in the
> > > headers
> > > > i dont see the username (guest) only headers of the message
> > > >
> > > > On Wed, Jun 17, 2015 at 8:37 AM, ALi <[hidden email]> wrote:
> > > >
> > > > > this is what i see with this two routes
> > > > >
> > > > > <route>
> > > > > <from
> > > > >
> > > >
> > >
> >
> uri="activemq:topic:ActiveMQ.Advisory.Consumer.Queue.TEST.Q?mapJmsMessage=false"
> > > > > />
> > > > >    <convertBodyTo type="java.lang.String"/>
> > > > >    <transform>
> > > > >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}   ${in.body}
> > > > \r\n</simple>
> > > > >    </transform>
> > > > >    <to
> > > > >
> > > >
> > >
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > > > > />
> > > > > </route>
> > > > > <route>
> > > > > <from uri="activemq:topic:ActiveMQ.Advisory.Connection" />
> > > > >    <convertBodyTo type="java.lang.String"/>
> > > > >    <transform>
> > > > >       <simple>\r\n${date:now:yyyyMMdd-hh-mm-ss}  ${in.body}
> > > \r\n</simple>
> > > > >    </transform>
> > > > >    <to
> > > > >
> > > >
> > >
> >
> uri="file://c:/folder/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
> > > > > />
> > > > > </route>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 20150617-08-31-04
> > > > >
> > > > > 20150617-08-31-37
> > > > >
> > > > > 20150617-08-31-37   ActiveMQMessage {commandId = 0,
> responseRequired
> > =
> > > > > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:11,
> > > > > originalDestination = null, originalTransactionId = null,
> producerId
> > =
> > > > > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > > > > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId =
> > null,
> > > > > expiration = 0, timestamp = 0, arrival = 0, brokerInTime =
> > > 1434522697947,
> > > > > brokerOutTime = 1434522697947, correlationId = null, replyTo =
> null,
> > > > > persistent = false, type = Advisory, priority = 0, groupID = null,
> > > > > groupSequence = 0, targetConsumerId = null, compressed = false,
> > userID
> > > =
> > > > > null, content = null, marshalledProperties = null, dataStructure =
> > > > > ConsumerInfo {commandId = 3, responseRequired = false, consumerId =
> > > > > ID:COMPUTER-61030-1434522661496-4:1:-1:1, destination =
> > queue://TEST.Q,
> > > > > prefetchSize = 1000, maximumPendingMessageLimit = 0, browser =
> false,
> > > > > dispatchAsync = true, selector = null, subscriptionName = null,
> > > noLocal =
> > > > > false, exclusive = false, retroactive = false, priority = 0,
> > > brokerPath =
> > > > > null, optimizedAcknowledge = false, noRangeAcks = false,
> > > > > additionalPredicate = null}, redeliveryCounter = 0, size = 1024,
> > > > properties
> > > > > = {consumerCount=1, originBrokerURL=tcp://127.0.0.1:61616,
> > > > > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > > > > originBrokerName=amq-broker}, readOnlyProperties = true,
> > readOnlyBody =
> > > > > true, droppable = false}
> > > > >
> > > > > 20150617-08-33-20   ActiveMQMessage {commandId = 0,
> responseRequired
> > =
> > > > > false, messageId = ID:COMPUTER-61030-1434522661496-1:1:0:0:12,
> > > > > originalDestination = null, originalTransactionId = null,
> producerId
> > =
> > > > > ID:COMPUTER-61030-1434522661496-1:1:0:0, destination =
> > > > > topic://ActiveMQ.Advisory.Consumer.Queue.TEST.Q, transactionId =
> > null,
> > > > > expiration = 0, timestamp = 0, arrival = 0, brokerInTime =
> > > 1434522800355,
> > > > > brokerOutTime = 1434522800355, correlationId = null, replyTo =
> null,
> > > > > persistent = false, type = Advisory, priority = 0, groupID = null,
> > > > > groupSequence = 0, targetConsumerId = null, compressed = false,
> > userID
> > > =
> > > > > null, content = null, marshalledProperties = null, dataStructure =
> > > > > RemoveInfo {commandId = 0, responseRequired = false, objectId =
> > > > > ID:COMPUTER-61030-1434522661496-4:1:-1:1, lastDeliveredSequenceId =
> > 0},
> > > > > redeliveryCounter = 0, size = 1024, properties = {consumerCount=0,
> > > > > originBrokerURL=tcp://127.0.0.1:61616,
> > > > > originBrokerId=ID:COMPUTER-61030-1434522661496-0:1,
> > > > > originBrokerName=amq-broker}, readOnlyProperties = true,
> > readOnlyBody =
> > > > > true, droppable = false}
> > > > >
> > > > > 20150617-08-33-20
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > it seems that connection messages arent "printable"????
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Tue, Jun 16, 2015 at 4:00 PM, Christopher Shannon <
> > > > > [hidden email]> wrote:
> > > > >
> > > > >> No problem, let me know if you have any more questions.
> > > > >>
> > > > >> Chris
> > > > >>
> > > > >> On Tue, Jun 16, 2015 at 9:13 AM, ALi <[hidden email]> wrote:
> > > > >>
> > > > >> > Thank you very nice explanation I will try in this manner
> > > > >> >
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>