【发布时间】:2016-02-11 06:52:03
【问题描述】:
我使用 flex 3.0 在我的应用程序中开发了仪表板。为此,我在 flex 应用程序周围使用了 JSP 包装器。我的应用程序在 JBoss 应用程序服务器上运行。对于 flex 应用程序和我的应用程序之间的通信,我正在使用 LCDS。 HTTPService 组件用于从服务器接收数据。在 service-config.xml 中为 amf 和 http 通道以及安全模式和非安全模式提供了频道定义。在我的 proxy-config.xml 中,我定义了通道和目的地。
services-config.xml
...
...
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
<channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
</channel-definition>
<channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
...
...
proxy-config.xml
...
...
<default-channels>
<channel ref="my-http"/>
<channel ref="my-amf"/>
<channel ref="my-secure-http"/>
<channel ref="my-secure-amf"/>
</default-channels>
...
...
<destination id="dashboardService">
<properties>
<url>/kr/servlet/DashboardServlet</url>
</properties>
</destination>
<destination id="dashboardJSPService">
<properties>
<url>/kr/krportal/dashboardJSPService.jsf</url>
</properties>
</destination>
...
...
在我的开发环境中,安全模式和非安全模式都可以正常工作。现在,当我将它部署在负载均衡器后面时(它只接受安全请求,如果请求不安全,它会将其重定向到安全 url),消息代理 servlet 没有响应。我观察到的另一件事是,当环境非负载平衡时,会有像'http://{server.name}:{server.port}/{context.root}/messagebroker/http'. 这样的请求,这些请求是发布请求。但是在使用 ssl 的负载平衡环境中,请求再次类似于 'http://{server.name}:{server.port}/{context.root}/messagebroker/http',这是一个发布请求,它被重定向到 'https://{server.name}:{server.port}/{context.root}/messagebroker/http',这是一个获取请求。本次get请求返回的内容为null。
寻找一些cmets
谢谢
【问题讨论】:
标签: java apache-flex ssl https load-balancing