How To : Deployment Architecture to save throttled out messages from WSO2 API Manager

If you have experience with WSO2 API manager you already know that you can set throttling limits to the API's exposed using the API publisher. A very common problem most of the users have with the API manager is, how to stop these throttled out messages from being discarded.

A possible solution to this problem would be to use an instance of WSO2 Enterprise Integrator (EI)alongside the WSO2 API Manager, to handle the throttled out requests. When a request is throttled out it will be sent to the EI and then EI would store the request and replay the request at specified intervals. The new deployment architecture would look like the diagram below.

Some points to be noted when using this deployment architecture is as follows.

  1. By storing throttled out messages the message flow will no longer be a request/response. Once the message is throttled out an acknowledgement has to be sent to the customer to confirm receiving the message. It would be processed later and a back channel request can be sent to the customer by the backend.
  2. The access token given to the request might expire before a throttled out message gets back to the API Manager again. This can be addressed in two ways.
    - Access token validity can be set to longer duration.
    - A solution can be developed to regenerate the token (if it has expired) at the point of replaying the message. However, this would require some customization to the EI instance.

The above solution is targeted to reduce the number of instances used in this deployment. If you need a better distributed system, you can separate the message broker and the EI as well. To do this you can simply use two EI nodes alongside the API manager and setup one EI node to work as a message broker. Then the other EI node will pick messages from the message broker and play it back to the API manager at specified intervals.

If you think this article has been a useful source for you to get an idea about how to solve the specified problem, please show your support and share this article so that this will be useful to somebody else too.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.