Chain Providers

Pedestal uses a chain of Interceptors to process incoming HTTP requests and provide outgoing HTTP responses. However, the underlying code - the interceptors and the interceptor chain that executes them - is more general.

Interceptor chains can be used for a variety of operations, such as:

  • Processing messages from a queue, such as Kafka or JMS

  • Performing a series of transformations on documents as part of a publishing service

  • Processing outgoing requests and incoming responses from a back-end service

A chain provider is responsible for accepting an incoming stimuli (such as an incoming HTTP request) and setting up a context map and initial interceptors to process that stimuli. The service map is processed via the execute function.

Part of a chain provider’s responsibility is to identify when a request has been processed; for HTTP requests, this is when a handler or some other interceptor attaches a :response map to the context map.

Pedestal itself only provides a chain provider implementation for incoming HTTP request processing, in the form of the Servlet Interceptor.