1 Reply Latest reply on Jun 27, 2008 5:59 PM by vishalrao

    Signaling to Partial Queue to Stop Accepting New Messages

      Hi,

      I am using a 3 node cluster of JBoss Messaging (1.4.0.SP3)
      that I am running within JBoss AS 4.2.2.

      Suppose my cluster has clustered queues called Q1,
      Q2, Q3, and Q4 - each of whose set of messages is
      split across the cluster nodes as partial queues.

      How can I signal to the partial queues on Node 3
      that I want some subset of {Q1, Q2, Q3, Q4} to
      stop receiving new messages from message
      producers but allow message consumers to take
      messages off the partial queue?

      I still want message producers to be able to put
      messages on the partial queues of other nodes.

      Please let me know if and how this is possible.

      Thanks so much!
      Vishal

        • 1. Re: Signaling to Partial Queue to Stop Accepting New Message

          Hey everyone,

          Still no responses. Please let me know if you need me
          to clarify the question.

          Also, any pointers to research materials or directions
          would be greatly appreciated.

          On this front, I've been running some experiments to see
          if I can use the MaxSize parameter to see if I can block
          further messages from getting to the queue.

          Here are my findings which I think are pretty interesting:


          Experiment #1: Try to set MaxSize to 0 after some message content

          1. Initial State
          ------------"Queue4" Partial Queue on Node3 is empty and online
          ------------Node 1 and Node 2 are offline
          2. Use producer to send 200 messages to "Queue4"
          3. verify messages get there using HermesJMS
          4. verify messagecount in "Queue4" Mbean page
          5. Use Mbean page to set MaxSize to 0 from current value of -1
          6. Warning: JBoss Console message says you can't do it, but Mbean page reflects new value of 0
          7. Use HermesJMS to verify 200 messages are still there (page through contents)
          8. Use Mbean page to verify 200 messages still there
          9. Try to send 200 more messages to queue using producer
          10. Hermes and Mbean Page both reflect 400 messages!

          Conclusion: MaxSize of 0 does not prevent new messages from being added




          BETWEEN EXPERIMENT #1 and #2

          Mbean.removeAllMessages()




          Experiment #2: Try to set MaxSize to 0 before any messages

          1. Initial State
          ------------a. "Queue4" Partial Queue on Node3 is empty and online
          ------------b. Node 1 and Node 2 are offline
          2. MaxSize is 0 (previous state from last experiment)
          3. Use producer to send 200 messages to "Queue4"
          4. verify all 200 messages get there using HermesJMS
          5. verify messagecount in Mbean page ==> 200

          Conclusion: MaxSize of 0 does not prevent new messages from being added



          BETWEEN EXPERIMENT #2 and #3

          Mbean.removeAllMessages()


          Experiment #3: Try to set MaxSize to 1 before some messages

          1. Initial State
          -------------a. "Queue4" Partial Queue on Node3 is empty and online
          -------------b. Node 1 and Node 2 are offline
          2. Use Mbean page to set MaxSize to 1 from current value of 0
          3. Use producer to send 200 messages
          a. Stack trace after 1st message
          4. Hermes and Mbean Page for "Queue4" both reflect 1 message


          Conclusion: MaxSize of 1 correctly limits messages to 1



          BETWEEN EXPERIMENT #3 and #4
          Mbean.removeAllMessages()
          MaxSize back to -1




          Experiment #4: Try to set MaxSize to 1 after some messages are already in the queue

          1. Initial State
          -------------a. "Queue4" Partial Queue on Node3 is empty and online
          -------------b. Node 1 and Node 2 are offline
          2. Use producer to send 200 messages to "Queue4"
          3. verify messages get there using HermesJMS
          4. verify messagecount in Mbean page

          5. Use Mbean page to set MaxSize to 1 from current value of -1
          6. Use HermesJMS to verify 200 messages are still there (page through contents)
          7. Use Mbean page to verify 200 messages still there
          8. Try to send 200 more messages to queue using producer
          9. Hermes and Mbean Page both reflect 400 messages!

          Conclusion: MaxSize of 1 fails to limit message count to 1 when the message count is already exceeded.