0
我的需求是在mule上發佈兩個具有相同路徑但服務不同的服務。像這樣如何在Mule上發佈兩個具有相同路徑但不同網址的服務3.2
https://localhost:8443/etc/app/version1/Service
https://localhost:8443/etc/app/version2/Service
進出口使用上的web.xml servlet映射
<servlet-mapping>
<servlet-name>muleServlet</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
並試圖用兩種不同的連接器,因爲路徑屬性不允許我使用「VERSION1 /服務」或「版本2 /服務」
<servlet:connector
name="conectorVersion1"
servletUrl="https://localhost:8443/etc/app/version1/">
</servlet:connector>
<servlet:connector
name="conectorVersion2"
servletUrl="https://localhost:8443/etc/app/version2/">
</servlet:connector>
最後,端點
<flow
name="FlowVersion1"
processingStrategy="synchronous">
<servlet:inbound-endpoint
connector-ref="conectorVersion1"
path="Service">
<-- processors, jaxws-service, interceptors etc.. -->
</servlet:inbound-endpoint>
</flow>
<flow
name="FlowVersion2"
processingStrategy="synchronous">
<servlet:inbound-endpoint
connector-ref="conectorVersion2"
path="Service">
<-- processors, jaxws-service, interceptors etc.. -->
</servlet:inbound-endpoint>
</flow>
但我得到這個異常:
[[/etc]] StandardWrapper.Throwable: java.lang.IllegalStateException:
There are at least 2 connectors matching protocol "servlet", so the connector to use must be
specified on the endpoint using the 'connector' property/attribute.
Connectors in your configuration that support "servlet" are: conectorVersion1, conectorVersion2,
在此先感謝。
謝謝大衛,我已經發現了這一點,它的工作,我即將發佈我的awnser,但現在我只接受你的。我只是對某些事情感到好奇:你知道爲什麼包含下劃線的路徑只能用斜線作爲第一個字符嗎?比如不起作用,但是這個工作正常 –
jonfornari
2013-02-08 18:27:27
對我來說這看起來像一個bug:在幕後Mule將端點表示爲URI,並且似乎將'servlet:// service_v1_01_01/Hello'和'servlet:// service_v2_01_01/Hello'視爲衝突,而'servlet:/// service_v1_01_01/Hello'和'servlet:/// service_v2_01_01 /你好'不...打開JIRA:D – 2013-02-08 18:53:42
它是:http://www.mulesoft.org/jira/browse/MULE-6638再次感謝大衛。 – jonfornari 2013-02-08 19:47:08