消息订阅: java程序:
public static void sendMsg(String destination,Object body){
AsyncMessage msg = new AsyncMessage();
msg.setDestination(destination);
msg.setClientId(clientId);
msg.setMessageId(UUIDUtils.createUUID());
msg.setTimestamp(System.currentTimeMillis());
msg.setBody(body);
msgBroker.routeMessageToService(msg, null);
}
flex端程序
private function realInit(){
consumer.subscribe();
}
<mx:AMFChannel id="polling_amf" url="../messagebroker/amfpolling" />
<mx:ChannelSet id="polling_channel" channels="{[polling_amf]}" />
<mx:Consumer id="consumer" channelSet="{polling_channel}" destination="market-data-feed" message="messageHandler(event)" fault="messageFault(event)" />
加入黑体字部分就可以找到通道了,:)