Currently I have a simple war that holds some spring integration configuration, and this war is deployed into a jetty container using this code:
protected void createWac(File file, ConnectorConfig config) throws Exception, InterruptedException {
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
webapp.setWar(file.getAbsolutePath());
startServer(webapp, inboundConnector.getPort());
}
among the Spring Integration config, I have a int-http:inbound-gateway like this
<!-- External listener definition -->
<int-http:inbound-gateway id="entryHttpInboundGateway"
request-channel="myRequestChannel"
path="myPath"
reply-channel="myReplyChannel"
request-payload-type="com.me.MyType"
supported-methods="POST" message-converters="converters"
reply-timeout="1000">
</int-http:inbound-gateway>
My goal is to have the values for myPath and the supported-methods values set up dynamically, the first approach I went was to have variables on my xml file as some people suggest on this post: how to read System environment variable in Spring applicationContext
for that I tried with this config
<!-- External listener definition -->
<int-http:inbound-gateway id="entryHttpInboundGateway"
request-channel="myRequestChannel"
path="#{ systemProperties['HTTP_PATH'] }"
reply-channel="myReplyChannel"
request-payload-type="com.me.MyType"
supported-methods="POST" message-converters="converters"
reply-timeout="1000">
</int-http:inbound-gateway>
and setting the env on my machine, the weird thing is that when I set this, nothing happens, nor an config error, the initialization of the channel, or a property not found, I know, because if I remove the # sign, or put the actual url I get this on the console:
IntegrationRequestMappingHandlerMapping - Mapped "{[/{ systemProperties['HTTP_PATH'] }],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public abstract void org.springframework.web.HttpRequestHandler.handleRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws javax.servlet.ServletException,java.io.IOException
Any ideas on how to solve this, or another approach to be able to inject the values to the war's context file before its deployed into the jetty container?