1]Create Flex application
Ex: main.mxml
2]Create Externalizing Service Configuration using BlazeDS or LCDS
Ex:As like a Remote Object
3]Set global variable for each of channel sets:
private var messagingChannelSet:ChannelSet;
private var remotingChannelSet:ChannelSet;
4]MXML file setup remote object and my consumer/producer
5]In init() setup channels, add them to the channelset and then setup consumer and producer:
remotingChannelSet = new ChannelSet();
var rChannel:AMFChannel = new AMFChannel(“my- cfamf”, “http://localhost/flex2gateway”);
remotingChannelSet.addChannel(rChannel);
cfsvc.channelSet = remotingChannelSet;
messagingChannelSet = new ChannelSet();
var mChannel:AMFChannel = new AMFChannel(“cf-longpolling-amf”, “http://localhost/flex2gateway/amflongpolling”);
messagingChannelSet.addChannel(mChannel);
chatConsumer.channelSet = messagingChannelSet;
chatProducer.channelSet = messagingChannelSet;
chatConsumer.subtopic = instanceID + “.CHAT”;
chatConsumer.subscribe();
5]Now Run the Server