John Watson
John Watson

Reputation: 103

Spring integration server URL configuration approach

I am using spring integration for my framework. The framework will be used by many projects. Currently, i checked that the example in Spring integration. The URL for http-outbound is hardcode in the xml.

As the framework will be used by many people with different URL. What's the approach to let the end user project to configure the url? I was using maven build with parameter. I found that it is not that easy to maintain if i have too many parameter to configure. Is there any better way to do so? What's the common practice in the industry? Thanks.

<int-http:outbound-channel-adapter id="example"
    url="http://localhost/example"
    http-method="GET"
    channel="requests"
    charset="UTF-8"
    extract-payload="false"
    expected-response-type="java.lang.String"
    request-factory="someRequestFactory"
    order="3"
    auto-startup="false"/>

Upvotes: 1

Views: 61

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121550

Take a look, please, to the standard Spring Framework feature - Property Placeholder.

So, that url can be configured like:

url="${service.url}"

And each application would be able to provide their own value (target URL) via external properties file or any other possible source for PropertyPlaceholderConfigurer.

Upvotes: 1

Related Questions