如何为通过Spring集成消耗的消息设置jms标头

时间:2019-01-15 16:28:36

标签: spring-integration spring-integration-dsl

在maxRelivery尝试的情况下,为了使消息移至未传递的队列,tibco代理希望将jms属性JMS_TIBCO_PRESERVE_UNDELIVERED设置为true。消息耗尽后,我不确定如何设置此属性。

IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory)
                .destination(sourceQueue)
                .configureListenerContainer(spec -> {
                    spec.sessionTransacted(false);
                    spec.sessionAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE);
                })
               .handle(someservice).get();

1 个答案:

答案 0 :(得分:2)

此属性用于JMS生产者。

在向.enrichHeaders()发送消息之前,使用.handle(Jms.outboundAdapter())将此值设置到标头并不难。

在此处查看更多信息:https://haritibcoblog.com/2017/04/03/tibco-ems-properties-of-queues-and-topics-where-tuning-can-be-done/