You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by nader <na...@salas.dk> on 2014/01/31 00:30:35 UTC

message time-stamp missing (send from statisticsBrokerPlugin)

Hi

Messages send from statisticsBrokerPlugin to a destination do not have a
timestamp. (0 or 1970-01-01T01:00:00+01:00).

How can I force ActiveMQ to timestamp statistics messages send from
statisticsBrokerPlugin?

I am using python with stomp on ActiveMQ 5.9.0.

Thanks in advance.

Nader



--
View this message in context: http://activemq.2283324.n4.nabble.com/message-time-stamp-missing-send-from-statisticsBrokerPlugin-tp4677124.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: message time-stamp missing (send from statisticsBrokerPlugin)

Posted by nader <na...@salas.dk>.
Oh.. Thank you very much!

Regards
Nader



--
View this message in context: http://activemq.2283324.n4.nabble.com/message-time-stamp-missing-send-from-statisticsBrokerPlugin-tp4677124p4677263.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: message time-stamp missing (send from statisticsBrokerPlugin)

Posted by Timothy Bish <ta...@gmail.com>.
On 01/31/2014 04:36 AM, nader wrote:
> Hi
>
> Here is the simplified code I use
>
> # With assumption of below settings in activemq.xml
> #    <broker ....>
> #        ....
> #        <plugins>
> #             <statisticsBrokerPlugin/>
> #        </plugins>
> #        ....
> #    </broker>
>
> from stompest.config import StompConfig
> from stompest.protocol import StompSpec
> from stompest.sync import Stomp
> import time
>
> STOMP_URI='tcp://192.168.0.52:61620'
>
> CONFIG = StompConfig(STOMP_URI)
>
> QUEUE = '/queue/testMon'
> StatQ = '/queue/ActiveMQ.Statistics.Destination.testMon'
>
> if __name__ == '__main__':
>      clientMon = Stomp(CONFIG)
>      clientMon.connect()
>      
>      #subscription is really not necessary, just for output format
>      clientMon.subscribe(QUEUE,
> {'transformation':'jms-map-xml',StompSpec.ACK_HEADER:
> StompSpec.ACK_CLIENT_INDIVIDUAL})
>
>      print 'Sending a message ...'
>      clientMon.send(QUEUE, body='Some data', headers={'persistent':'true'})
>      time.sleep(5)
>      print "Sending stat message ..."
>      clientMon.send(StatQ, headers={'reply-to':QUEUE})
>      frame = clientMon.receiveFrame()
>      clientMon.ack(frame)
>      print frame
>      clientMon.disconnect()
>
> and the result is:
>
> Sending a message ...
> Sending stat message ...
> MESSAGE
> message-id:ID:XXXXXXXXX-1635-1391159088566-2:1:0:0:1
> type:Advisory
> transformation:jms-map-xml
> destination:/queue/testMon
> timestamp:0
> expires:0
> priority:0
>
> <map>
>    <entry>
>      <string>memoryUsage</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>dequeueCount</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>inflightCount</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>messagesCached</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>averageEnqueueTime</string>
>      <double>0.0</double>
>    </entry>
>    <entry>
>      <string>destinationName</string>
>      <string>queue://testMon</string>
>    </entry>
>    <entry>
>      <string>averageMessageSize</string>
>      <double>0.0</double>
>    </entry>
>    <entry>
>      <string>memoryPercentUsage</string>
>      <int>0</int>
>    </entry>
>    <entry>
>      <string>size</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>producerCount</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>consumerCount</string>
>      <long>1</long>
>    </entry>
>    <entry>
>      <string>minEnqueueTime</string>
>      <double>0.0</double>
>    </entry>
>    <entry>
>      <string>expiredCount</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>dispatchCount</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>maxEnqueueTime</string>
>      <double>0.0</double>
>    </entry>
>    <entry>
>      <string>enqueueCount</string>
>      <long>0</long>
>    </entry>
>    <entry>
>      <string>memoryLimit</string>
>      <long>726571418</long>
>    </entry>
> </map>
>
>
> As you can see, the message property 'timestamp at the top is '0'.
>
> If I use administration console, the value of "1970-01-01T01:00:00+01:00"
> (Unix time 0).
>
> Secondly, the priority is '0' which I cannot change.
>
> Tried many permutation of above code with no avail.
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/message-time-stamp-missing-send-from-statisticsBrokerPlugin-tp4677124p4677152.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Fixed it for you:
https://issues.apache.org/jira/browse/AMQ-5011

You'll need to wait for a 5.10 snapshot to build with the fix in it.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: message time-stamp missing (send from statisticsBrokerPlugin)

Posted by nader <na...@salas.dk>.
Hi

Here is the simplified code I use

# With assumption of below settings in activemq.xml
#    <broker ....>
#        .... 
#        <plugins>
#             <statisticsBrokerPlugin/>
#        </plugins>
#        ....
#    </broker>

from stompest.config import StompConfig
from stompest.protocol import StompSpec
from stompest.sync import Stomp
import time

STOMP_URI='tcp://192.168.0.52:61620'

CONFIG = StompConfig(STOMP_URI)

QUEUE = '/queue/testMon'
StatQ = '/queue/ActiveMQ.Statistics.Destination.testMon'

if __name__ == '__main__':
    clientMon = Stomp(CONFIG)
    clientMon.connect()
    
    #subscription is really not necessary, just for output format
    clientMon.subscribe(QUEUE,
{'transformation':'jms-map-xml',StompSpec.ACK_HEADER:
StompSpec.ACK_CLIENT_INDIVIDUAL})

    print 'Sending a message ...'
    clientMon.send(QUEUE, body='Some data', headers={'persistent':'true'})
    time.sleep(5)
    print "Sending stat message ..."
    clientMon.send(StatQ, headers={'reply-to':QUEUE})
    frame = clientMon.receiveFrame()
    clientMon.ack(frame)
    print frame
    clientMon.disconnect()

and the result is:

Sending a message ...
Sending stat message ...
MESSAGE
message-id:ID:XXXXXXXXX-1635-1391159088566-2:1:0:0:1
type:Advisory
transformation:jms-map-xml
destination:/queue/testMon
timestamp:0
expires:0
priority:0

<map>
  <entry>
    <string>memoryUsage</string>
    <long>0</long>
  </entry>
  <entry>
    <string>dequeueCount</string>
    <long>0</long>
  </entry>
  <entry>
    <string>inflightCount</string>
    <long>0</long>
  </entry>
  <entry>
    <string>messagesCached</string>
    <long>0</long>
  </entry>
  <entry>
    <string>averageEnqueueTime</string>
    <double>0.0</double>
  </entry>
  <entry>
    <string>destinationName</string>
    <string>queue://testMon</string>
  </entry>
  <entry>
    <string>averageMessageSize</string>
    <double>0.0</double>
  </entry>
  <entry>
    <string>memoryPercentUsage</string>
    <int>0</int>
  </entry>
  <entry>
    <string>size</string>
    <long>0</long>
  </entry>
  <entry>
    <string>producerCount</string>
    <long>0</long>
  </entry>
  <entry>
    <string>consumerCount</string>
    <long>1</long>
  </entry>
  <entry>
    <string>minEnqueueTime</string>
    <double>0.0</double>
  </entry>
  <entry>
    <string>expiredCount</string>
    <long>0</long>
  </entry>
  <entry>
    <string>dispatchCount</string>
    <long>0</long>
  </entry>
  <entry>
    <string>maxEnqueueTime</string>
    <double>0.0</double>
  </entry>
  <entry>
    <string>enqueueCount</string>
    <long>0</long>
  </entry>
  <entry>
    <string>memoryLimit</string>
    <long>726571418</long>
  </entry>
</map>


As you can see, the message property 'timestamp at the top is '0'.

If I use administration console, the value of "1970-01-01T01:00:00+01:00"
(Unix time 0).

Secondly, the priority is '0' which I cannot change.

Tried many permutation of above code with no avail.





--
View this message in context: http://activemq.2283324.n4.nabble.com/message-time-stamp-missing-send-from-statisticsBrokerPlugin-tp4677124p4677152.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: message time-stamp missing (send from statisticsBrokerPlugin)

Posted by artnaseef <ar...@artnaseef.com>.
Where is the timestamp 0 coming from?  If you could share code, that would
help.



--
View this message in context: http://activemq.2283324.n4.nabble.com/message-time-stamp-missing-send-from-statisticsBrokerPlugin-tp4677124p4677127.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.