Search code examples
mirth

Error Connecting To Remote Host In Mirth


I need to create a connection between a lab machine and a server. The lab machine can send HL7 messages for test results.

I decided to use mirthconnect to process the message and so i created a channel.

The channel source connector was configured as a "TCP LISTENER"

The Listener settings use a "specific interface" with ip address of the machine entered.

Response settings are configured to "auto-generate after source transformer"

Transmission mode is "MLLP" using "Server" mode.

Receive timeout is 0 ms, and "keep Connection Open" radio button is checked.

I also specified a port number "2468" to listen on and it showed as enabled when i did a

"netstat -at" command.

On the sending computer on the network, i created a channel again and i put in the IP address of the first machine with the receiving channel on the destination. I also put in the port number that was used when creating the channel on the "receiving" computer.

However when i clicked on the "Test Connection" button i got an

  unable to connect to host error

I also tried to send a message after deploying the channel and the message was not sent. The error generated is shown below:

         TCP Sender error
   ERROR MESSAGE: Connection refused: connect
  java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.mirth.connect.connectors.tcp.SocketUtil.connectSocket(SocketUtil.java:62)
at com.mirth.connect.connectors.tcp.TcpDispatcher.send(TcpDispatcher.java:213)
at com.mirth.connect.donkey.server.channel.DestinationConnector.handleSend(DestinationConnector.java:599)
at com.mirth.connect.donkey.server.channel.DestinationConnector.process(DestinationConnector.java:336)
at com.mirth.connect.donkey.server.channel.DestinationChain.call(DestinationChain.java:224)
at com.mirth.connect.donkey.server.channel.Channel.process(Channel.java:1428)
at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:956)
at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:175)
at com.mirth.connect.server.controllers.DonkeyEngineController.dispatchRawMessage(DonkeyEngineController.java:520)
at com.mirth.connect.server.servlets.MessageObjectServlet$2.run(MessageObjectServlet.java:193)
at java.lang.Thread.run(Unknown Source)

I can successfully ping both systems and can connect to a MySQL server on the host by using

        mysql -utest -ptest -hipaddressofhost

I am using Mirthconnect 3.0. Please where am i missing it?...thanks

(I also have not encrypted the message nor am i using SSL To test the transmission...i believe this is not an issue??)


Solution

  • There is several things that could possibly go wrong with something that seems as simple as this is:

    1. Did you verify that you have no firewall installed or active. The commands you use seem to indicate that you may be using Linux. As such, you could become quite frustrated by something like iptables (/etc/init.d/iptables status) or another firewall like that.
    2. Are you sure you do not have any kind of firewall in the way that would prevent network communications between the sender and the box that is listening on port 2468? Are they on the same subnets? If they are not on the same subnet it is possible that some kind of network device/firewall is blocking the traffic.
    3. Can you telnet to the listener's ip address and port (telnet )?
    4. Another simple way to test if you are on the right path is to import the channel (or just the destination that is sending to the listener) into the listener machine's Mirth instance. If you are able to establish a connection while not making any changes to the port and ip address in this destination you probably have some kind of network/firewall issue that is preventing traffic on that specific port from getting through.

    Not sure if this will help you much, but good luck either way.

    Frans