# Callback introduction

The callback function can save the current request in the gateway, and the request can be replayed later.

The use of callbacks, including

  • Callback configuration: Configure which requests need to be saved and how to respond to these requests.
  • Callback playback: How to play back a saved request.
  • Callback log: trace back the playback operation.

3 parts are introduced in sequence below.

# Callback configuration

Configure routing for callback requests

Add a new backend subscriber: that is, configure the target interface for request forwarding. Multiple subscribers can be configured.

Callback method:

  1. Synchronization: that is, the request is forwarded to the subscriber in real time, and the gateway saves the request at the same time.

  2. Asynchronous:

The gateway only saves the request and responds to the client as configured in the figure above, but does not forward the request to the subscriber in real time.

# Callback playback

After the callback is configured and there is a request for access, the request can be replayed through the management background.

In the query interface, you can filter the requests that need to be replayed and click "Playback":

Play back along the original path: If the gateway simultaneously forwards the request to Subscribers 1 and 2 when it receives it for the first time, then in this playback method, the request will still be forwarded to Subscribers 1 and 2.

Choose a service to receive replays from:

That is, the target for requesting replay is selected from the subscribers.

After setting the relevant options, click OK to play back the request.

# Playback log

By playing back the operation records, you can understand who, at what time, which requests were replayed, and the operation results.