<div dir="ltr"><br>
<div class="gmail_quote">
<div dir="ltr">
<div>Hi Ben,</div>
<div>&nbsp;</div>
<div>Thanks alot for helping me.</div>
<div>&nbsp;</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.&nbsp; However, my Flex client does not work for RabbitMQ on localhost or on another computer within the same LAN.&nbsp; Here is the exact code that I am running my test on.&nbsp; I debugged the Connection class, but I don&#39;t see anything wrong with it.</div>

<div>&nbsp;</div>
<div>
<div class="Ih2E3d">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;mx:Application xmlns:mx=&quot;<a href="http://www.adobe.com/2006/mxml" target="_blank">http://www.adobe.com/2006/mxml</a>&quot; <br>
&nbsp;&nbsp;&nbsp; layout=&quot;absolute&quot; styleName=&quot;plain&quot;&nbsp; creationComplete=&quot;init()&quot;&gt;<br>&nbsp; &lt;mx:Script&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[<br>&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.patterns.impl.SubscribeClientImpl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.patterns.SubscribeClient;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.Connection;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.ConnectionState;<br>&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.patterns.CorrelatedMessageEvent;<br>&nbsp; &nbsp;&nbsp;import org.amqp.ProtocolEvent;<br>&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.Session;<br>&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.SessionManager;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.impl.SessionStateHandler;<br></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; import org.amqp.test.JSONSerializer; 
<div class="Ih2E3d"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private var subClient:SubscribeClientImpl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected var connection:Connection;<br>&nbsp;<br>&nbsp;&nbsp; private var serializer:JSONSerializer = new JSONSerializer();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public function init():void {<br>
&nbsp;&nbsp; trace(&quot;test sub init&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connection = new Connection(buildConnectionState());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subClient = new SubscribeClientImpl(connection);<br>&nbsp;&nbsp; subClient.serializer = serializer;<br>//&nbsp;&nbsp; subClient.realm = &quot;/data&quot;;<br>
&nbsp;&nbsp; subClient.exchange = &quot;gamex&quot;;<br>&nbsp;&nbsp; subClient.exchangeType = &quot;topic&quot;;<br></div>&nbsp;&nbsp; subClient.subscribe(&quot;SimpleQueue&quot;,onMessageArrive); 
<div class="Ih2E3d"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; public function buildConnectionState():ConnectionState {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var state:ConnectionState = new ConnectionState();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; state.username = &quot;guest&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; state.password = &quot;guest&quot;;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; state.vhostpath = &quot;/&quot;;<br></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; state.serverhost = &quot;<a href="http://127.0.0.1/" target="_blank">127.0.0.1</a>&quot;; 
<div class="Ih2E3d"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return state;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public function onMessageArrive(event:CorrelatedMessageEvent):void {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var o:* = event.result;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; ]]&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/mx:Script&gt;<br>&lt;/mx:Application&gt;</div></div></div></div><br></div>