Home

 

Writing a publish/subscribe routing exit program

The WebSphere MQ Publish/Subscribe routing exit is a stream related exit; the parameters (for example, ExitUserArea) passed to the exit have the scope of a stream.

The broker uses two threads for each stream and the exit can be invoked under either thread. The broker does not call the exit for a single stream under two threads concurrently (that is, the exit does not need to serialize access to the ExitUserArea or other stream related data).

If the exit uses thread related resources (for example, a connection handle or queue handle) the exit must manage these resources on a thread basis. The connection handle obtained by a thread is not usable by any other thread. The exit can use operating system thread services such as pthread_set_specific and pthread_get_specific on Unix, or TlsSetValue and TlsGetValue on Windows to manage thread related resources.

The routing exit is called before a broker sends a publication to a subscriber or another broker. It is also called at initialization and termination of a stream.



 

Home