首页 > 解决方案 > 如何为通过 Spring 集成使用的消息设置 jms 标头

问题描述

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

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

标签: spring-integrationspring-integration-dsl

解决方案


此属性适用于 JMS 生产者。

在将消息发送.enrichHeaders().handle(Jms.outboundAdapter()).

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


推荐阅读