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"> ...

Get Agile Enterprise Application Development with Flex now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.