REST

Solace REST messaging uses bidirectional HTTP POST requests to exchange messages with Solace PubSub+ event brokers. This lets REST clients send and receive messages to and from other Solace PubSub+ event broker clients whether they’re using a Solace API or an open API or protocol.

The figure below shows how an application can send and receive messages over HTTP using a RESTful API.

HTTP POST requests

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 200 OK responses. For REST consumers, the event broker 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 200 OK responses. This is explained in more detail in the section REST Messaging Protocol. The use of bidirectional HTTP POST requests has several benefits. First 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.

REST Concepts

If you haven't used REST and Solace PubSub+ together before, you might want to look at the REST section of the Overview: How Apps Interact with PubSub+ Messaging Components page. It'll take you on a tour of the PubSub+ event broker's messaging components, and explain at a high level how they make data move from producers to the broker, and from the broker to consumers, with REST.

When to Use REST Messaging Versus a Microgateway

Within a Message VPN, you can deploy either REST messaging or a Microgateway, but not both.

You Should Use REST Messaging When

You want an application to send and/or receive messages, but would prefer to use HTTP libraries instead of MQTT, AMQP, or libraries from Solace. When REST messaging is deployed, your application must use HTTP as defined in Solace REST HTTP Message Encoding.

For more information describing how to configure REST messaging, refer to REST Messaging Management.

You Should Use a Microgateway When

You want to provide connectivity between a RESTful service endpoint (defined by Swagger/Open API, RAML, or more informally) and a REST client. Microgateways provide higher performance, but less functionality than API Gateways, yet more capabilities than HTTP load balancers. When a Microgateway is deployed, Solace imposes no requirements on the HTTP protocol used.

For more information about Microgateways, refer to Microgateways Overview.

Get Started with REST Messaging Tutorials

These tutorials will introduce you to the fundamentals of using REST to develop applications using Solace PubSub+.

Start Tutorials