简体   繁体   English

死信通道如何获取源路由?

[英]How to get the source route in the dead Letter channel?

I define a DeadLetterChannel.我定义了一个 DeadLetterChannel。 There I change some Values and save the MessageHistory into the exchange.在那里我更改了一些值并将 MessageHistory 保存到交换中。 Now I want to insert into the Headers from the exchange the Name of the Route where the exception happend.现在我想将发生异常的路由的名称插入到交换的标头中。 But I don't find any way to get the name of the source route.但是我找不到任何方法来获取源路由的名称。

Did anybody can help me?有人可以帮助我吗?

You can get the route id from the exchange property with the key Exchange.FAILURE_ROUTE_ID您可以使用键Exchange.FAILURE_ROUTE_ID从交换属性中获取路由 ID

String routeId = exchange.getProperty(Exchange.FAILURE_ROUTE_ID);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM