web stats
Logging messages in an external database - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2017, 04:13 PM
jerchap jerchap is offline
OBX.3 Kenobi
 
Join Date: Nov 2007
Location: British Columbia, Canada
Posts: 131
jerchap is an unknown quantity at this point
Default Logging messages in an external database

We want to log messages entering and leaving mirth in an external database for archival purposes.

We could put a destination on every inbound and outbound channel we have in the system but that a bit of a brute force approach. I'm wondering if there is a way through a global script or some other mechanism that we can capture messages that come into a non channel reader channel and go out of a non channel writer destination and send them to a database.

There is a post processor global script which I may be able to use as a means to capture inbound messages but that doesn't fire for each destination. As well I need to grab metadata about the message such as the message id and channel name.

Hoping someone has ideas.
Reply With Quote
  #2  
Old 12-07-2017, 12:25 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 841
siddharth is on a distinguished road
Default

You could create a function in Library, that does the inserts in the table, and call that function from source transformer, to record the incoming raw message to a channel.

Repeat the same process on the destination side.
__________________
HL7v2.7 Certified Control Specialist!
Reply With Quote
  #3  
Old 12-07-2017, 01:52 AM
amble amble is offline
OBX.2 Kenobi
 
Join Date: Nov 2015
Posts: 95
amble is on a distinguished road
Default

Just a guess but aren't they stored in the mirthdb for the message dashboard before being pruned out? Couldn't you just do a database reader per channel localid from that?

Again, this is just me having an educated guess.
Reply With Quote
  #4  
Old 12-07-2017, 06:18 AM
jerchap jerchap is offline
OBX.3 Kenobi
 
Join Date: Nov 2007
Location: British Columbia, Canada
Posts: 131
jerchap is an unknown quantity at this point
Default

Quote:
Originally Posted by siddharth View Post
You could create a function in Library, that does the inserts in the table, and call that function from source transformer, to record the incoming raw message to a channel.

Repeat the same process on the destination side.
We can, but that requires us to do that in every channel we have. I current environment consists of 15 mirth servers each with a fairly large number of channels. We're hoping to implement this as a platform so that when we create new channels we don't have to concern ourselves with the archiving functionality, it just works behind the scenes.
Reply With Quote
  #5  
Old 12-07-2017, 06:22 AM
jerchap jerchap is offline
OBX.3 Kenobi
 
Join Date: Nov 2007
Location: British Columbia, Canada
Posts: 131
jerchap is an unknown quantity at this point
Default

Quote:
Originally Posted by amble View Post
Just a guess but aren't they stored in the mirthdb for the message dashboard before being pruned out? Couldn't you just do a database reader per channel localid from that?

Again, this is just me having an educated guess.
They are, but some of the information isn't stored discretely in the database so we'd have to parse it out of the message. It would also require us to create a database reader for every channel we create which is something we want to avoid.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:27 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation