Using request-response messaging
You can send request messages directly to a client session, a set of client sessions, or a message path. The recipient of a message can respond to the request.
Typed requests and responses
- JSON
- Binary
- String
- Int64
- Double
When you send a request, you specify the data type of the request message and the data type of the response message it expects. When you register a handler or a stream to receive requests and respond to them, you specify the data type of the requests it receives and the data type of the responses it sends.
Message path
The message path is made up of path segments separated by the slash character (/). Each path segment can be made up of one or more Unicode characters. The slash character (/) is not permitted in any path segment. The restrictions for message paths are the same as those for paths at which topics can be bound. For more information, see Topic naming.
- Message paths are unrelated topic paths. Sending a message does not change the state of any topic and does not publish the message to topic subscribers.
- An application can bind a topic to a topic path and use the same path as a message path. This is a useful convention where the messages are related to the topic in some way. The messages sent to the message path do not interact with the topic in any way.
- If a topic is bound to the path used by messaging, the data type of the topic does not affect the data type of any messages sent using the message path.
- The security permissions required to use a path for messaging are separate from those required to use a topic bound to that path to stream data.
Request-response and clusters
Request-response messaging is cluster-aware. This means that a message handler attached to one server in a Diffusion™ cluster can route a message to any server within that cluster.