Tuesday, January 15, 2013

One source to multiple destinations in Mirth

  1. create the new channel with the name OneSourceMultipleDestination.
  2. Set data types to delimited text.
  3. Goto source tab, choose channel reader from the connector type drop down.
  4. Goto destination tab ,from connector type choose FileWriter from drop down.
  5. Method -> File
  6. Directory -> Give your directory path(example D:/MirthTool/Output).
  7.  File Name -> Give your file name(Ex:MyDestination).
  8. Append To file -> Yes. (or No,Depends on user)
  9.  From Destination mapping in right side,click and drag the Encoded data into the template field (or write ${message.encodedData}).
  10.  Now click on New Destination from the Channel task in the left side.
  11. Connector Type - > JavaScriptWriter.
  12. Write as logger.info("Success"); inside the JavaScriptWriter field.
  13. Now save and deploy the channel .
  14. Now right click on the OneSourceMultipleDestination channel from the Dashboard ,choose send message .Write something and click process message button.
  15. Now go to the given path(example D:/MirthTool/Output).There you can see the file which you named(MyDestination).
  16. Open and see,there will be the text that you have wrote in the message field . 
  17. And in the Log Information area in the bottom  you can see the success which is second destination output.(Remainder:See step 12)

     Like this you can add multiple destination.Using java file writer you can write in to another file.
    Use Database writer as a another destination and write into db.

No comments:

Post a Comment