Message polling

Note: This section does not apply to the C code base.

Message polling uses the mqeQueueManager_waitForMessage() method. This command issues a mqeQueueManager_getMessage() command to the remote queue at regular intervals. As soon as a message that matches the supplied filter becomes available, it is returned to the calling application.

A wait for message call typically looks like this:
  qmgr.waitForMessage( "RemoteQMgr", "RemoteQueue", 
                  filter, null, 0, 60000 );

The mqeQueueManager_waitForMessage() method polls the remote queue for the length of time specified in its final parameter. The time is specified in milliseconds, so in the example above, the polling lasts for 60 seconds. The thread on which the command is executing is blocked for this length of time, unless a message is returned earlier.

Message polling works on both local and remote queues.

Note: Use of this technique results in multiple requests being sent over the network.

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.