[rabbitmq-discuss] RabbitMQ Flex subscriber

Ben Hood 0x6e6562 at gmail.com
Wed Aug 27 13:25:22 BST 2008


Pete,

On Wed, Aug 27, 2008 at 9:09 AM, Pete Kay <petedao at gmail.com> wrote:
> Hi Ben,
>
> I simplified my code significantly by using SubscribeClient class.  Thanks
> for the great help.
>
> However, I am still getting "Calling handleForcedShutdown from connection
> forceClose called".
>
> Here is the code I am using.  By the way, I am assuming the first argument
> for .subscribe() refers to the routing key.
>
>         public function init():void {
>    trace("test sub init");
>             connection = new Connection(buildConnectionState());
>     subClient = new SubscribeClientImpl(connection);
>     //         subClient.serializer = serializer;
>             subClient.exchange = "";
>             subClient.exchangeType = "topic";
>          subClient.subscribe("SimpleQueue", onMessageArrive);
>             subClient.subscribe("SimpleQueue", 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
> {
>                trace("Consumed message from ABC");
>                var o:* = event.result;
>               trace("message = " + o.msg);
>          }

This looks like an adaptation of the PublishSubscribeClientTest. Have
you run that test out of the box?

HTH,

Ben




More information about the rabbitmq-discuss mailing list