Enable a provider to stream messages to cloned durable subscriptions
Use this task to enable a provider to stream messages to consumers ahead of their message requests. This is most often used by publish/subscribe consumers to provide a performance enhancement.
To indicate that a provider must stream messages to consumers, we can set the Read ahead property to Enabled. This property can be set on a connection factory to specify the behavior for all connections created using that connection factory. The property can also be set on JMS topics, to enable different behavior when sending messages to different JMS topics from the same connection.
We are recommended to leave this property set to Default, which enables the messaging provider to decide whether it should stream messages to consumers. The messaging provider makes this decision based on the environment in which the durable subscriber is running. We should only set this property to enable message streaming if we are sure that a durable subscription is used by only one consumer at a time.
- In a non-cloned environment, the default setting enables messaging streaming for durable subscribers.
- For cloned durable subscribers (that is, a durable subscriber that is part of an application cloned in a server cluster), the default setting prevents message streaming and the messages on the subscription are shared among the clones. If we are moving from a non-cloned environment, to cloned durable subscribers, we might see a drop in performance. If we are sure that a durable subscription is still used by only one consumer at a time, we can enable message streaming as described in this topic.
Messages that are streamed to the consumer but are not consumed before the consumer disconnects are unlocked when the consumer closes. Only then do those messages become available for consumption by other consumers.
To force the messaging provider to stream messages to cloned durable subscriptions, use the administrative console to complete the following steps to change the connection factory:
Tasks
- Display the JMS connection factory; for example, as described in Configure a unified connection factory for the default messaging provider. All clones of a durable subscriber use the same JMS connection factory.
- Set the Read ahead property to Enabled.
- Click OK.
- Save changes to the master configuration.