Spring integration 筛选出AMQP入站适配器中AMQP消息的标头

Spring integration 筛选出AMQP入站适配器中AMQP消息的标头,spring-integration,spring-integration-dsl,spring-integration-amqp,Spring Integration,Spring Integration Dsl,Spring Integration Amqp,假设我有IntegrationFlow: IntegrationFlows.from( Amqp.inboundAdapter(rabbitConnectionFactory, NTF_INCOMING_CMSF_EVENT_QUEUE) .messageConverter(new Jackson2JsonMessageConverter(jacksonObjectMapper)) ) .get() 我想申请AMQP入站适配器,但似乎我只能在以后的管道中

假设我有
IntegrationFlow

IntegrationFlows.from(
    Amqp.inboundAdapter(rabbitConnectionFactory, NTF_INCOMING_CMSF_EVENT_QUEUE)
            .messageConverter(new Jackson2JsonMessageConverter(jacksonObjectMapper))
)
    .get()
我想申请AMQP入站适配器,但似乎我只能在以后的管道中申请


可以在入站适配器中过滤头吗?

可以,但它已被称为
头映射器

查看该
Amqp.inboundAdapter()的以下选项:

有关更多详细信息,请参阅
DefaultAmqpHeaderMapper
JavaDocs和本参考手册:

所以,您可能需要在头名称模式上使用否定运算符(

/**
 * 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) {