Solace REST Overview
This section describes the Solace Representational State Transfer (REST) messaging protocol and message exchange patterns that will be encountered in common use cases.
REST is a lightweight way of designing network applications. Solace REST messaging can be used to integrate external HTTP REST clients and other network appliances that have built-in support for REST-like messaging with the Solace messaging platform.
Solace REST messaging makes use of bi-directional HTTP POST requests to exchange messages in both directions as shown in the following figure. This enables REST clients to send messages to and receive messages from any Solace router clients.
REST producers send message contents in the body of an HTTP POST request. For request/reply scenarios, the response contents are carried in the body of the HTTP POST 200 OK responses. For REST consumers, the Solace router sends the message in the body of an HTTP POST request. And again for request/reply scenarios, the response contents are carried in the HTTP POST 200 OK responses.
The use of HTTP POST requests in both directions has several benefits. It removes the possibility of message loss which can exist when using HTTP GET requests to poll for messages. It also enables much higher performance and overall message rate when multiple, parallel HTTP connections are used.
Solace REST Highlights
The following is a list of some key aspect of the Solace REST Protocol:
- the REST Service is controlled per Solace Virtual Message Broker
- REST access Ports are also configured per Virtual Message Broker
- it supports HTTP 1.1 persistent connections for efficient messaging
- it supports HTTP and HTTPS message traffic
- it supports sending messages as an HTTP client
- it supports receiving messages as an HTTP server
- it supports basic and client certificate authentication
- it inter-operates with all other Solace clients
There are two main actors in the Solace REST protocol:
- REST Producer—sends messages to the Solace router
- REST Consumer—receives messages from the Solace router
REST producers are applications that send REST messages to a topic or queue within a Message VPN on a Solace router. For REST producers to send messages to a router, they must establish a client connection to the router and be authenticated.
In general, it is recommended that applications use HTTP 1.1 persistent connections to allow for higher performance sending by avoiding the need to establish a connection for each message send action.
For physical client applications to consume REST messages from the Solace Messaging Platform, the Solace router will establish an HTTP connection to the consumer application and send messages to it using an HTTP POST request as seen in the following figure.
The REST application acknowledges receipt of the message through a 200 OK HTTP response back to the Solace router.
To receive messages from the Solace router, REST Delivery Points (RDPs) must be configured to provide the Solace router with details on how to deliver the messages.