Getting Current Queue Depth using JMS ConnectionFactory - Websphere

This is a discussion on Getting Current Queue Depth using JMS ConnectionFactory - Websphere ; Hi, I am using Connection Factory to connect to the Queue and placing messages in Queue. I want to know how many messages are there in the Queue using this Connection Factory. How can i do this please let me ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Getting Current Queue Depth using JMS ConnectionFactory

  1. Getting Current Queue Depth using JMS ConnectionFactory

    Hi,

    I am using Connection Factory to connect to the Queue and placing messages in Queue. I want to know how many messages are there in the Queue using

    this Connection Factory. How can i do this please let me know.

  2. Re: Getting Current Queue Depth using JMS ConnectionFactory

    Hi Ravi ,

    int a = 0; //Take a count variable
    while (QuueeReceiver.receiveNoWait() != null)
    {
    a++
    }

  3. Re: Getting Current Queue Depth using JMS ConnectionFactory

    { a++ }

    Does that browse all messages on the queue to count them, or does it destructively remove them?

  4. Re: Getting Current Queue Depth using JMS ConnectionFactory

    ... I want to know how many messages are there in the Queue ...

    This question pops up quite often and it rings alarm bells.

    Why do you want to know the depth of the queue? I will comment appropriately on your response.

    Glenn.

  5. Re: Getting Current Queue Depth using JMS ConnectionFactory

    If i know the depth of the Queue, I know how many messages are there and i will decide whether to place messages or not.

  6. Re: Getting Current Queue Depth using JMS ConnectionFactory

    Does that browse all messages on the queue to count them, or does it destructively remove them?


    What do you think so ??

  7. Re: Getting Current Queue Depth using JMS ConnectionFactory

    Why not just keep placing (putting) messages on the queue? After all, MQ is a message "queueing" product ! You shouldn't need to care about the depth. MQ will queue as many messages as you like, assuming another app will run at some time to get them all off the queue.

    Glenn.

+ Reply to Thread