Microgateway Request Handling
When a Microgateway receives an incoming REST request, the HTTP method and path portion of the request is encoded as the topic of an internal message, making it easy to deliver the message through the Solace PubSub+ event broker.
is encoded as the following Solace message topic:
This encoding enables the following functionality on the event broker:
- Request Method Authorization
- Request Load Balancing to Consumers
- Request Prioritization
- Request Burst Absorption and Buffering
The URI to internal topic encoding allows you to use an ACL to control which methods a REST client is able to access. For more information, refer to ACL Overview.
Solace event brokers are capable of efficiently load balancing incoming REST requests to a number of remote consumers (refer to REST Consumer Connection Selection); however, the URI to topic encoding provided by the Microgateway also enables you to calibrate the load balancing functionality by request method.
In applications where a specific method (for example, POST) is more expensive to process than others, you can allocate more microservice instances to the handling of that method.
HTTP Method Load Balancing Example
You can use the URI to topic encoding provided by the event broker to deliver different request methods to different queues, which can then result in prioritized processing of certain types of operations (POST) over others (GET). Under real time overload, this results in better application response to the most important user requests.
For an example describing how to set up prioritized processing, refer to Traffic Management to Microservices.
Because Solace Microgateways use queues to receive, store, and deliver REST requests to remote microservices, they provide inherent absorption and buffering against surges of client requests.