- create the new channel with the name OneSourceMultipleDestination.
- Set data types to delimited text.
- Goto source tab, choose channel reader from the connector type drop down.
- Goto destination tab ,from connector type choose FileWriter from drop down.
- Method -> File
- Directory -> Give your directory path(example D:/MirthTool/Output).
- File Name -> Give your file name(Ex:MyDestination).
- Append To file -> Yes. (or No,Depends on user)
- From Destination mapping in right side,click and drag the Encoded data into the template field (or write ${message.encodedData}).
- Now click on New Destination from the Channel task in the left side.
- Connector Type - > JavaScriptWriter.
- Write as logger.info("Success"); inside the JavaScriptWriter field.
- Now save and deploy the channel .
- Now right click on the OneSourceMultipleDestination channel from the Dashboard ,choose send message .Write something and click process message button.
- Now go to the given path(example D:/MirthTool/Output).There you can see the file which you named(MyDestination).
- Open and see,there will be the text that you have wrote in the message field .
- 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.
Tuesday, January 15, 2013
One source to multiple destinations in Mirth
Writing into another channel(One channel output as a another channel's input) in Mirth
- Create a new channel with a name Channel1.
- Set data types to delimited text.
- Goto source tab, choose channel reader from the connector type dropdown.
- Goto destination tab , choose channel Writer(Because we are providing this channel output as an input for the another channel) from the connector type dropdown.
- In channel writer ,channel name as None(after created the Channel2 we give that name here).
- From Destination mapping in right side,click and drag the Encoded data into the template field (or write ${message.encodedData}).
- Save the channel.
- Then again go and create the new channel with the name Channel2.
- Set data types to delimited text.
- Goto source tab, choose channel reader from the connector type drop down.
- Goto destination tab ,from connector type choose FileWriter from drop down.
- Method -> File
- Directory -> Give your directory path(example D:/MirthTool/Output).
- File Name -> Give your file name(Ex:Myfile).
- Append To file -> Yes. (or No,Depends on user)
- From Destination mapping in right side,click and drag the Encoded data into the template field (or write ${message.encodedData}).
- Now save and go to Channel1 and change the channel name as Channel2 in the destination tab (As mentioned in the 5th step) .
- Now save and deploy both the channel .
- Now right click on the channel 1 from the Dashboard ,choose send message .Write something and click process message button.
- Now go to the given path(example D:/MirthTool/Output).There you can see the file which you named(Myfile).
- Open and see,there will be the text that you have wrote in the message field .
Sending an Email from Mirth
- Create a New channel with a name SendEmail.
- Goto source tab.
- Connector type -> Channel Reader.
- Jump into destination tab.
- Connector type -> EmailSender.
- SMTP Server Host as smtp.gmail.com .
- SMTP Server Port 25.
- Secure connection TLS.
- USe authentication -> Yes
- Your gmail user name and password.
- To Mail ID -> Give some of your other email id.
- From -> Give your gmail id.
- Finally enter the subject and body of the mail.
- Save Channel.
- Goto channel tab in leftside,then right click on your SendEmail Channel and deploy it.
- Now go to dashboard and right click on your SendEmail Channel and choose send message.
- Write something in that window and click process message button.
- Refresh over the channel and go to your other mail id ,which you gave in To Mail Id in step 11.
- There , you will get the new mail from mirth which you generated.
Subscribe to:
Posts (Atom)