You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const Consumer = require('sqs-consumer');
const app = Consumer.create({
queueUrl: config.aws.delta.queueUrl,
handleMessage: (message, done) => {
logger.debug(message);
processor.process(message).then((result) => {
logger.trace(`Message processed.`);
done();
}).catch((err) => {
logger.error("Failed to handle message", message);
// uncomment next line to get it to work without bailing
//done();
});
}
});
...
app.start();
If I uncomment done() then it will work. But I often want the message to stay on the queue -- maybe I couldn't connect to the database momentarily and that's why it failed. As the code is, if I hit that .catch and don't call done() the process mysteriously exits, even if I have an uncaughtException/unhandledRejection listener on the process.
"sqs-consumer": "^3.6.1",
Node 6
The text was updated successfully, but these errors were encountered:
If I uncomment
done()
then it will work. But I often want the message to stay on the queue -- maybe I couldn't connect to the database momentarily and that's why it failed. As the code is, if I hit that.catch
and don't calldone()
the process mysteriously exits, even if I have an uncaughtException/unhandledRejection listener on the process."sqs-consumer": "^3.6.1",
Node 6
The text was updated successfully, but these errors were encountered: