简体   繁体   English

如何在Mirth中的目标转换器中重试异常

[英]How to retry on exception in destination transformer in Mirth

I have a channel that receives a message, extracts some information from it and then uses a destination transformer to enrich this information from external database and sends them to another channel. 我有一个接收消息的通道,从中提取一些信息,然后使用目标转换器从外部数据库中丰富此信息,并将其发送到另一个通道。

The processing in the transformer is written in Javascript and it can sometimes fail when the message is ahead of the data in database. 转换器中的处理是用Java脚本编写的,当消息在数据库中的数据之前时,有时可能会失败。 When this happens, I would like to wait a minute and try again. 发生这种情况时,我想等一下再试一次。

For now, I am only throwing exception in the transformer that allows me to inspect the message. 目前,我仅在转换器中引发异常,使我可以检查消息。 I tried to set the retry on destination, but it did not work. 我尝试将重试设置为目标,但没有成功。 I have a feeling that only retries if the destination itself throws an error. 我有一种感觉,只有在目的地本身抛出错误时才重试。

How can I retry when the destination transformer throws an exception? 当目标转换器引发异常时,我该如何重试?

In your destination transformer wait for required amount of time and then route the same message back (router.routeMessageByChannelId) to the same channel (ie, to the channel this destination belongs to) for re-processing. 在目标转换器中,等待所需的时间,然后将同一条消息(router.routeMessageByChannelId)路由回同一通道(即,此目标所属的通道)以进行重新处理。 In order to do this you need to turn Source Queue of the Source Connector from OFF to ON. 为此,您需要将“源连接器”的“源队列”从“关闭”切换为“打开”。

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

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