O'Reilly logo

Agile Enterprise Application Development with Flex by Tony Hillerson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing Guaranteed Delivery

All the pieces are ready to guarantee that every ReliableServerMessage will get delivered to the client. Before testing it, however, specify the acknowledging channel in services-config.xml with the code in Example 5-14.

Example 5-14. Registering custom AcknowledgingChannel

<channel-definition id="my-acknowledging-client-rtmp"
   class="com.farata.messaging.channels.AcknowledgingRTMPChannel">
      <endpoint uri="rtmp://{server.name}:2040"
      class="flex.messaging.endpoints.RTMPEndpoint"/>
           <properties>
                <idle-timeout-minutes>20</idle-timeout-minutes>
           </properties>
</channel-definition>

In messaging-config.xml, we direct the custom QoSAdapter to intercept messages coming both to clientHeartbeat and serverDeliveryTest destinations (Example 5-15).

Example 5-15. Configuring destinations for the No Server Message Left Behind test

<?xml version="1.0" encoding="UTF-8"?> <service id="message-service" class="flex.messaging.services.MessageService"> <adapters> <adapter-definition id="actionscript" default="true" class="flex.messaging.services.messaging.adapters. ActionScriptAdapter"/> <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters. JMSAdapter"/> <adapter-definition id="qos" class="com.farata.messaging.adapter.QoSAdapter"/> </adapters> <default-channels> <channel ref="my-rtmp" /> </default-channels> <destination id="clientHeartbeat"> <adapter ref="qos"/> <channels> <channel ref="my-rtmp" /> </channels> </destination> <destination id="serverDeliveryTest"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required