web stats
Channel Response - TCP - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2016, 07:54 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Exclamation Channel Response - TCP

Mirth Version: 3.3.1.7856

I've this scenario:

Channel A:
- Channel Reader
- Send to Channel B (TCP Sender)
- Ignore response unckeked
- Response Timed Out = 5000
- Keep Connection Open = Yes

Channel B:
- TCP Listener
- JavaScript Writer Destination
- Create ResponseMap('RespDest1', some xml)
- On "Source Settings" Response = RespDest1
- Keep Connection Open = Yes

When i send some XML from A to B, B receive the message and on the Destination the Response is an xml like i create on 'RespDest1'.
Channel A is waiting for response from Channel B and when timeout changes to idle. Inside Channel A on the message destinations is says "SENT: Message successfully sent, but no response received." But on Channel B it's says that the response is the ResponseMap i created!!!! How can i see the response sent by Channel B on Channel A??!!!!

But in Channel B if i send the response to another channel, another TCP channel, it's sends the response and i'm able to see the XML response i want!

Thanks
Reply With Quote
  #2  
Old 02-23-2016, 08:46 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Please post the channels you're using.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 02-23-2016, 12:14 PM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Default

Quote:
Originally Posted by narupley View Post
Please post the channels you're using.
I send the 2 channels...

Thanks
Attached Files
File Type: xml SendXML.xml (10.1 KB, 28 views)
File Type: xml ReceiveXML.xml (10.1 KB, 29 views)
Reply With Quote
  #4  
Old 02-24-2016, 07:07 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Well no wonder, you're using Basic TCP without any end-of-message bytes! In that configuration, the only way the listener can know that a message has finished being received is if the receive timeout is reached, or if the client closes the connection. This applies not only to the listener connector, but also the sender connector when waiting for a response. So if both the sender and listener have the same timeout set (e.g. 5 seconds), then typically the sender will close the connection before the listener has a chance to send the response back. You can increase the response timeout of the sender to something higher than the receive timeout of the listener in that case.

Or, a better solution would be to use a protocol that has designated start/end frame bytes, like MLLP. That way the listener doesn't have to wait for any receive timeout; once it sees the ending byte sequence it immediately knows that a message has been received.

So just change the transmission mode of both the listener and sender to MLLP. Then on the listener, switch the receive timeout back to 0.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #5  
Old 02-24-2016, 07:22 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Default

Quote:
Originally Posted by narupley View Post
Well no wonder, you're using Basic TCP without any end-of-message bytes! In that configuration, the only way the listener can know that a message has finished being received is if the receive timeout is reached, or if the client closes the connection. This applies not only to the listener connector, but also the sender connector when waiting for a response. So if both the sender and listener have the same timeout set (e.g. 5 seconds), then typically the sender will close the connection before the listener has a chance to send the response back. You can increase the response timeout of the sender to something higher than the receive timeout of the listener in that case.

Or, a better solution would be to use a protocol that has designated start/end frame bytes, like MLLP. That way the listener doesn't have to wait for any receive timeout; once it sees the ending byte sequence it immediately knows that a message has been received.

So just change the transmission mode of both the listener and sender to MLLP. Then on the listener, switch the receive timeout back to 0.
Thank you... it works! So simple... In my mind i was guessing it was the Transmition Mode to MLLP but then i was like "naaa it can't be"!!! well, thanks very much
Reply With Quote
Reply

Tags
destination, map, response, responsemap, tcp

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 12:44 AM.


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