---
title: "The Dispatch Pipeline"
url: https://docs.zeroc.com/ice/3.8/runtime/dispatch/dispatch-pipeline
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# The Dispatch Pipeline

This page is written for C++, C#, Java, JavaScript, Python, and Swift.

An object adapter dispatches each incoming request through its *dispatch pipeline*, a chain of [dispatchers](https://docs.zeroc.com/ice/3.8/runtime/dispatch/dispatcher-api.md).

The request first goes through the [middleware](https://docs.zeroc.com/ice/3.8/runtime/dispatch/middleware.md) of the object adapter, in installation order. A middleware usually passes the request to the next dispatcher, but can also return a response itself, such as an error.

Once the request has gone through all the middleware, the object adapter dispatches the request to a servant. It looks for this servant in the following order:

1. The servant in its [active servant map](https://docs.zeroc.com/ice/3.8/runtime/dispatch/active-servant-map.md) (ASM) for the identity and facet of the request.
2. The [default servant](https://docs.zeroc.com/ice/3.8/runtime/dispatch/default-servants.md) registered for the category of the identity.
3. The default servant registered for the empty category.
4. A servant provided by a servant locator. Don't use servant locators in new applications.

When the object adapter finds no servant, the dispatch fails with `FacetNotExistException` if the ASM has a servant for the identity of the request with another [facet](https://docs.zeroc.com/ice/3.8/runtime/facets.md), and with `ObjectNotExistException` otherwise.
