Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1908

listMessageCounter issue with JMS subscriptions containing certain message selector characters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Minor
    • No Release
    • JBossAS-4.0.2 Final
    • JMS (JBossMQ)
    • None

    Description

      When the message selector query for a subscription to a JMS topic looks someting like "field in ('A', 'B', 'C')", two failures occur on JMS MBeans:
      1. The listMessageCounter operation on jboss.mq:service=DestinationManager fails with a NumberFormatException:

      Caused by: java.lang.NumberFormatException: For input string: " 'ghi'"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:468)
      at java.lang.Integer.parseInt(Integer.java:518)
      at org.jboss.mq.server.jmx.DestinationManager.listMessageCounter(DestinationManager.java:477)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      ... 44 more

      This is because the getCounterAsString() method is used on the MessageCounter to get the details and then traversed with
      a StringTokenizer tokenizing on commas, but the subscription name also contains commas in this case.

      2. The listMessageCounter operation on jboss.mq.destination:name=[topicName],service=Topic works, but the resulting HTML
      table has some of the selector values populating the counter columns. The problem is because of the same issue as above.

      This can be reproduced by following these steps:
      1. Startup a JBoss4.0.2 with default configuration.
      2. Deploy the attached 'test-topic-service.xml'. This will create a JMS topic called 'counterTestTopic'.
      3. Run the attached client (source included in jar). The only jar needed on classpath is the 'jbossall-client.jar':
      java -cp "[path]\jbossall-client.jar;.\listCounter.jar" za.co.jdj.jbossmq.testcounter.TestListCounter
      This will do the following:
      3.1. Connect to the JMS server running locally.
      3.2. Create a publisher and durable subscriber on the 'counterTestTopic' already deployed.
      The subscriber has a message selector in the format already described
      3.3. Invoke the listMessageCounter operation on jboss.mq:service=DestinationManager, printing the error.
      3.4. Wait for the client to look at the html table created by the topic in a browser.
      3.5. Remove the subscription and exit.

      Suggested fixes for the problem includes:
      1. Add a getDestinationTypeDescription() method to org.jboss.mq.server.MessageCounter. (See MessageCounter.txt attached)
      2. Change the listMessageCounter method on org.jboss.mq.server.jmx.DestinationManager to not use the getCounterAsString() method
      on org.jboss.mq.server.MessageCounter, but rather extract the values itself for the html table.
      (See the DestinationManager.txt file attached).
      3. Change the listMessageCounter method on org.jboss.mq.server.jmx.DestinationMBeanSupport to do the same as above.
      (See the DestinationMBeanSupport.txt file attached).

      Attachments

        1. DestinationManager.txt
          5 kB
        2. DestinationMBeanSupport.txt
          2 kB
        3. listCounter.jar
          5 kB
        4. MessageCounter.txt
          0.2 kB
        5. test-topic-service.xml
          0.4 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jaco.joubert Jaco Joubert (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: