Variables in proxies.xml

44 views
Skip to first unread message

Johannes Frank

unread,
Nov 28, 2017, 5:17:35 PM11/28/17
to membrane-monitor
Hey! Is there a way to use variables (e.g. JVM Arguments) inside the proxies.xml? I have a product that has a central file in which we are handling used ports and such, and it would be nice if we could simply hand those ports into the membrane process and reference these fields in the (then static) proxies.xml. The alternative I'm currently looking into is to take the file on every start of our management script and patch the required informations into it, which feels rather hacky.

Kind regards,
Johannes Frank

Tobias Polley

unread,
Jan 17, 2018, 3:42:41 AM1/17/18
to membrane-monitor
Hi Johannes,

Membrane Service Proxy basically defers this problem to Spring:

  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="my.port"><value>80</value></property>
  </bean>
  <m:router>
    <m:serviceProxy host="a.mycompany.com" port="#{my.port}">
      ...
    </m:serviceProxy>
    ...
  </m:router>

can be used to insert port "80". Spring's PropertyPlacehonderConfigurer has a lot of options and can, for example, use environment variables.

Best, Tobias
Reply all
Reply to author
Forward
0 new messages