WebSphere Message Brokers
File: aq19790_
Writer: Terry Cowling

Reference topic

This build: July 31, 2007 21:35:46

Streams

WebSphere MQ Publish/Subscribe uses streams primarily as a way of partitioning the topic name space. Sets of related topics can be grouped together into separate streams. Different security controls can be applied to different streams, and the publishing workload of the broker can be better balanced.

However, WebSphere Message Broker provides more flexible controls to achieve both of these behaviors. Therefore, the concept of a stream is supported only for MQRFH application compatibility.

The security controls of WebSphere Message Broker allow authorization to be applied to an individual topic level. Also, the publishing workload of the broker can be more easily controlled by creating additional instances of publication message flows that can serve either the same or different input queues.

WebSphere Message Broker still allows MQRFH client applications to specify an MQPSStreamName command parameter in their subscriptions and publications. However, the stream name is used only to modify the topic to preserve the partitioning characteristic of WebSphere MQ Publish/Subscribe.

When the stream name that is associated with a message is set to something other than SYSTEM.BROKER.DEFAULT.STREAM, the message is processed as if the topic, or topics, that are mentioned within the message are prefixed with the string "$SYS/STREAM/<streamname>/". That is, a subscription to Topic1 that specifies a stream name of StreamX is processed as if the subscription is to topic "$SYS/STREAM/StreamX/Topic1".

MQRFH2 publishing and subscribing applications can still target stream-related topics, even though they themselves are not allowed to specify a stream name in the messages that they send to the WebSphere Message Broker broker. To do this, they must prefix the topics with the appropriate stream prefix.

For example, to subscribe to topic "IBM/Latest" that is published on stream STOCK.STREAM within the WebSphere MQ Publish/Subscribe network, an MQRFH2 subscriber must specify the topic "$SYS/STREAM/STOCK.STREAM/IBM/Latest".

WebSphere MQ Publish/Subscribe allows a stream-related publication to be sent only to a queue that has the same name as the stream. However, WebSphere Message Broker allows publishing clients to send their publications to any input queue in a message flow.

MQRFH applications that explicitly specify a stream name parameter within a publication can send it to any publication queue that is serviced by the WebSphere Message Broker broker. The queue does not need to have the same name as the stream.

Be aware that the order in which publications are received might be different from what you might expect.

Each Publication node has an Implicit Stream Naming property whose default value is true. This default option results in behavior that is identical to that in WebSphere MQ Publish/Subscribe when an MQRFH publication does not contain an explicit stream name. If this property is false, and the publication does not contain an explicit stream name, SYSTEM.BROKER.DEFAULT.STREAM is assumed.

The next table summarizes the options that are available to both MQRFH and MQRFH2 client applications that publish messages, either to the default stream or to a specific WebSphere MQ Publish/Subscribe stream. The stream name StreamX is used to illustrate the options.

  MQRFH publisher   MQRFH2 publisher  
  default stream StreamX default stream StreamX
MQRFH subscriber S1,P1 S2,P2 S1,P3 S2,P4
MQRFH2 subscriber S3,P1 S4,P2 S3,P3 S4,P4
         
         
         
Subscriber notes:
  • S1 Subscriber subscribes either without a stream name or with stream name "SYSTEM.BROKER.DEFAULT.STREAM".
  • S2 Subscriber subscribes with stream name "StreamX".
  • S3 Subscriber subscribes on topic without adding "$SYS/STREAM/<streamname>/".
  • S4 Subscriber subscribes on topic prefixed with "$SYS/STREAM/StreamX/".
Publisher notes:
  • P1 Publisher publishes on any queue that specifies the stream name "SYSTEM.BROKER.DEFAULT.STREAM". or publishes without specifying a stream name on any queue with the Implicit Stream Naming property set to false.
  • P2 Publisher publishes on any queue that specifies the stream name "StreamX", or publishes without specifying a stream name on queue "StreamX" with the Implicit Stream Naming property set to true.
  • P3 Publisher publishes on any queue without adding the prefix "$SYS/STREAM/<Stream>/" to the topic.
  • P4 Publisher publishes on any queue and adds the prefix "$SYS/STREAM/StreamX/" to the topic.
Note: The "$SYS/STREAM/<streamname>/" prefix is removed from all topics in an MQRFH2 publication when it is delivered to an MQRFH subscriber.
Related concepts
Authorization to access runtime resources
Related tasks
Publishing
Subscribing
Related reference
MQRFH2 header
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:35:46

aq19790_ This topic's URL is: