79.11. 대상 구성 및 Spring으로 연속
79.11.1. 네임스페이스 링크 복사링크가 클립보드에 복사되었습니다!
Camel 전송 끝점을 구성하는 데 사용되는 요소는 네임스페이스 http://cxf.apache.org/transports/camel 에 정의되어 있습니다. 일반적으로 접두사 camel 을 사용합니다. Camel 전송 구성 요소를 사용하려면 아래에 표시된 행을 엔드포인트 구성 파일의 빈 요소에 추가해야 합니다. 또한 구성 요소의 네임스페이스를 xsi:schemaLocation 속성에 추가해야 합니다.
구성 네임스페이스 추가
<beans ...
xmlns:camel="http://cxf.apache.org/transports/camel
...
xsi:schemaLocation="...
http://cxf.apache.org/transports/camel
http://cxf.apache.org/transports/camel.xsd
...>
79.11.2. 대상 요소 링크 복사링크가 클립보드에 복사되었습니다!
camel:destination 요소와 해당 하위 요소를 사용하여 Camel 전송 서버 엔드포인트를 구성합니다. camel:destination 요소는 엔드포인트에 해당하는 WSDL 포트 요소를 지정하는 단일 속성 name 을 사용합니다. name 속성 값은 portQName'.camel-destination' 형식을 사용합니다. 아래 예제에서는 끝점의 대상 네임스페이스가 http://widgets.widgetvendor.net 인 경우 WSDL 조각 < port binding="widgetSOAPBinding" name="widgetSOAPPort" >에 의해 지정된 끝점에 대한 구성을 추가하는 데 사용되는 camel:destination 요소를 보여줍니다.
Camel:destination Element
...
<camel:destination name="{http://widgets/widgetvendor.net}widgetSOAPPort.http-destination>
<camelContext id="context" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="direct:EndpointC" />
<to uri="direct:EndpointD" />
</route>
</camelContext>
</camel:destination>
<!-- new added feature since Camel 2.11.x
<camel:destination name="{http://widgets/widgetvendor.net}widgetSOAPPort.camel-destination" camelContextId="context" />
...
Spring의 camel:destination 요소에는 구성 정보를 지정하는 여러 자식 요소가 있습니다. 아래에 설명되어 있습니다.
element
설명
camel-spring:camelContext
camel 대상에서 camel 컨텍스트를 지정할 수 있습니다.
camel:camelContextRef
camel 대상에 삽입할 camel 컨텍스트 ID
79.11.3. Conduit 요소 링크 복사링크가 클립보드에 복사되었습니다!
camel:conduit 요소와 해당 하위 요소를 사용하여 Camel 전송 클라이언트를 구성합니다. camel:conduit 요소는 엔드포인트에 해당하는 WSDL 포트 요소를 지정하는 단일 속성 name 을 사용합니다. name 속성 값은 portQName'.camel-conduit' 형식을 사용합니다. 예를 들어, 아래 코드는 끝점의 대상 네임스페이스가 http://widgets.widgetvendor.net 인 경우 WSDL 조각 < port binding="widgetSOAPBinding" name="widgetSOAPPort" >에서 지정한 끝점에 대한 구성을 추가하는 데 사용되는 camel:conduit 요소를 보여줍니다.
HTTP-conf:conduit Element
...
<camelContext id="conduit_context" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="direct:EndpointA" />
<to uri="direct:EndpointB" />
</route>
</camelContext>
<camel:conduit name="{http://widgets/widgetvendor.net}widgetSOAPPort.camel-conduit">
<camel:camelContextRef>conduit_context</camel:camelContextRef>
</camel:conduit>
<!-- new added feature since Camel 2.11.x
<camel:conduit name="{http://widgets/widgetvendor.net}widgetSOAPPort.camel-conduit" camelContextId="conduit_context" />
<camel:conduit name="*.camel-conduit">
<!-- you can also using the wild card to specify the camel-conduit that you want to configure -->
...
</camel:conduit>
...
camel:conduit 요소에는 구성 정보를 지정하는 여러 자식 요소가 있습니다. 아래에 설명되어 있습니다.
element
설명
camel-spring:camelContext
camel conduit에서 camel 컨텍스트를 지정할 수 있습니다.
camel:camelContextRef
camel conduit에 삽입하려는 camel 컨텍스트 ID