web stats
How to use environment variables to configure destination endpoint - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2019, 08:41 AM
iamonkara iamonkara is offline
What's HL7?
 
Join Date: Apr 2016
Posts: 4
iamonkara is on a distinguished road
Question How to use environment variables to configure destination endpoint

I have different destination addresses for different environments i.e. for test and production it is test.dest.app:3000 and prod.dest.app:3000 respectively

I am unable to figure out how to specify the destination URL (for an HTTP listener) using environment variables. I have tried http://${env.DEST_HOST}/ and http://$DEST_HOST but they are not evaluated and I don't want to hard code the destination address in the channel definition.
Reply With Quote
  #2  
Old 09-10-2019, 02:50 PM
peterl peterl is offline
Mirth Employee
 
Join Date: Mar 2013
Posts: 3
peterl is on a distinguished road
Default

You can get environment variables in the Deploy Script for the channel and store it in the global map or global channel map. Then you can access the map from your connector.

Deploy Script:
globalChannelMap.put('PATH', java.lang.System.getenv('DEST_HOST'));
return;

Connector
URL: ${DEST_HOST}
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 02:16 PM.


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