我正在使用Mac 10.7.4上的WSO2 ESB 4.0.3。
我正在尝试在axis2.xml中设置2个HTTP传输列表器,如下所示
<transportReceiver name="http-default" class="org.wso2.carbon.core.transports.http.HttpTransportListener">
<!--
Uncomment the following if you are deploying this within an application server. You
need to specify the HTTP port of the application server
-->
<parameter name="port">8580</parameter>
<!--
Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 80
in this case.
-->
<!--<parameter name="proxyPort">80</parameter>-->
</transportReceiver>
<transportReceiver name="http-default" class="org.wso2.carbon.core.transports.http.HttpsTransportListener">
<!--
Uncomment the following if you are deploying this within an application server. You
need to specify the HTTPS port of the application server
-->
<parameter name="port">8543</parameter>
<!--
Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 443
in this case.
-->
<!--<parameter name="proxyPort">443</parameter>-->
</transportReceiver>
<transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
<parameter name="port" locked="false">8280</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
<!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
<!--<parameter name="priorityConfigFile" locked="false">location of priority configuration file</parameter>-->
</transportReceiver>
<!-- the non blocking https transport based on HttpCore + SSL-NIO extensions -->
<transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
<parameter name="port" locked="false">8243</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
<!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
<!--<parameter name="priorityConfigFile" locked="false">location of priority configuration file</parameter>-->
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
<parameter name="keystore" locked="false">
<KeyStore>
<Location>repository/resources/security/wso2carbon.jks</Location>
<Type>JKS</Type>
<Password>wso2carbon</Password>
<KeyPassword>wso2carbon</KeyPassword>
</KeyStore>
</parameter>
<parameter name="truststore" locked="false">
<TrustStore>
<Location>repository/resources/security/client-truststore.jks</Location>
<Type>JKS</Type>
<Password>wso2carbon</Password>
</TrustStore>
</parameter>
<!--<parameter name="SSLVerifyClient">require</parameter>
supports optional|require or defaults to none -->
</transportReceiver>
我也配置了对应的发件人。
问题是,是否可以在axis2.xml中定义2个HTTP传输接收器?
当我尝试启动ESB时,它不允许我定义2个HTTP传输接收器。我想将NIO传输接收器用于某些服务,并将默认HTTP传输接收器用于其他服务。这是因为部署在WSO2 ESB中的某些服务使用由某些其他进程设置的Cookie对目录服务进行身份验证。 Cookie位于HTTPServletRequest对象中,只有在我不使用NIO传输并使用默认HTTP传输接收器时才可用。
请帮忙。 谢谢 作者Abhijit
答案 0 :(得分:1)
您应该能够在ESB中定义两个传输接收器,您需要为传输提供不同的名称(例如http1,http2)。有关所有代理服务的示例,您应该能够使用可用的9763 http端口。
但是,定义两个传输发件人时存在问题。您可以定义两个传输发件人,如http1和http2。但是在给出http位置时会出现问题。例如,我们axis2使用url推断传输。所以当我们说http://然后它将发送者作为http。由于此协议名称已明确定义,因此当您使用非标准名称时,它无法选择传输发件人。