Messaging
In addition to publishing data to topics as updates, you can send data as messages to specific clients or to registered message handlers on topic paths.
Messaging and pub-sub are separate capabilities. Messaging uses topic paths to route the messages, but does not use the topics bound to those paths. Sending messages does not change the state of data on the topic, nor does it cause updates to be sent.
There are two ways in which messages are sent through topic paths:
Send messages to a topic path

A client with the or publisher, if any, receives the message.
permission can send messages on a topic path. The sending client does not know which clientA client with the
permission can register a handler on a part of the topic tree. This client receives any messages that are sent on topic paths in that part of the topic tree.Send messages to a client session

A client with the
and permissions that knows the session ID of a client session can send messages through a topic path to the known client session.The receiving client must have a message stream registered against a topic path to receive messages sent through that topic path. For more information, see Streams.
Considerations when using messaging
- The data type of the value sent in the message is not required to match the data type of the topic, if any, bound to the topic path you use to send the message.
- A message can include headers. These headers are a set of string values that are separate to the message content.
- You can set a priority on messages sent to client sessions. This priority affects the order in which the messages are queued on the Diffusion™ server for delivery to the client.
- The following APIs require that a topic exists at a topic path to send a
message through it and that they are subscribed to a topic path to receive a
message through it:
- Android™ Classic API (deprecated)
- Flash® Classic API (deprecated)
- iOS® Classic API (deprecated)
- Silverlight® Classic API (deprecated)
- C Classic API (deprecated)
- Java™ Classic API (deprecated)
- JavaScript® Classic API (deprecated)
- .NET Classic API (deprecated)