[rabbitmq-discuss] Unable to connect Flex with RabbitMQ

Pete Kay petedao at gmail.com
Fri Aug 29 01:46:22 BST 2008


Hi Ben,

I commented it out just to see if it could run without the forceClose error,
but I still get that error even after I commenting out that line.   I tried
the following, that the subscribe line back on, but it still does not work
for me.
<?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";
            subClient.subscribe("utest.topic-abc", onMessageArrive);
        }
    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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080829/0a9b583d/attachment.htm 


More information about the rabbitmq-discuss mailing list