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"
   <endpoint uri="rtmp://{server.name}:2043"

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"/>
        <channel ref="my-serializing-server-rtmp" />

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

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.