Handling client queues
Each client session has a queue on the Diffusion™ server. Messages to be sent to the client are queued here. You can monitor the state of these queues and set client queue behavior.
Receiving notifications of client queue events
Required permissions:
,A client can register a handler that is notified when outbound client queues at the Diffusion server reach pre-configured thresholds.
ClientControl clientControl = session.feature(ClientControl.class); clientControl.setQueueEventHandler( new ClientControl. QueueEventHandler.Default { @Override public void onUpperThresholdCrossed( final SessionId client, final MessageQueuePolicy policy) { // The action to perform when the queue upper threshold is crossed. } @Override public void onLowerThresholdCrossed( final SessionId client, final MessageQueuePolicy policy) { // The action to perform when the queue lower threshold is crossed. } } );
Handling client queue events
Required permissions:
,A client can respond to a client queue getting full by setting conflation on for the client. Conflation must be configured at the Diffusion server to have an effect.
A client is also able to set throttling on for specific clients, which also sets conflation. Using throttling without conflation can result in client queues overflowing.
Always use throttling and conflation in conjunction with a well-designed conflation strategy configured at the Diffusion server. For more information, see Conflation and Configuring conflation.
ClientControl clientControl = session.feature(ClientControl.class); clientControl.setThrottled(client, MESSAGE_INTERVAL, 1000, clientCallback);
var clientControl = session.ClientControl(); clientControl.SetThrottled( client, ThrottlerType.MESSAGE_INTERVAL, 10, theClientCallback );
This page last modified: 2016/04/14