Interface IHeaderFilterStrategy
Decides which headers a transport carries between an exchange and the messages of its protocol: the HTTP request
and response headers, the headers of a Kafka record, the application properties of an AMQP or Service Bus message.
Apache Camel's HeaderFilterStrategy.
Two directions, asked about every header one by one:
— the exchange's header is about to go into an outgoing message: the request a
producer sends, the reply a consumer sends back (Camel: applyFilterToCamelHeaders); — a header of an incoming message is about to come into the exchange: the
message a consumer receives, the reply a producer gets (Camel: applyFilterToExternalHeaders).
Both return true to drop the header and false to let it through, as in Camel.
Every transport that carries arbitrary headers has a default strategy that keeps its documented behaviour; a
strategy set on an endpoint (headerFilterStrategy=#name) replaces that default entirely. A strategy decides
about the headers of the route only: the fields a transport sets itself (trace context, content type, the native
properties of the message) do not go through it. DefaultHeaderFilterStrategy covers the usual
cases — a list of names, a regular expression, name prefixes — as a blacklist or a whitelist.
public interface IHeaderFilterStrategy
Methods
FilterIncoming(string, object?, IExchange)
Whether the header name of an incoming message (a consumed message, a producer's reply) is
bool FilterIncoming(string name, object? value, IExchange exchange)
FilterOutgoing(string, object?, IExchange)
Whether the exchange header name is dropped instead of going into an outgoing message
bool FilterOutgoing(string name, object? value, IExchange exchange)