Any issue with browse option.. - Websphere

This is a discussion on Any issue with browse option.. - Websphere ; I'm trying to create an application in SunOS using C programing to browse a queue. The issue was, I have 4(multiple) processes, each will browse the same queue, but a message needs to be visible to a single process. currently ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Any issue with browse option..

  1. Any issue with browse option..

    I'm trying to create an application in SunOS using C programing to browse a queue.

    The issue was,
    I have 4(multiple) processes, each will browse the same queue, but a message needs to be visible to a single process.

    currently if i invoke 4 processes, all 4 read the same messages again and again.

    I'm using the below option..

    O_options = MQOO_BROWSE /* open queue for browse, */
    + MQOO_FAIL_IF_QUIESCING; /* but not if MQM stopping */

    gmo.Version = MQGMO_VERSION_2; /* Avoid need to reset Message */
    gmo.MatchOptions = MQMO_NONE; /* ID and Correlation ID after */
    /* every MQGET */
    gmo.WaitInterval = 10000;
    if(nFirst==0)
    {
    printf("FIRST\n");
    gmo.Options = MQGMO_WAIT + MQGMO_BROWSE_FIRST + MQGMO_ACCEPT_TRUNCATED_MSG
    + MQGMO_LOCK;
    nFirst=1;
    }
    else
    {
    printf("NEXT...\n");
    gmo.Options = MQGMO_WAIT + MQGMO_BROWSE_NEXT + MQGMO_ACCEPT_TRUNCATED_MSG
    + MQGMO_LOCK;
    }

    Whats wrong in this...

  2. Re: Any issue with browse option..

    The lock on a MQGET browsed message is released as soon as that thread issues another MQGET, hence that message becomes available to be MQGET browsed by another thread.

    If that does not suit your design, look at the cooperative browsing feature of MQ v7.0. Its all in the WMQ App Programming Ref V7.0 and WMQ App Programming Guide V7.0.

    HTH, Glenn.

+ Reply to Thread