...
Code Block |
---|
lang | xml |
---|
title | Components ommitted |
---|
|
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:test="urn:test">
<sm:container id="jbi" embedded="true">
<sm:endpoints>
<jsr181:endpoint
pojoClass="org.apache.servicemix.itests.beans.Echo"
service="test:Hello"
endpoint="testService" />
<http:endpoint
service="test:Hello"
endpoint="testService"
role="consumer"
defaultOperation="echo"
locationURI="http://localhost:8194/Service/"
soap="true" />
</sm:endpoints>
</sm:container>
|
If you need to configure a component specifically, you can do it as shown in the following snippet:
Code Block |
---|
lang | xml |
---|
title | Components ommitted |
---|
|
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:test="urn:test">
<sm:container id="jbi" embedded="true">
<sm:components>
<http:component>
<http:configuration>
...
</http:configuration>
</http:component>
</sm:components>
<sm:endpoints>
<http:endpoint
service="test:Hello"
endpoint="testService"
role="consumer"
defaultOperation="echo"
locationURI="http://localhost:8194/Service/"
soap="true" />
</sm:endpoints>
</sm:container>
|
ServiceMix will automatically choose the configured component for all supported endpoints. If you want to define several components with different configurations and choose which component an endpoint should be deployed onto, you need to explicitely name the components and link the endpoints:
Code Block |
---|
lang | xml |
---|
title | Several components |
---|
|
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:test="urn:test">
<sm:container id="jbi" embedded="true">
<sm:components>
<http:component name="http1">
...
</http:component>
<http:component name="http2">
...
</http:component>
</sm:components>
<sm:endpoints>
<http:endpoint component="http1" ... />
<http:endpoint component="http2" ... />
</sm:endpoints>
</sm:container>
|