简体   繁体   中英

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. 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. In order to do this you need to turn Source Queue of the Source Connector from OFF to ON.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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