mxriverlynn / rabbus

A micro-service bus with built-in messaging patterns, for NodeJS and RabbitMQ
116 stars 26 forks source link

Req/Res with alternate #9

Closed BLaurent closed 9 years ago

BLaurent commented 9 years ago

Hi, Is there a way to declare a request/response with an alternate.

The requester will be :

    Rabbus.Requester.call(this, rabbus, {
        exchange: {
            name: ex,
            alternate: aex,
            autoDelete: true
        },
        routingKey: topic,
        messageType: type
    });

And responder will be

    Rabbus.Responder.call(this, rabbus, {
        exchange: {
            name: ex,
            //alternate: aex, This is needed
            autoDelete: true
        },
        queue: {
            name: queue,
            limit: 1,
            noBatch: true,
            autoDelete: true
        },
        routingKey: topic,
        messageType: type
    });

But If I enable the aex in the responder will have message form both ex and aex. On the other hand I cannot have the aex disabled as the responder will try to create it. And as exchange build params are != it this will trigger an exception. How can I solve this ?

Regards Ben

BLaurent commented 9 years ago

I find a way of doing this, there is no issues.