8 Replies Latest reply on Nov 8, 2005 8:13 PM by ovidiu.feodorov

    Returning message counter data/history in JBossMQ

    ccrouch

      So the listMessageCounterHistory() and listMessageCounter() methods on Topic and Queue related mbeans return formatted html.
      This is great for the jmx-console but not so useful for other clients, such as the admin-console, which need the ability to format the raw data as they see fit.

      I was going to raise a JIRA issue to add listRawMessageCounterHistory() and listRawMessageCounter() when I found this...

      http://jira.jboss.com/jira/browse/JBAS-1908 (listMessageCounter issue with JMS subscriptions containing certain message selector characters)

      From the comments on this issue it looks like MessageCounter is being phased out and replaced with org.jboss.mq.MessageStatistics. Should I raise issues to add the listRaw...() methods or raise an issue to have MessageStatistics add support for a history, since from the current MessageStatistics impl. you can't get historical type information?

      Thanks very much

        • 1. Re: Returning message counter data/history in JBossMQ

          I'm going to disable the MessageCounter stuff in 4.0.4
          if the original author doesn't maintain it.

          The correct fix is to implement the history by extending the MessageStatistics.
          (AKA a proper job).

          I assume you are not volunteering to maintain this?

          • 2. Re: Returning message counter data/history in JBossMQ
            ccrouch

            You assume correctly.
            I will organize for the Admin Console to use the MessageStatistics attribute in place of listMessageCounter() and get a JIRA issue raised to extend MessageStatistics as described.

            Thanks

            • 3. Re: Returning message counter data/history in JBossMQ
              peterj

              Let me see if I understand correctly. It appears that MessageStatistics is a serializable snapshot of the current state of the data found in MessageCounter. I base this statement on the fact that I could find only one location where a MessageStatistics instance is created, and that is in MessageCounter.getMessageStatistics(). (I looked in both jboss-head and jboss-4.0.x in CVS.)

              What confuses me is the statement

              I'm going to disable the MessageCounter stuff in 4.0.4
              I'm note sure how MessageCounter could be disabled if it actually maintains the statistics. Adrian, could you perhaps clarify your inent?

              The reason I am asking, is that I was going to attempt to add the message counter history functionality to MessageStatistics. At this time what I envision is adding another property to MessageStatistics and populating that property in the MessageCounter.getMessageStatistics() method.

              Your thoughts on this are appreciated.

              • 4. Re: Returning message counter data/history in JBossMQ

                You are referring to this?
                http://jira.jboss.com/jira/browse/JBAS-1908

                The MessageCounter was added by a contributor in the 3.2.x days.
                It's had a number of problem that I have had to fix.

                If the original contributor doesn't maintain their "optional feature" it gets removed
                or disabled by default when it causes problems and I loose patience.

                This is called orphaned code.

                The two biggest problems with the MessageCounter are:
                1) It can be a performance bottleneck
                2) The api to access the statistics is broken
                2a) It is not serializable
                2b) Most of useful data is accessed by some custom (and currently broken) html processing.
                2c) All statistics should be exposed via the JSR77 model as javabeans

                MessageStatistics is the start of an attempt by me to solve these problems,
                but it is not high on priority list to complete.


                I'm note sure how MessageCounter could be disabled if it actually maintains the statistics.


                Simply by setting the default config to not collect the stats with a warning
                that says "enable at your own risk".

                • 5. Re: Returning message counter data/history in JBossMQ

                  And a few tests of this feature would greatly improve my motivation to maintain it! :-)

                  • 6. Re: Returning message counter data/history in JBossMQ
                    peterj

                    Yes, JIRA issue JBAS-1908 is one of the issues I am referencing, but also

                    http://jira.jboss.com/jira/browse/JBADMCON-119
                    .

                    I wholly agree with your your statement that MessageCounter is a performance bottleneck. Just looking at the code used to maintain the counter history (e.g., UpdateHistory()) had me shaking my head. (On another project I had code that did date manipulation in a multi-threaded environment and when I ran the code I noticed that the processors were using up a lot if system time as opposed to user time. I changed the code to use non-date data and noticed a huge performance improvement.) I was even planning on evaluating the performance overhead of gathering the message counter history. We already have a question on the admin console forum to see if anyone really wants this data (see http://www.jboss.org/index.html?module=bb&op=viewtopic&t=71908). If no-one wants it, why bother gathering it? But then, providing an option whereby statistics gathering can be turned on and off makes sense. Something like this should be settable from the admin console.

                    My question on turning off the message counters was not really about the machanics of doing it, but rather a question of how MessageStatistics would go about providing the statistics if MessageCounter was removed. I assume that quite a bit of implementation would be involved to get MessageStatistics to replace MessageCounter. And I can see where such a thing would be low on the priority list.


                    • 7. Re: Returning message counter data/history in JBossMQ
                      genman

                      If I may butt in.

                      I've been interested in adding rate statistics, i.e. "messages per second". Currently, I maintain a rate counter internally in my MDB.

                      See this discussion.

                      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=70306

                      • 8. Re: Returning message counter data/history in JBossMQ
                        ovidiu.feodorov