The Web messaging service uses the Bayeux protocol for publish subscribe communication. Only the Bayeux long-polling transport option is supported. Several aspects of the Bayeux communication are configured in a Web messaging configuration file. These configuration options are listed below.
In the Bayeux protocol, a server does not complete the HTTP request until messages are available. The longPollTimeout configuration option specifies how long the server keeps the request open before completing the request. When the request is completed, a Bayeux client is immediately re-connected to the server unless the clientPollInterval is set. Care should be taken when setting these values. You must set the clientPollInterval value to a reasonable value if the longPollTimeout value is set to 0 to avoid flooding the server with repeated Bayeux connect requests.
Name: | longPollTimeout |
---|---|
Required or Optional: | Optional |
Data Type: | Integer |
Allowed Values: | Value specified in seconds between 0 and 300 |
Default Value: | 30 seconds |
Description: | Indicates how long the server keeps the HTTP request open to wait for messages. Long-polling, by definition, requires requests to be completed in a reasonable amount of time. The clients typically reconnect immediately upon request closure. |
The clientPollInterval specifies how long the client waits between Bayeux connect requests. If the clientPollInterval is set, the Bayeux advice mechanism is used to direct clients on how frequently they reconnect. Setting longPollTimeout to zero and clientPollInterval to a positive value indicates traditional polling will be used to connect to the server. Depending on the application type you are developing, traditional polling might be a preferable way to connect to the server. Configuring traditional polling allows easy connectivity to the service integration bus for message delivery.
Name: | clientPollInterval |
---|---|
Required or Optional: | Optional |
Data Type: | Integer |
Allowed Values: | Value in seconds that is greater than or equal to 0. Value must be less than bayeuxSessionTimeout. |
Default Value: | 0 |
Description: | Directs clients to reconnect at specified interval. Uses Bayeux reconnect interval advice mechanism to direct clients on how often to reconnect. This client connecting must support the Bayeux reconnect interval advice mechanism for this function to work. Clients might also connect at their own interval. |
The bayeuxSessionTimeout indicates how long the server waits for a client to reconnect before discarding any client session information. The client explicitly calls the Bayeux disconnect operation, but there is no guarantee the client will call disconnect. The default value of 90 seconds reflects the fact that Bayeux sessions are meant to be short lived. This value should be set sufficiently higher than the clientPollInterval to insure clients can reconnect successfully and continue receiving messages.
Name: | bayeuxSessionTimeout |
---|---|
Required or Optional: | Optional |
Data Type: | Integer |
Allowed Values: | Value in seconds greater than 10. |
Default Value: | 90 seconds |
Description: | Specifies how long the server waits for a client to reconnect before discarding knowledge of the client. If a client reconnects with the same client ID after the Bayeux sessoin has expired, the Bayeux rehandshake advice mechanism is used to initiate a new Bayeux session. |
The useDistributedSession is used to share Web messaging session information across all members in a cluster. Web messaging operations will be able to be resumed on another server if the useDistributedSession property is set to true and either the autoReinit or useDurable configuration property is set to true.
Name: | useDistributedSession |
---|---|
Required or Optional: | Optional |
Data Type: | Boolean |
Allowed Values: | true or false |
Default Value: | false |
Description: | Specifies Web messaging session information should be shared across all members in a cluster. When a server fails over or session affinity fails, Web messaging operations can be resumed on the new server. If the useDurable configuration property is set to true and distributed sessions are used, subscriptions can be resume on the new server and message loss will be minimized. If the autoReinit configuration property is set to true and distributed sessions are used, subscriptions will be re-initialized but message loss can occur during the time between subscription loss and subscription re-initializaiton. Session information shared across all cluster members includes: subscribed topic list, session identifier, bayeux session properties, and service integration bus properties. |