Path: redb-route/redb.Route.Amqp/AmqpHeaderFilterStrategy.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.Amqp/AmqpHeaderFilterStrategy.cs
----
using redb.Route.Abstractions;
namespace redb.Route.Amqp;
///
/// The default of the AMQP 1.0 component, Apache Camel's
/// AmqpHeaderFilterStrategy counterpart. An endpoint's headerFilterStrategy=#name replaces it; derive
/// from it to add to it.
///
/// A producer's request and a consumer's reply carry every exchange header but the component's own
/// redbAmqp.* and null values as application-properties; a consumed message and a request-reply's reply bring
/// every application-property in. Whatever the strategy, a producer sends the standard AMQP property names
/// (MessageId, CorrelationId, Subject...) as those properties, not as application-properties,
/// the consumer sets the standard properties and the redbAmqp.* delivery metadata by name, and trace context
/// is written by the telemetry layer.
///
///
public class AmqpHeaderFilterStrategy : IHeaderFilterStrategy
{
/// The default strategy of an AMQP endpoint.
public static AmqpHeaderFilterStrategy Default { get; } = new();
///
public virtual bool FilterOutgoing(string name, object? value, IExchange exchange)
=> value is null || AmqpHeaders.IsRedbHeader(name);
///
public virtual bool FilterIncoming(string name, object? value, IExchange exchange) => false;
}