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.

Although WebSphere Event Broker provides more flexible controls for an application to achieve both of these behaviors, the concept of streams is supported for compatibility with MQRFH applications.

The security controls of WebSphere Event 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 Event Broker 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 also target stream-related topics, even though they themselves cannot specify a stream name in the messages they send to the WebSphere Event 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 having the same name as the stream. However, WebSphere Event Broker allows publishing clients to send their publications to any input queue in a message flow. MQRFH applications choosing explicitly to specify a stream name parameter within a publication can send it to any publication queue being serviced by the WebSphere Event Broker broker. The name of the queue does not have to be the same as the name of the stream. However, this behavior might affect the order in which publications are received. Consider whether this is important for your applications.

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 that defaults to 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 contains no explicit stream name, SYSTEM.BROKER.DEFAULT.STREAM is assumed.

The options that are available to both MQRFH and MQRFH2 client applications that publish messages are shown in the following table; the table shows the options for both the default stream and an example stream name of StreamX.
  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 prefixes topic with "$SYS/STREAM/StreamX/".

Publisher notes

P1
Publisher publishes on any queue specifying 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 specifying 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
Security for runtime resources: Access control lists
Related tasks
Configuring security for domain components
Publishing
Subscribing
Related reference
MQRFH2 header
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009. All Rights Reserved.
Last updated : 2009-01-07 15:41:07

aq19790_