0x6e6562 / as3-amqp

This is an implementation of the 0-8 version of AMQP for AS3.
Other
42 stars 9 forks source link

Using fanout exchanges #2

Open ducky427 opened 14 years ago

ducky427 commented 14 years ago

Hi, I am trying to use SubscribeClientImpl with a fanout exchange without much success. Here is some of my code:

    var connection:Connection = new Connection(buildConnectionParams());
    var serializer:JSONSerializer = new JSONSerializer()

    var subClient:SubscribeClientImpl = new SubscribeClientImpl(connection);
    subClient.serializer = serializer;
    subClient.exchange = "multicast";
    subClient.exchangeType = "fanout";
    subClient.subscribe("routing_key", onConsume);

Now the subClient.subscribe method takes the routing key and the method to be called as inputs. The routing key is immaterial for exchanges of type fanout. More here.

Digging deeper into the code, I found that onDeliver method of SubscribeClientImpl is being called. I can see that there is a trace method in that method on line 123 which is being printed in debug mode. But this line (line 126) is not working properly:

    var topic:String = matchTopic(properties.correlationid || method.routingkey);

Any help would be appreciated. I apologize if I overlooked anything. I am pretty new to AMQP.

cheers, ducky