spring-integration - 如何为通过 Spring 集成使用的消息设置 jms 标头
问题描述
为了在 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();
解决方案
此属性适用于 JMS 生产者。
在将消息发送.enrichHeaders()
到.handle(Jms.outboundAdapter())
.
推荐阅读
- c++ - 使用更大的
() 在 priority_queue - python - 计算连字符平均长度的函数
- python - Selenium Python等待功能,最大等待时间不起作用
- angular - Angular 表单与异步管道绑定以设置模型
- javascript - 由于 Invariant Violaton,Expo Android Emulator 未加载:[React Intl] `Intl` API 必须在运行时可用,并且似乎不可用
- laravel - Laravel 7 Lumen,安装 ffmpeg 问题
- node.js - Google Cloud Functions Node.js 错误报告 - 未记录未处理的拒绝
- linux-kernel - 用于将 IPv6 数据报定向到内核的原始套接字
- sql - 无法为 Spring Boot 存储库中的数组运行 CASE WHEN
- react-native - 有没有办法通过 React Native 应用程序更改时区?