Just a second...

Publishing and sending messages

Publishing messages to clients and sending messages to clients

Creating messages

Messages can be created using the factory methods on the publisher or on a topic for creating messages (called createLoadMessage and createDeltaMessage).

If within a class that does not have a direct reference to the publisher or topic objects, the equivalent static methods in the Publishers class can be used. Messages can be populated with data using the many variants of the put method.

Publishing messages

Messages (whether load or delta) can be sent to all clients that are subscribed to the message topic. For stateless topics, use Topic.publishMessage(). For stateful topics (those with topic data), use PublishingTopicData.publishMessage().

Exclusive publishing

You might want to publish a message to all but a particular client. For example, a message can be sent to the publisher from a client and the publisher can, publish the message to all of the other subscribed clients.

This is done using the publisher's publishExclusiveMessage method.

Sending messages to individual clients

To send a message to an individual client the Client.send method can be used.