Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle messages in "ready" state on reconnect #43

Closed
nover opened this issue Feb 20, 2015 · 1 comment
Closed

Handle messages in "ready" state on reconnect #43

nover opened this issue Feb 20, 2015 · 1 comment

Comments

@nover
Copy link

nover commented Feb 20, 2015

I'm experiencing trouble with processing items that are "ready" in the rabbitmq queue, when my worker reconnects, is this expected behavior or a bug? A bit more detailed:

I'm currently testing wascally out where i have a "producer" that puts an amount of messages onto the queues, and then the worker will be started later, however, the worker does not process the "ready messages". The one thing I have noticed is that all the "ready" messages goes into "unacked" state on the queue, however, I see no messages being processed in the worker node.

The only way to make it work, is to publish a message while the worker is connected.

Topology json:

var config = {
    connection: {},
    queues: [
        {name: "queue1", subscribe: true, durable: true}
    ],
    exchanges: [{name: "my-exchange", type: 'direct', persistent: true, durable: true}],
    bindings: [
        {exchange: "my-exchange", target: "queue1Handler", keys: ["queue1Handler"]}
    ]
};

And the handler (simplified):

Rabbit.configure(Que.Config)
    .then(setUpRabbitHandlers);
function setUpRabbitHandlers() {
    console.info('Setting up rabbit handlers...');
    Rabbit.handle("queue1", function (msg) {
        console.info('Starting processing of message...');
        // do stuff 
        msg.ack();
    });

On OSX 10.10.2 with node v0.10.33 and RabbitMQ 3.4.2

@nover
Copy link
Author

nover commented Feb 20, 2015

I just updated via npm to the latest wascally version 0.2.2 and now it seems to work properly, sorry for not testing this first!

@nover nover closed this as completed Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant