Path: redb-route/redb.Route.Sqs/SnsHeaderFilterStrategy.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.Sqs/SnsHeaderFilterStrategy.cs
----
using redb.Route.Abstractions;
namespace redb.Route.Sqs;
///
/// The default of the SNS component. An endpoint's
/// headerFilterStrategy=#name replaces it; derive from it to add to it.
///
/// A producer publishes every exchange header but the component's own redbSns.* / redbSqs.* and null
/// values as a message attribute of the same name. Whatever the strategy, a redbSqs.attr.<name> header
/// is an explicit request and goes out as attribute <name>, the other redbSns.* /
/// redbSqs.* headers never go out, and trace context is written by the telemetry layer.
///
///
public class SnsHeaderFilterStrategy : IHeaderFilterStrategy
{
/// The default strategy of an SNS endpoint.
public static SnsHeaderFilterStrategy Default { get; } = new();
///
public virtual bool FilterOutgoing(string name, object? value, IExchange exchange)
=> value is null || SnsHeaders.IsSnsHeader(name) || SqsHeaders.IsSqsHeader(name);
///
public virtual bool FilterIncoming(string name, object? value, IExchange exchange) => false;
}