# OrderService — In-Process Dead-Letter Replay

**Location:** [`samples/deadletter-inproc/OrderService.InProcDeadLetter/`](https://github.com/deveel/hermodr/tree/main/samples/deadletter-inproc/OrderService.InProcDeadLetter)\
**Transport:** In-memory sample channels\
**Pattern:** Dead-letter callback + immediate replay through the publisher pipeline

## What it demonstrates

* a failing publish channel that simulates a broken transport
* `AddDeadLetter(...).UseHandler(...)` for in-process dead-letter interception
* replaying the captured `CloudEvent` back through `IEventPublisher`
* targeting a recovery channel with `DeadLetterReplayPublishOptions`

## Flow

```
OrderSubmitted
    │
    ▼
primary channel  ──── throws
    │
    ▼
dead-letter callback  ──── immediate replay
    │
    ▼
recovery channel
```

The replay stays inside the same process and uses the same publisher pipeline. The replay marker prevents the replay attempt from being captured as a new dead-letter record.

## Run it

```bash
cd samples/deadletter-inproc/OrderService.InProcDeadLetter
dotnet run
```

For the full walkthrough, see the [sample README](https://github.com/deveel/hermodr/blob/main/samples/deadletter-inproc/OrderService.InProcDeadLetter/README.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hermodr.deveel.org/samples/deadletter-inproc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
