Announcement

Collapse
No announcement yet.

How to use environment variables to configure destination endpoint

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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}

    Comment

    Working...
    X