Skip to content

Source connectors ​

A channel has exactly one source connector, and its type decides what the channel accepts and how. Nine types ship with the engine.

ConnectorGets data by
Channel ReaderReceiving from other channels on the same engine
Database ReaderPolling a JDBC database
DICOM ListenerAccepting DICOM associations
File ReaderPolling a local directory, FTP, SFTP, S3, SMB, or WebDAV
HTTP ListenerServing HTTP requests
JavaScript ReaderRunning a script on a schedule
JMS ListenerConsuming from a JMS queue or topic
TCP ListenerAccepting TCP connections, MLLP included
Web Service ListenerServing SOAP requests

Settings outside the connector's own fields ​

Three blocks sit above the connector's own configuration, and the type decides which of them you get.

Listener settings, on the four that bind a port: TCP Listener, HTTP Listener, Web Service Listener, and DICOM Listener.

SettingDescription
Local AddressInterface to bind to. 0.0.0.0 binds all of them
Local PortPort to bind. Defaults differ per connector and are given below

Polling settings, on the three that poll rather than listen: Database Reader, File Reader, and JavaScript Reader. Interval, time, or cron, covered in Polling Settings.

Source settings, the only block all nine have: the source queue, the response selector, batch processing where the type supports it, and max processing threads. See Architecture.

Channel Reader ​

Receives messages from Channel Writer destinations on other channels, and from router calls in scripts. It has no fields of its own, and the Administrator shows No configurable settings in their place. The source settings block above still applies, and what arrives is decided entirely by the sending side.

Database Reader ​

Polls a database for a result set. Whether that set becomes one message or one message per row is decided by Aggregate Results below. Write the query in SQL or build it in JavaScript.

SettingDefaultDescription
DriverPlease Select OneJDBC driver. Required, JavaScript mode included. See drivers and URL templates
URLJDBC connection URL
Username / PasswordDatabase credentials
Use JavaScriptNoBuild the query in JavaScript instead of SQL. Switches the SQL field below to JavaScript
Keep Connection OpenYesReuse the connection between polls rather than reconnecting. Unavailable in JavaScript mode
Aggregate ResultsNoYes turns the whole result set into one message. No turns each row into its own message
Cache ResultsYesHold the whole result set in memory before processing. No streams from the cursor instead, and is what enables Fetch Size. Unavailable in JavaScript mode
Fetch Size1000JDBC ResultSet fetch size used when reading from the current cursor position. Applies only when Cache Results is No, and is greyed out otherwise, so at the default settings it does nothing
# of Retries on Error3Attempts after a failed poll before giving up
Retry Interval (ms)10000Wait between those attempts
EncodingDefaultCharacter set used to read column values
SQL / JavaScriptThe select. The Generate buttons above it build a starting statement, or in JavaScript mode a connection block, from the settings above
Run Post-Process SQL / Run Post-Process ScriptNeverNever, After each message, or Once after all messages. Runs a second statement after the message has been processed. What that statement does is up to you

The select runs again on every poll, so unless something changes the data it reads or the query itself, the same rows come back.

JavaScript mode

Choosing Use JavaScript disables three of the settings above: Keep Connection Open, Cache Results, and Fetch Size. The connector opens no database connection at all in this mode. The script opens its own, and has to return either a ResultSet or a List<Map<String, Object>>. A poll returning anything else fails.

That connection still has to be built, and the four settings at the top of the connector are what build it. Driver is required whether or not you use a script: the Administrator refuses to save the channel while it reads Please Select One, and there is no blank option. URL is validated only when Use JavaScript is No, and Username and Password are never validated. All four feed the generators. Generate: Connection, enabled only in this mode, pastes their current values, the password in plain text among them, into a connection block at the top of the script.

javascript
var dbConn;

try {
    dbConn = DatabaseConnectionFactory.createDatabaseConnection('<driver>','<url>','<username>','<password>');

    // You may access this result below with $('column_name')
    return result;
} finally {
    if (dbConn) {
        dbConn.close();
    }
}

The block is not runnable as generated. result is never assigned, so returning it fails the poll until you add the query yourself. Generate: Select is what adds it: it opens a live connection using those same four settings, which makes it the one place they are checked before a deploy, and inserts a dbConn.executeCachedQuery(...) line at the caret for the table you pick. The Post-Process JavaScript field has its own pair of buttons that do the same with executeUpdate.

Once generated, the driver, URL and credentials are string literals in the script. Editing the fields afterwards does not change them, and it is the literal in the script that decides what connects. The connector's own copies are never read at runtime.

Clicking the Use JavaScript radio rewrites both script fields: Yes replaces their contents with the generated block, No empties them. Reopening a saved channel does not, so this only bites while editing.

DICOM Listener ​

Accepts DICOM associations and stores received objects as messages. Default port 104.

SettingDefaultDescription
Application EntityAE title this listener answers to. Blank accepts any
Store Received Objects in DirectoryDirectory received objects are written to
Max Async operations0Maximum outstanding asynchronous operations. 0 is synchronous
Pack PDVPack the command and data PDVs into a single P-DATA-TF PDU
Only Accept Default Transfer SyntaxNoRefuse anything but implicit VR little endian
Only Uncompressed Pixel DataNoRefuse compressed transfer syntaxes
Accept Explict VR Big EndianNoAccept the big endian transfer syntax. The label carries the engine's own spelling
TCP DelayYesLeave Nagle's algorithm on. No sets TCP_NODELAY

Timing

SettingDefaultDescription
DIMSE-RQ timeout (ms)60Wait for a DIMSE request
DIMSE-RSP delay (ms)0Artificial delay before responding
DIMSE-RSP interval period (s)10Interval for the association reaper
ASSOCIATE-RQ timeout (ms)5Wait for an association request
A-RELEASE-RP timeout (s)5Wait for a release response
Socket Close Delay After A-ABORT (ms)50Delay before closing the socket after an abort

Buffers

SettingDefaultDescription
P-DATA-TF PDUs max length sent (KB)16Maximum PDU length sent
P-DATA-TF PDUs max length received (KB)16Maximum PDU length accepted
Send Socket Buffer Size (KB)00 leaves the OS default
Receive Socket Buffer Size (KB)00 leaves the OS default
Transcoder Buffer Size (KB)1Buffer used when transcoding

TLS

SettingDefaultDescription
TLSNo TLSNo TLS, 3DES, AES, or Without
Client Authentication TLSNoRequire a client certificate
Accept ssl v2 TLS handshakeYesAccept the SSLv2-style handshake
Keystore / Keystore Password / Key PasswordIdentity presented by the listener
Trust Store / Trust Store PasswordCertificates the listener will trust

File Reader ​

Polls a location and turns files into messages.

Method is the first field on the panel and it governs the rest of it. It decides how the location is addressed, whether credentials apply, and which connection settings are available at all. Anything greyed out is greyed out because of it.

MethodLocation fieldsCredentialsConnection settings enabled
fileDirectorynonenone
ftpftp:// host, pathAnonymous, or username and passwordTimeout, Passive Mode, Validate Connection, Advanced Options
sftpsftp:// host, pathno Anonymous option; the fields stay editableTimeout, Advanced Options
smbsmb:// host, pathno Anonymous option; the fields stay editableTimeout, Advanced Options
webdavhttp:// or https:// host, pathAnonymous, or username and passwordSecure Mode
Amazon S3S3 Bucket, pathAnonymous, or AWS Access Key ID and Secret Access KeyTimeout, Advanced Options

Timeout must not be left blank for FTP, SFTP, or SMB. file is the only method with a single Directory field; the others split the location into a host and a path, with the protocol prefix as the host's label. Secure Mode is what switches WebDAV between http:// and https://, and the FTP prefix reads ftps:// when TLS is configured. Under S3 the credential fields are relabelled AWS Access Key ID and AWS Secret Access Key, and the move-to fields become Move-to S3 Bucket / Directory.

The rest of the panel, in the order it appears:

SettingDefaultDescription
Filename Filter Pattern*Wildcard by default; the Regular Expression checkbox switches it to a regex
Include All SubdirectoriesNoRecurse
Ignore . filesYesSkip dotfiles
AnonymousYesOffered by FTP, WebDAV, and S3 only. Choosing Yes disables the two fields below and refills them with anonymous, except under S3, which clears them
Username / Passwordanonymous / anonymousBoth fields carry anonymous by default, so SFTP and SMB, which have no Anonymous option, open with it already filled in and editable. S3 starts them empty. A username is required whenever Anonymous is off; a password is too, unless the method is SFTP and the Advanced Options use a key file
Timeout (ms)10000How long to wait when connecting. Not available for file or WebDAV
Secure ModeYesWebDAV over HTTPS. WebDAV only
Passive ModeYesFTP passive transfers. FTP only
Validate ConnectionYesTest the connection before each poll. FTP only
After Processing ActionNoneNone, Move, or Delete. None leaves the file in place, so the next poll reads it again
Move-to Directory / Move-to File NameWhere a moved file goes, on the source itself. A blank directory leaves the file where it is, a blank file name keeps the original one, and an existing file at the destination is deleted first
Error Reading ActionNoneNone, Move, or Delete, for a file that could not be read
Error in Response ActionAfter ProcessingWhat to do with a file whose message ended in an error response
Error Move-to Directory / Error Move-to File NameDestination for either error action, on the source, under the same rules
Check File AgeYesSkip files younger than File Age
File Age (ms)1000Minimum age before a file is read
File Size (bytes)0, no maximumMinimum and maximum a file must fall between. Ignore Maximum leaves the upper bound open, and is checked by default
Sort Files ByDateDate, Name, or Size. Decides the order files are processed in
File TypeTextText or Binary. Binary base64 encodes the content
EncodingDefaultCharacter set, Text only

The move-to directory is on the source, not on the OIE server

A move runs over the same connection the file was read from. The connector asks the source for a connection and renames the file on it, so the destination is wherever Method points. Read over SFTP and the move-to directory is a directory on the SFTP server. Read over FTP it is on the FTP server, and over SMB it is a path on the same share. Nothing is copied back to the OIE server on the way. The same goes for Error Move-to Directory, and for the Delete actions, which delete on the remote side. Only Method file moves anything on the OIE server's own disk, and only because that is where it read from.

Relative paths resolve differently per method. FTP and SFTP change to the read directory first, so a path with no leading / is taken relative to the directory being read, and a leading / is absolute on the remote host. SMB resolves the path against the share root. S3 reads the field as a bucket and a prefix, which is why it is labelled Move-to S3 Bucket / Directory and why a move can cross buckets. Backslashes typed into either move-to directory field are converted to forward slashes when the channel is saved. A move-to directory that does not exist is created.

Advanced Options opens a per-protocol dialog, and the read-only summary beside Method shows what is set in it. See file protocol advanced settings.

HTTP Listener ​

Serves HTTP requests. Default port 80, and the HTTP URL / HTTPS URL shown on the panel is built from the address, port, and context path.

SettingDefaultDescription
Base Context PathPath this connector answers on. Blank means the root, not nothing. See below
Receive Timeout (ms)30000Idle timeout for a request
Message ContentPlain BodyPlain Body passes the body through. XML Body wraps method, headers, parameters, and body in XML
Parse MultipartYesSplit a multipart request into parts. XML Body only
Include MetadataNoInclude method, context path, headers, and query parameters. XML Body only
Binary MIME Typesapplication/.*(?<!json|xml)$|image/.*|video/.*|audio/.*Content types treated as binary and base64 encoded. Regular Expression switches it between a regex and a plain list
Response Content Typetext/plainValue of the response's Content-Type header
Response Data TypeTextText or Binary. Binary base64 decodes the response before sending
Response Status CodeHTTP status to return. Blank returns 200, or 400 for an errored message
Response HeadersHeaders to return. Use Map takes them from a map variable instead of the table
Charset EncodingUTF-8Character set. Disabled when Response Data Type is Binary
Static ResourcesPaths served directly by the connector, each with its own content type and value, without producing a message

Base Context Path is blank out of the box, and blank is the root. The engine normalizes it before Jetty sees it: a leading slash is added if you left it off, and a trailing slash is stripped, so orders, /orders, and /orders/ all give the same context, and blank and / are the same thing. A listener answers its context path and everything below it, so at the root it answers every request that reaches its port.

That is not the collision it sounds like. Each HTTP Listener builds its own server bound to its own host and port, so two channels cannot share a port and divide it by context path. The path separates the connector from nothing else on that port, which is why leaving it at the root is a reasonable default rather than a greedy one. Static resource paths are appended to the base, and the HTTP URL field on the panel shows the address that results.

Authentication is a separate plugin; see HTTP authentication.

JavaScript Reader ​

Runs a script on the polling schedule. The script's return value becomes the message, and returning nothing produces no message.

SettingDescription
JavaScriptThe script to run

This connector's scope is narrower than most: it has no channelMap, connectorMap, sourceMap, responseMap, or connectorMessage. JavaScriptReceiver builds its scope from the no-message variant, unlike the JavaScript Writer. See JavaScript Scripting Reference.

JMS Listener ​

Consumes from a JMS queue or topic.

SettingDefaultDescription
Use JNDIOff names a factory class, on names a JNDI lookup
Connection Factory ClassVendor ConnectionFactory implementation, JNDI off
Connection Factory NameJNDI lookup name, JNDI on. Not a class name
Initial Context Factory / Provider URLJNDI context, JNDI on
Connection PropertiesAdditional properties passed to the factory
Username / PasswordBroker credentials
Destination TypeQueue or Topic
Destination NameQueue or topic to consume from
Client IDJMS client identifier, required for a durable subscription
SelectorJMS message selector expression, filtering at the broker
Reconnect Interval (ms)10000Wait before reconnecting after a broker failure
DurableNoDurable topic subscription, which needs a Client ID to be set

The provider's client jar goes in the channel's library resources.

TCP Listener ​

Accepts TCP connections. With MLLP framing this is the usual HL7 v2 entry point. Default port 6661.

SettingDefaultDescription
ModeServerServer binds and accepts, and is the only mode with Max Connections. Client connects out, and is the only mode with Remote Address, Remote Port, Override Local Binding, and Reconnect Interval
Remote Address / Remote PortWhere to connect, Client mode only
Override Local BindingNoBind a specific local address and port for the outbound connection. Client mode only
Reconnect Interval (ms)5000Wait before reconnecting, Client mode
Receive Timeout (ms)0Idle timeout on a connection. 0 waits indefinitely
Buffer Size (bytes)65536Socket read buffer
Max Connections10Concurrent connections accepted. Server mode only
Keep Connection OpenYesHold the connection open between messages
Data TypeTextText or Binary. Binary base64 encodes the payload
EncodingDefaultCharacter set, Text only
Transmission ModeMLLPMLLP or Basic. Sample Frame previews the framing bytes. See transmission modes
Respond on New ConnectionNoYes, No, or Message Recovery. No sends the response back on the same connection
Response Address / Response PortWhere the response goes. Enabled when Respond on New Connection is Yes or Message Recovery

Web Service Listener ​

Publishes a SOAP endpoint. Default port 8081.

SettingDefaultDescription
Service NameMirthService name in the published WSDL
Service Class Namecom.mirth.connect.connectors.ws.DefaultAcceptMessageClass implementing the service. The default publishes a single acceptMessage(String) operation
MethodOperations offered by the class. The default class offers String acceptMessage(String message)
BindingDefaultSOAP binding the published service uses
WSDL URLThe generated WSDL location, shown once the channel is deployed

Naming a different class here repopulates Method with the operations that class offers.

Shared reference ​

Transmission modes ​

Used by both the TCP Listener and the TCP Sender.

ModeDescription
MLLPHL7 framing: start byte 0x0B, end bytes 0x1C 0x0D. MLLPv2 adds configurable acknowledgement bytes
BasicStart and end bytes you choose

JDBC drivers and URL templates ​

Used by both the Database Reader and the Database Writer. These are the drivers declared in conf/dbdrivers.xml, which is also where you add your own.

DriverClassURL Template
MySQLcom.mysql.cj.jdbc.Driverjdbc:mysql://host:port/dbname
Oracleoracle.jdbc.driver.OracleDriverjdbc:oracle:thin:@host:port:dbname
PostgreSQLorg.postgresql.Driverjdbc:postgresql://host:port/dbname
SQL Server/Sybase (jTDS)net.sourceforge.jtds.jdbc.Driverjdbc:jtds:sqlserver://host:port/dbname
Microsoft SQL Servercom.microsoft.sqlserver.jdbc.SQLServerDriverjdbc:sqlserver://host:port;databaseName=dbname
SQLiteorg.sqlite.JDBCjdbc:sqlite:dbfile.db

INFO

These are the databases a channel can read from and write to. They are not the same set OIE supports for its own message repository. See Database Support for that. SQLite, for instance, is available to channels but is not a supported backing store for OIE itself.

File protocol advanced settings ​

Reached through Advanced Options on the File Reader and the File Writer. The dialog's contents depend on the selected method. Passive mode, secure mode, and the timeout are not in these dialogs; they are on the main connector panel. There is no bucket field for S3, the bucket is the leading element of the Directory path, and there is no domain field for SMB.

  • FTP - Initial Commands
  • SFTP - Authentication, Public/Private Key File, Passphrase, Host Key Checking, Known Hosts File, and a free-form Configuration Options map
  • S3 - Use Default Credential Provider Chain, Use Temporary Credentials, Duration (seconds), Region, Custom HTTP Headers
  • SMB - SMB Minimum Version, SMB Maximum Version

For S3 the generic Username and Password fields are relabelled AWS Access Key ID and AWS Secret Access Key on the main panel.

HTTP authentication ​

An extension that adds an authentication layer to the HTTP Listener and the Web Service Listener. The methods offered:

  • Basic Authentication - username and password
  • Digest Authentication - digest challenge and response
  • JavaScript - authentication logic you write
  • Custom Java Class - authentication delegated to a class you supply
  • OAuth 2.0 Token Verification - validates an incoming OAuth 2.0 token