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 Ordered Delivery of Client Messages

To test ordered delivery of the client messages, register SerializingRTMPEndpoint with services-config.xml (Example 5-35).

Example 5-35. Channel definition to test ordered delivery of client messages

<channel-definition id="my-serializing-server-rtmp"
   class="mx.messaging.channels.RTMPChannel">
   <endpoint uri="rtmp://{server.name}:2043"
      class="com.farata.messaging.endpoints.SerializingRTMPEndpoint"
<properties>
          <idle-timeout-minutes>20</idle-timeout-minutes>
      </properties>
</channel-definition>

Then add the destination clientServiceTest to messaging-config.xml (Example 5-36).

Example 5-36. Messaging destination to test ordered delivery of client messages

<destination id="clientSequenceTest">
      <adapter ref="actionscript"/>
   <channels>
        <channel ref="my-serializing-server-rtmp" />
   </channels>
</destination>

The code of the testing application TestClientSequence is presented in Example 5-37.

The test application sends messages in random order, which is reflected in the Sent bar (Figure 5-13). The application is subscribed to MessageAckEvent and displays arrived messages in the Acknowledged bar with circles.

Notice that all messages came acknowledged in the right order, thanks to the housekeeping done by the SerializingEndpoint. In Example 5-37, you can also browse the server log produced by this custom endpoint during the specific test run.

Running the TestClientSequence application

Figure 5-13. Running ...

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