Wednesday, October 7, 2009

AIR amf Channel Remote Blazeds Testing

I normally test my flex client against blazeds on a locally running tomcat server.

However, the network calls are so fast, you don't get a real sense of how the application will perform in the real world. Ideally i'd like to test a locally running flex/air client against my remote server.

Finally, I found a setting in the beans.xml class that will control it! There are more advanced ways of doing this than hardcoding, which are mentioned here http://coenraets.org/blog/2009/03/externalizing-service-configuration-using-blazeds-and-lcds/

But the simple way, and a good way for flex or air is to change this (beans.xml):
<DynamicChannelSet id="myAmfChannel">

<serverPort>8080</serverPort>

<contextRoot>/SalesRocket</contextRoot>

</DynamicChannelSet>

To this:
<mx:ChannelSet id="myAmfChannel">

<mx:AMFChannel id="amf"url="http://incentto.com:8080/IncenttoPROD/messagebroker/amf"/>

</mx:ChannelSet>