apache-camel - How to send the original message to DLQ after processing
问题描述
How can I customize the route so that the original message appears in dlq? Now if my server is unavailable, messages appear in dlq after processing, for example: the message with body “origin_message” is in the my_test queue, after processing in myProcess I change it to “new_message”, and if the server is unavailable or answered with codes 400+ 500+ , in my queue my_dlq there is a message with the body "new_message"
<bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="activemq://my_dlq"/>
</bean>
<bean id="myProcess" class="mapper.MyProcess" />
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route errorHandlerRef="myDeadLetterErrorHandler">
<from uri="activemq://my_test"/>
<process ref="myProcess" />
<to uri="http://localhost:3000"/>
</route>
</camelContext>
解决方案
您可以useOriginalMessage=true
在错误处理程序上配置。
推荐阅读
- laravel - 如何插入 Laravel
- node.js - 如何在 Node.js 中获取没有完整路径的特定文件的目录名?
- postgresql - 如何在不达到 max_stack_depth 的情况下更新与 plpgsql 中的插入/更新相同的行
- react-native - 如何让 Android 中的 React Native 知道 Highcharts 图表中工具提示中的点击事件?
- flutter - 我希望我的按钮导航回我的主页,而不是颤动的上一页
- drools - 按日期选择直接前任
- java - 编写等效于 pojo/entity/ 类的 graphql 模式
- sql - 使用 **DELETE FROM ... OUTPUT ... INTO** 时获取目标表的标识
- php - 计算数组中所有可能的组合并将它们显示在表 php 中
- javascript - FieldValue.increment 不起作用但添加“操作数”