[rabbitmq-discuss] Unable to connect Flex with RabbitMQ

Pete Kay petedao at gmail.com
Fri Aug 29 00:20:29 BST 2008


Hi Ben,

Thank you very much for your kind help.  Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute" styleName="plain"  creationComplete="init()">
  <mx:Script>
        <![CDATA[
     import org.amqp.patterns.impl.SubscribeClientImpl;
        import org.amqp.patterns.SubscribeClient;
       import org.amqp.Connection;
      import org.amqp.ConnectionState;
     import org.amqp.patterns.CorrelatedMessageEvent;
  import org.amqp.ProtocolEvent;
     import org.amqp.Session;
     import org.amqp.SessionManager;
        import org.amqp.impl.SessionStateHandler;
        private var subClient:SubscribeClientImpl;
        protected var connection:Connection;

   private var serializer:JSONSerializer = new JSONSerializer();
        public function init():void {
   trace("test sub init");
            connection = new Connection(buildConnectionState());
            subClient = new SubscribeClientImpl(connection);
   subClient.serializer = serializer;
//   subClient.realm = "/data";
   subClient.exchange = "gamex";
   subClient.exchangeType = "topic";
   //sub.subscribe(...);
        }
    public function buildConnectionState():ConnectionState {
            var state:ConnectionState = new ConnectionState();
            state.username = "guest";
            state.password = "guest";
            state.vhostpath = "/";
            state.serverhost = "192.168.1.104";
            return state;
        }

        public function onMessageArrive(event:CorrelatedMessageEvent):void {
            var o:* = event.result;
        }
     ]]>
    </mx:Script>
</mx:Application>



Best Regards,
Anne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080829/a83bfe48/attachment.htm 


More information about the rabbitmq-discuss mailing list