Skip to content

Commit

Permalink
docs: update docs for v3.6.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BEagle1984 committed Dec 22, 2021
1 parent 6e1f6bf commit 361baa7
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup Label="Package information">
<BaseVersionSuffix></BaseVersionSuffix>
<BaseVersion>3.5.0$(BaseVersionSuffix)</BaseVersion>
<BaseVersion>3.6.0$(BaseVersionSuffix)</BaseVersion>
<DatabasePackagesRevision>1</DatabasePackagesRevision>
<DatabasePackagesVersionSuffix>$(BaseVersionSuffix)</DatabasePackagesVersionSuffix>
</PropertyGroup>
Expand Down
9 changes: 9 additions & 0 deletions docs/concepts/broker/headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,17 @@ Header Key | Description
`tracestate` | Used for distributed tracing. It corresponds to the [Activity.TraceStateString](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activity). The header is implemented according to the [W3C Trace Context proposal](https://www.w3.org/TR/trace-context-1/#tracestate-header).
`tracebaggage` | Used for distributed tracing. It corresponds to the string representation of the [Activity.Baggage](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activity) dictionary. This is not part of the w3c standard.
`content-type` | The content type of the [binary file](xref:binary-files), used when producing or consuming an <xref:Silverback.Messaging.Messages.IBinaryFileMessage>.
`x-failure-reason` | The header that will be set by the <xref:Silverback.Messaging.Inbound.ErrorHandling.MoveMessageErrorPolicy> and will contain the reason why the message failed to be processed.

### Kafka specific

`x-kafka-message-key` | The header that will be filled with the [key](xref:kafka-partitioning) of the message consumed from Kafka.
`x-kafka-message-timestamp` | The header that will be filled with the timestamp of the message consumed from Kafka.
`x-source-consumer-group-id` | The header that will be set by the <xref:Silverback.Messaging.Inbound.ErrorHandling.MoveMessageErrorPolicy> and will contain the GroupId the consumer that consumed the message that failed to be processed.
`x-source-topic` | The header that will be set by the <xref:Silverback.Messaging.Inbound.ErrorHandling.MoveMessageErrorPolicy> and will contain the source topic of the message that failed to be processed.
`x-source-partition` | The header that will be set by the <xref:Silverback.Messaging.Inbound.ErrorHandling.MoveMessageErrorPolicy> and will contain the source partition of the message that failed to be processed.
`x-source-offset` | The header that will be set by the <xref:Silverback.Messaging.Inbound.ErrorHandling.MoveMessageErrorPolicy> and will contain the offset of the message that failed to be processed.
`x-source-timestamp` | The header that will be set by the <xref:Silverback.Messaging.Inbound.ErrorHandling.MoveMessageErrorPolicy> and will contain the timestamp of the message that failed to be processed.

The static classes <xref:Silverback.Messaging.Messages.DefaultMessageHeaders> and <xref:Silverback.Messaging.Messages.KafkaMessageHeaders> contain all default header names constants.

Expand Down
15 changes: 15 additions & 0 deletions docs/concepts/broker/kafka/multiple-consumer-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ public class MySubscriber
```
***

> [!Note]
> The filters can be added dynamically using the overloads of `AddSubscriber` accepting a <xref:Silverback.Messaging.Subscribers.Subscriptions.SubscriptionOptions> or <xref:Silverback.Messaging.Subscribers.Subscriptions.TypeSubscriptionOptions> and this allows you to use a variable for the group id.
>
> ```csharp
> .AddSingletonSubscriber<MySubscriber>(
> new TypeSubscriptionOptions
> {
> Filters = new[]
> {
> new KafkaGroupIdFilterAttribute("consumer1")
> }
> })
> ```


Using the <xref:Silverback.Messaging.Subscribers.KafkaGroupIdFilterAttribute> is the cleanest and easiest approach but alternatively you can always subscribe to the <xref:Silverback.Messaging.Messages.IInboundEnvelope`1> and perform different tasks according to the `GroupId` value.

```csharp
Expand Down
14 changes: 14 additions & 0 deletions docs/concepts/broker/mqtt/multiple-clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ public class MySubscriber
```
***

> [!Note]
> The filters can be added dynamically using the overloads of `AddSubscriber` accepting a <xref:Silverback.Messaging.Subscribers.Subscriptions.SubscriptionOptions> or <xref:Silverback.Messaging.Subscribers.Subscriptions.TypeSubscriptionOptions> and this allows you to use a variable for the client id.
>
> ```csharp
> .AddSingletonSubscriber<MySubscriber>(
> new TypeSubscriptionOptions
> {
> Filters = new[]
> {
> new MqttClientIdFilterAttribute("client1")
> }
> })
> ```

Using the <xref:Silverback.Messaging.Subscribers.MqttClientIdFilterAttribute> is the cleanest and easiest approach but alternatively you can always subscribe to the <xref:Silverback.Messaging.Messages.IInboundEnvelope`1> and perform different tasks according to the `ClientId` value.

```csharp
Expand Down
14 changes: 14 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ uid: releases

# Releases

## [3.6.0-beta.1](https://github.com/BEagle1984/silverback/releases/tag/v3.6.0-beta.1)

### What's new

* Handle `IAsyncEnumerable<T>` returned by the subscriber and republished the contained messages
* Enrich Kafka messages moved by the <xref:Silverback.Messaging.Inbound.ErrorHandling.MoveMessageErrorPolicy> adding some extra headers containing some information about the source topic, partition, offset, etc. (see <xref:headers>)
* Allow filters such as the <xref:Silverback.Messaging.Subscribers.KafkaGroupIdFilterAttribute> or <xref:Silverback.Messaging.Subscribers.MqttClientIdFilterAttribute> to be added to the subscribers at runtime via the configuration API (see <xref:kafka-consumer-groups> and <xref:mqtt-client-ids>)

### Fixes

* Fix <xref:Silverback.Messaging.Broker.MqttConsumer> reconnection issues
* Handle edge cases related to MQTT acknowledgment timeout in <xref:Silverback.Messaging.Broker.MqttConsumer>
* Allow max retries specification and error policies chains with MQTT V3

## [3.5.0](https://github.com/BEagle1984/silverback/releases/tag/v3.5.0)

### What's new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ public static class KafkaMessageHeaders
public const string TimestampKey = "x-kafka-message-timestamp";

/// <summary>
/// This will be set by <see cref="MoveMessageErrorPolicy" /> and will contain the group ID of
/// the message that failed to be processed.
/// This will be set by the <see cref="MoveMessageErrorPolicy" /> and will contain the GroupId of
/// the consumer that consumed the message that failed to be processed.
/// </summary>
public const string SourceConsumerGroupId = "x-source-consumer-group-id";

/// <summary>
/// This will be set by <see cref="MoveMessageErrorPolicy" /> and will contain the topic of
/// the message that failed to be processed.
/// This will be set by the <see cref="MoveMessageErrorPolicy" /> and will contain the source
/// topic of the message that failed to be processed.
/// </summary>
public const string SourceTopic = "x-source-topic";

/// <summary>
/// This will be set by <see cref="MoveMessageErrorPolicy" /> and will contain the partition of
/// the message that failed to be processed.
/// This will be set by the <see cref="MoveMessageErrorPolicy" /> and will contain the source
/// partition of the message that failed to be processed.
/// </summary>
public const string SourcePartition = "x-source-partition";

/// <summary>
/// This will be set by <see cref="MoveMessageErrorPolicy" /> and will contain the offset of
/// This will be set by the <see cref="MoveMessageErrorPolicy" /> and will contain the offset of
/// the message that failed to be processed.
/// </summary>
public const string SourceOffset = "x-source-offset";

/// <summary>
/// This will be set by <see cref="MoveMessageErrorPolicy" /> and will contain the timestamp of
/// This will be set by the <see cref="MoveMessageErrorPolicy" /> and will contain the timestamp of
/// the message that failed to be processed.
/// </summary>
public const string SourceTimestamp = "x-source-timestamp";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ public static class DefaultMessageHeaders
/// </summary>
public const string FailedAttempts = "x-failed-attempts";

/// <summary>
/// This will be set by <see cref="MoveMessageErrorPolicy" /> and will contain the name of the
/// endpoint the failed message is being moved from.
/// </summary>
public const string SourceEndpoint = "x-source-endpoint";

/// <summary>
/// The message chunk index, used when chunking is enabled.
/// </summary>
Expand Down Expand Up @@ -102,7 +96,7 @@ public static class DefaultMessageHeaders
public const string EncryptionKeyId = "x-encryption-key-id";

/// <summary>
/// This will be set by <see cref="MoveMessageErrorPolicy" /> and will contain the reason why
/// This will be set by the <see cref="MoveMessageErrorPolicy" /> and will contain the reason why
/// the message failed to be processed.
/// </summary>
public const string FailureReason = "x-failure-reason";
Expand Down

0 comments on commit 361baa7

Please sign in to comment.