我一直在尝试找到正确的配置来支持 Flex 应用程序中的两个 http/s 请求。我已经阅读了所有的文档,他们提到做如下的事情:
<default-channels>
<channel ref="my-secure-amf">
<serialization>
<log-property-errors>true</log-property-errors>
</serialization>
</channel>
<channel ref="my-amf">
<serialization>
<log-property-errors>true</log-property-errors>
</serialization>
</channel>
这在通过 https 访问应用程序时效果很好,但在通过 http 访问同一应用程序时会出现间歇性通信失败。这是一个缩写的 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>
<!-- HTTPS requests don't work on IE when pragma "no-cache" headers are set so you need to set the add-no-cache-headers property to false -->
<add-no-cache-headers>false</add-no-cache-headers>
<!-- Use to limit the client channel's connect attempt to the specified time interval. -->
<connect-timeout-seconds>10</connect-timeout-seconds>
</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"/>-->
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
<connect-timeout-seconds>10</connect-timeout-seconds>
</properties>
</channel-definition>
我正在使用 Tomcat 5.5.17 和 Java 5 运行。
- BlazeDS 文档说这是最佳实践。有没有更好的办法?
- 使用此配置,默认通道元素中定义的每个通道似乎有 2-3 次重试,因此在 my-amf 通道通过 http 请求连接之前总是需要大约 20 秒。有没有办法覆盖 2-3 次重试,比如每个频道重试 1 次?
提前感谢您的回答。