0

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>
4

1 回答 1

1

您可以useOriginalMessage=true在错误处理程序上配置。

于 2019-07-04T10:59:11.043 回答