8 Replies Latest reply on Aug 17, 2007 9:30 AM by timfox

    Count Messages with Selector and Edit Message

    hendra_netm

      Hi guys,

      At this moment, I may need some features like count messages with selector and Edit message in the queue.

      Count Message With Selector will return the number of message in the destination that match with the selector. In short, it is like "List All Message" with selector, but the method will only return a integer value.

      The feature can be obtained by using "List All Message" and count the number later in the client. But imagined if the number of the messages is more than one thousand and each message has big content. I think this will give problem for the network.


      The second feature that I need to add in JBM is Message Editor. So for example an Operator want to change the all property value from all messages in a queue that has value X.

      This behaviour is useful when the message's property is used for routing. Sometime, the operator wants to change the property value due to changing in the routing rule.

      Currently it is not possible to do that. You need to take all messages with value X, change the property value from X to Y, and return the message to the queue.


      ==
      What do you think about these features?
      If you agree, I would like to put those features as additional features for JBM. That's way, I don't need to change again, whenever JBoss come with new release.

      And if the feature is officially supported by the team, I am sure it is much better than if I do it alone ;)

        • 1. Re: Count Messages with Selector and Edit Message
          timfox

           

          "hendra_netm" wrote:
          Hi guys,

          At this moment, I may need some features like count messages with selector and Edit message in the queue.

          Count Message With Selector will return the number of message in the destination that match with the selector. In short, it is like "List All Message" with selector, but the method will only return a integer value.


          There is already a version of listAllMessages that takes a selector. See user guide 6.6.2.2.2. ListAllMessages



          The second feature that I need to add in JBM is Message Editor. So for example an Operator want to change the all property value from all messages in a queue that has value X.

          This behaviour is useful when the message's property is used for routing. Sometime, the operator wants to change the property value due to changing in the routing rule.

          Currently it is not possible to do that. You need to take all messages with value X, change the property value from X to Y, and return the message to the queue.


          ==
          What do you think about these features?
          If you agree, I would like to put those features as additional features for JBM. That's way, I don't need to change again, whenever JBoss come with new release.

          And if the feature is officially supported by the team, I am sure it is much better than if I do it alone ;)


          Feel free to add a feature request for the other feature.

          • 2. Re: Count Messages with Selector and Edit Message
            hendra_netm

            hi Tim,

            Thank you for your reply.

            As far as I know, List All Messages will return list of messages. I think this will cause problem if we have many messages and each has big size.

            What I think is, may be we also need another method to count message with selector. So you only get the integer, and not the content of the message.

            Best Regards,
            Hendra

            • 4. Re: Count Messages with Selector and Edit Message
              hendra_netm

              Hi guys,

              I have download JBM from trunk in SVN server, and modified the following files:

              org.jboss.jms.server.destination.QueueMBean.java
              org.jboss.jms.server.destination.QueueService.java
              org.jboss.jms.server.destination.ManagedQueue.java

              org.jboss.messaging.core.contract.PersistenceManager.java
              org.jboss.messaging.core.impl.JDBCPersistenceManager.java

              org.jboss.messaging.core.contract.Channel
              org.jboss.messaging.core.impl.ChannelSupport


              From the wiki developer site, I read that I need to create test cases.
              I think I will just modified this file: org.jboss.test.messaging.jms.QueueTest.java

              Is that ok, or should I created new test file?



              After that what should I do? Upload it to the SVN server or there is another step that need to be done?

              Thank you in advance for your help.

              Best Regards,
              Hendra

              • 5. Re: Count Messages with Selector and Edit Message
                timfox

                Hi Hendra-

                When you're done, just send me a patch direct.

                You'll also need to sign a contributor agreement if you haven't done so already:

                http://labs.jboss.com/community/contributeCode.html

                It's probably too late to get it in 1.4.0.CR2, but we may be able to get it in 1.4.0.GA

                Thanks
                :)

                • 6. Re: Count Messages with Selector and Edit Message
                  hendra_netm

                  Hi Tim,

                  Thank you for your answer.

                  I just signed the contributor agreement.

                  By sending the patch direct, do you mean by using email or how?

                  Do I send 7 files mentioned above + Queue-xmbean.xml + QueueTest.java, so you need to put the files into appropriate directory, or do I send a whole directory structure?

                  Best Regards,
                  Hendra

                  • 7. Re: Count Messages with Selector and Edit Message
                    timfox

                    A patch is just the output from diff showing your changes

                    Just do a svn diff against the current version of TRUNK (make sure your changes work against TRUNK first) and pipe it to a text file.

                    The text file is the patch

                    • 8. Re: Count Messages with Selector and Edit Message
                      timfox

                      You can email it direct to me