I am using BlazeDS for data-push feature in my Flex application project. From the official tutorial, Getting started with BlazeDS, it shows messaging example with producer/c
If you want to set the url to the stream at runtime do the following:
//assumes _consumer is an instance variable mx.messaging.Consumer
var channelSet:ChannelSet = new ChannelSet();
//change {server.name}:{server.port} to the end point you wanna hit
var ep:String = "http://{server.name}:{server.port}/messagebroker/streamingamf";
var channel:StreamingAMFChannel = new StreamingAMFChannel("my-streaming-amf", ep);
channelSet.addChannel(channel);
_consumer = new Consumer();
_consumer.channelSet = channelSet;
_consumer.destination = "TestServiceAdapterDestination";
_consumer.subscribe();
_consumer.addEventListener(MessageEvent.MESSAGE, onMsg);
_consumer.addEventListener(MessageFaultEvent.FAULT, faultHandler);
Just a heads up. This took some head banging to get going. I hope it helps someone.