web stats
Multiple HTTP Listener Channels on 1 port - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2017, 12:23 PM
nelheng nelheng is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
nelheng is on a distinguished road
Default Multiple HTTP Listener Channels on 1 port

I know in 2010-2014, this feature wasn't available. Just wondering if Mirth have upgraded and created this feature. If not, how would you create 2 channels, both sources are HTTP Listener..... listening on the same port but with different Base Context Path...
for example...
channel 1 listens on http://localhost:8082/test1
channel 2 listens on http://localhost:8082/test2

as of right now, I can only start 1 channel on that port... and if I do a POST call to http://localhost:8082/test1/abc/xyz?user=abc
the mirth channel will process it.....
Reply With Quote
  #2  
Old 12-09-2017, 04:47 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 275
AlexNeiva is on a distinguished road
Default

Hello,

From what I know and my experience it is not possible to have two or more channels listening to the same port.

Best Regards
Reply With Quote
  #3  
Old 12-09-2017, 09:21 AM
odo odo is offline
OBX.3 Kenobi
 
Join Date: Feb 2017
Location: Luxembourg
Posts: 137
odo is on a distinguished road
Default

Simply create a dispatcher channel that uses an HTTP listener as source connector (do not configure a context path). Depending on the context path (can be read from the source map attribute "contextPath") you dispatch either to channel A or channel B. Route the response back to the client.

Last edited by odo; 12-09-2017 at 09:24 AM.
Reply With Quote
  #4  
Old 05-10-2019, 12:13 PM
abadiejosse abadiejosse is offline
What's HL7?
 
Join Date: May 2019
Posts: 1
abadiejosse is on a distinguished road
Default same problem

Hi there,
I'm having the same problem here, I've researched along the web and didn't get a solution or functional example.
Is a very powerful tool, we've a lot hl7 messages in a context of SOA... So, I need to get more than one http listener (migth be not possible http://www.mirthcorp.com/community/i...wse/MIRTH-1702) or use a http listener as a proxy and other kind of connectors behind, like channel readers.
Does anyone here has an example?
Using 3.7.1

I don't get why does Mirth do this;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:univ="UniversalST">
<soapenv:Header/>
<soapenv:Body>
<univ:wsPerVisPre.Execute>
<univ:Wsperconvispreusu>AD224</univ:Wsperconvispreusu>
<univ:Wsperconvisprepas>ASD333</univ:Wsperconvisprepas>
<univ:Wsperconvispreordserid>123</univ:Wsperconvispreordserid>
</univ:wsPerVisPre.Execute>
</soapenv:Body>
</soapenv:Envelope>

Encoded:
Envelope|Header|Body|Wsperconvispreusu|AD224Wsperc onvisprepas|ASD333Wsperconvispreordserid|123

This is what the channel reader gets... and after that It does a transformation:

javascript channel:

var rawData = connectorMessage.getRawData();

var _WSPerConVisPreUsu = rawData.match("(<univ:Wsperconvispreusu>(.*?)</univ:Wsperconvispreusu>)")[2];
var _WSPerConVisPrePas = rawData.match("(<univ:Wsperconvisprepas>(.*?)</univ:Wsperconvisprepas>)")[2];
var _WSPerConVisPreOrdSer = rawData.match("(<univ:Wsperconvispreordserid>(.*?) <\/univ:Wsperconvispreordserid>)")[2];

channelMap.put("Wsperconvispreusu", _WSPerConVisPreUsu);
channelMap.put("Wsperconvisprepas", _WSPerConVisPrePas);
channelMap.put("WSPerConVisPreOrdSer", _WSPerConVisPreOrdSer);

Web Service sender channel;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:univ="UniversalST">
<soapenv:Header/>
<soapenv:Body>
<univ:wsPerVisPre.Execute>
<univ:Wsperconvispreusu>${Wsperconvispreusu}</univ:Wsperconvispreusu>
<univ:Wsperconvisprepas>${Wsperconvisprepas}</univ:Wsperconvisprepas>
<univ:Wsperconvispreordserid>${WSPerConVisPreOrdSe r}</univ:Wsperconvispreordserid>
</univ:wsPerVisPre.Execute>
</soapenv:Body>
</soapenv:Envelope>


Anything helps!
Thanks in advance!
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 08:00 PM.


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