0x6e6562 / as3-amqp

This is an implementation of the 0-8 version of AMQP for AS3.
Other
42 stars 9 forks source link

I'm new to amqp,can I use it like this? #3

Open shapache opened 10 years ago

shapache commented 10 years ago

I'm new to amqp,I want connect flex to rabbitmq, and get get information from rabbitmq. I write code like this, but it donot work. Is this right? help me please

protected function application1_creationCompleteHandler(event:FlexEvent):void
        {
            var param:ConnectionParameters=new ConnectionParameters();
            param.username="guest";
            param.password="guest";
            param.serverhost="192.168.30.1";
            param.serverport=8080;
            param.vhostpath="/";

            this.amqpConnection=new Connection(param);

            var myClient:SubscribeClientImpl=new SubscribeClientImpl(this.amqpConnection);
            myClient.serializer=this.serializer;
            myClient.exchange="fanOutExchange";
            myClient.exchangeType="fanout";

            myClient.subscribe("QUEUE4TU", onConsumeAmqpMessage);
        }

        private function onConsumeAmqpMessage(event:CorrelatedMessageEvent):void
        {
            var lMessage:String=event.result;
            trace(lMessage);
        }