<div dir="ltr"><br>
<div class="gmail_quote">
<div dir="ltr">
<div>Hi Ben,</div>
<div> </div>
<div>Thanks alot for helping me.</div>
<div> </div>
<div>If I use the Java Client to connect to RabbitMQ on the same computer (Win XP) or on another computer(Linux), it works. However, my Flex client does not work for RabbitMQ on localhost or on another computer within the same LAN. Here is the exact code that I am running my test on. I debugged the Connection class, but I don't see anything wrong with it.</div>
<div> </div>
<div>
<div class="Ih2E3d"><?xml version="1.0" encoding="utf-8"?><br><mx:Application xmlns:mx="<a href="http://www.adobe.com/2006/mxml" target="_blank">http://www.adobe.com/2006/mxml</a>" <br>
layout="absolute" styleName="plain" creationComplete="init()"><br> <mx:Script><br> <![CDATA[<br> import org.amqp.patterns.impl.SubscribeClientImpl;<br> import org.amqp.patterns.SubscribeClient;<br>
import org.amqp.Connection;<br> import org.amqp.ConnectionState;<br> import org.amqp.patterns.CorrelatedMessageEvent;<br> import org.amqp.ProtocolEvent;<br> import org.amqp.Session;<br> import org.amqp.SessionManager;<br>
import org.amqp.impl.SessionStateHandler;<br></div> import org.amqp.test.JSONSerializer;
<div class="Ih2E3d"><br> private var subClient:SubscribeClientImpl;<br> protected var connection:Connection;<br> <br> private var serializer:JSONSerializer = new JSONSerializer();<br> public function init():void {<br>
trace("test sub init");<br> connection = new Connection(buildConnectionState());<br> subClient = new SubscribeClientImpl(connection);<br> subClient.serializer = serializer;<br>// subClient.realm = "/data";<br>
subClient.exchange = "gamex";<br> subClient.exchangeType = "topic";<br></div> subClient.subscribe("SimpleQueue",onMessageArrive);
<div class="Ih2E3d"><br> }<br> public function buildConnectionState():ConnectionState {<br> var state:ConnectionState = new ConnectionState();<br> state.username = "guest";<br> state.password = "guest";<br>
state.vhostpath = "/";<br></div> state.serverhost = "<a href="http://127.0.0.1/" target="_blank">127.0.0.1</a>";
<div class="Ih2E3d"><br> return state;<br> }<br> <br> public function onMessageArrive(event:CorrelatedMessageEvent):void {<br> var o:* = event.result;<br> }<br> ]]><br>
</mx:Script><br></mx:Application></div></div></div></div><br></div>