Skip to content

Commit

Permalink
Documentation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
John Knoop committed Oct 30, 2019
1 parent e607f99 commit 5b64713
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,23 @@ Any exception that your handler cannot recover from gracefully can be allowed to

You have three options for what to do with the message, when `MyException` occurs:

- **Abandon**(_maxTimes = null_)
-- Will return the message to the queue/subscription so that it may be retried again. If it has already been retried _maxTimes_ number of times, it will be deadlettered.
- **Deadletter**(_reason = null_)
-- Will move the message to the deadletter queue. Useful for poison messages, where you know it can not be handled by any running consumer.
- **Complete**()
-- Acknowledges the message.
- **Abandon**(_maxTimes = null_)\
Will return the message to the queue/subscription so that it may be retried again. If it has already been retried _maxTimes_ number of times, it will be deadlettered.
- **Deadletter**(_reason = null_)\
Will move the message to the deadletter queue. Useful for poison messages, where you know it can not be handled by any running consumer.
- **Complete**()\
Acknowledges the message.

#### Callbacks

Use this to carry out any side-effects, like logging etc.

#### Unexpected exceptions
#### Example:
```csharp
.Catch<MyException>(x => x.Abandon(), msg => _logger.Error(...))
```

#### Unhandled exceptions

`.CatchUnhandledExceptions(action, callback)` will catch all other types of exceptions thrown from your handler.

Expand Down Expand Up @@ -145,8 +150,6 @@ A new dependency scope is created and disposed for each message that is handled,

If you need to use information from your messages as part of your service resolution, a `Message` is added to your `IServiceCollection` before the handler is called, and can be used like this:

Any errors occuring during dependency resolution, for example if a required service isn't registered, can be caught using `OnDependencyResolutionException`.

```csharp
services.AddScoped<IRepository<Animal>>(provider =>
{
Expand All @@ -156,6 +159,8 @@ services.AddScoped<IRepository<Animal>>(provider =>
});
```

Any errors occuring during dependency resolution, for example if a required service isn't registered, can be caught using `OnDependencyResolutionException`.

### Sessions
Sessions are the way Azure Service Bus guarantees order of delivery.

Expand Down

0 comments on commit 5b64713

Please sign in to comment.