It is possible, but that is called already a HeaderMapper
.
See these options of that Amqp.inboundAdapter()
:
/**
* Configure the adapter's {@link AmqpHeaderMapper};
* defaults to {@link DefaultAmqpHeaderMapper}.
* @param headerMapper the headerMapper.
* @return the spec.
*/
public S headerMapper(AmqpHeaderMapper headerMapper) {
this.target.setHeaderMapper(headerMapper);
return _this();
}
/**
* Only applies if the default header mapper is used.
* @param headers the headers.
* @return the spec.
* @see DefaultAmqpHeaderMapper#setRequestHeaderNames(String[])
*/
public S mappedRequestHeaders(String... headers) {
For further details see DefaultAmqpHeaderMapper
JavaDocs and this respective reference Manual: https://docs.spring.io/spring-integration/docs/5.3.2.RELEASE/reference/html/amqp.html#amqp-message-headers
So, probably what you need is a negation operator (!
) on header name patterns.