Register Callback with Websphere MQ - Websphere

This is a discussion on Register Callback with Websphere MQ - Websphere ; Hi, Wish to know is it possible to register a callback using Java with Websphere MQ in order to invoke a process/method whenever there is a new message arrives in a queue. Thanks...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Register Callback with Websphere MQ

  1. Register Callback with Websphere MQ

    Hi,

    Wish to know is it possible to register a callback using Java with Websphere MQ in order to invoke a process/method whenever there is a new message arrives in a queue.


    Thanks

  2. Re: Register Callback with Websphere MQ

    I can think of three "callback" types of mechanisms that you MIGHT be able
    to use with MQ:
    1/ If you're running in a J2EE environment, then you can just use JMS/MQ
    with a Message Driven Bean. Easy.
    2/ Even if not using Java, but if you're z/OS, then you can make use of a
    SIGNAL, using the MQGMO_SET_SIGNAL. This will call an ECB. z/OS is great
    for this.
    3/ Otherwise, if you're using MQ on a HP (Compaq... Tandem) NSK, then the
    MQGMO_SET_SIGNAL is also supported with IPCs

    Today, I don't think that there's any MQ "callback" facility to you. The
    alternative would be to use MQ triggers. This allows you to define a
    program to be started when a message (or a number of messages) arrives in a
    queue. It's "heavier" than a callback as a process will generally be kicked
    off at that time. Check the MQ Application Programming Guide (SC34-6595),
    Chapter 14 for details on triggering.

    --
    Carl



  3. Re: Register Callback with Websphere MQ

    Carl,

    So for MQ version 6 and below we just dont have facility for async consumtion of messages?
    For MQ Java Api and MQ installed on Unix, I am left with only using Triggers?and I guess there lot of
    trade-offs with Triggers.Also MQGMO_SET_SIGNAL is not supported for Java ?

    When I say "async consumtion of messages" , I want this in Non JMS/pub -sub env.
    I just want to register an event,so that I get a message.

    The other way I think of is polling the queue,implementing Producer Consumer design pattern.
    but this approach too comes with a cost.

    can anyone suggest some solution?

    thanks.

  4. Re: Register Callback with Websphere MQ

    A major new feature in MQ v7.0 is "call back" for normal MQI applications (in C, COBOL etc etc). This provides an equivalent to the supported Java / JMS features for "asychronous consumption" of MQ messages.

  5. Re: Register Callback with Websphere MQ

    dhingra.rohit@gmail.com wrote:
    > Carl,
    >
    > So for MQ version 6 and below we just dont have facility for async consumtion of messages?
    > For MQ Java Api and MQ installed on Unix, I am left with only using Triggers?and I guess there lot of
    > trade-offs with Triggers.Also MQGMO_SET_SIGNAL is not supported for Java ?
    >
    > When I say "async consumtion of messages" , I want this in Non JMS/pub -sub env.
    > I just want to register an event,so that I get a message.
    >
    > The other way I think of is polling the queue,implementing Producer Consumer design pattern.
    > but this approach too comes with a cost.
    >
    > can anyone suggest some solution?


    Start another thread on which you do MQGET with wait, using
    MQWI_UNLIMITED as the timeout and MQGMO_FAIL_IF_QUIESCING. The MQGET
    will return with a message as soon as there is a message.

    Phil

+ Reply to Thread