Path: redb-route/redb.Route.RabbitMQ/RabbitMQHeaderFilterStrategy.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.RabbitMQ/RabbitMQHeaderFilterStrategy.cs
----
using redb.Route.Abstractions;
namespace redb.Route.RabbitMQ;
///
/// The default of the RabbitMQ component, Apache Camel's
/// RabbitMQHeaderFilterStrategy. An endpoint's headerFilterStrategy=#name replaces it; derive from it to
/// add to it.
///
/// A producer's request and a consumer's RPC reply carry every exchange header but the component's own
/// redbRmq.* and null values as AMQP headers; a consumed message and an RPC reply bring every AMQP header in.
/// Whatever the strategy, a header named after a basic property of the message (MessageId, CorrelationId,
/// ReplyTo...) goes into that property, not into the headers, and the delivery metadata
/// (redbRmq.*, the basic properties by name) is set by the consumer.
///
///
public class RabbitMQHeaderFilterStrategy : IHeaderFilterStrategy
{
/// The default strategy of a RabbitMQ endpoint.
public static RabbitMQHeaderFilterStrategy Default { get; } = new();
///
public virtual bool FilterOutgoing(string name, object? value, IExchange exchange)
=> value is null || RmqHeaders.IsRedbHeader(name);
///
public virtual bool FilterIncoming(string name, object? value, IExchange exchange) => false;
}