任何人都可以幫助我使用Apache FUSE ESB配置具有相同基本URI的兩個JAX-RS服務嗎?我正在使用JBoss FUSE 6.0版本的karaf容器,Apache Camel和CXF(JAX-RS)。配置使用Blueprint完成。當我只配置一個JAX-RS服務時,一切正常。具有一個Jetty端點的多個JAXRS Bean
我想服務兩個基礎URI爲http://localhost:9001/rs
的JAX-RS Bean。第一個bean爲http://localhost:9001/rs/rest1
,第二個爲http://locahost:9001/rs/rest2
。
我用jetty端點定義了兩個駝峯上下文。我想我需要兩個只使用一個配置的實例,但不知道如何做到這一點。
這裏是我的駱駝上下文:
<camel:camelContext id="context1">
<camel:endpoint id="ep1" uri="jetty:http://localhost:9001/rs/?matchOnUriPrefix=true"/>
<camel:route autoStartup="true">
<camel:from uri="ep1"/>
<camel:to uri="cxfbean:restBean1"/>
<camel:log message="Message received after REST Processor. "/>
<camel:convertBodyTo type="java.lang.String"/>
<camel:to uri="log:loggingCategory?level=INFO"/>
</camel:route>
</camel:camelContext>
<camel:camelContext id="context2">
<camel:endpoint id="ep2" uri="jetty:http://localhost:9001/rs/?matchOnUriPrefix=true"/>
<camel:route autoStartup="true">
<camel:from uri="ep2"/>
<camel:to uri="cxfbean:restBean2"/>
<camel:log message="Message received after REST Processor. "/>
<camel:convertBodyTo type="java.lang.String"/>
<camel:to uri="log:loggingCategory?level=INFO"/>
</camel:route>
</camel:camelContext>
兩個bean注入作爲服務引用,當我發表意見的途徑之一一切正常。
任何建議如何配置這在駱駝?
乾杯, 奧利弗
嗨。我認爲解決這個問題的方法是將兩個Endpoint與bean的路徑包含在一起,並將Bean路徑設置爲「/」。這適用於我的設置。 – Odo