Comments (5)
A new release (v1.0.22) is out.
from redis-smq.
Thank you for reporting this issue!
The cause of this bug has been identified (as being related to GC) and fixed.
A new release containing this hot-fix will be published today ASAP.
from redis-smq.
Thanks for the quick response, but issue still exists with commit 64087f1
from redis-smq.
I believe that the issue has been fixed.
I made a little script just to make sure that everything works as expected:
'use strict';
const { Consumer, Producer } = require('redis-smq');
function getConsumer(queueName, crashOnConsume = false) {
const InstanceClass = class extends Consumer {
consume(message, cb) {
if (crashOnConsume) {
console.log(`Got message: ${JSON.stringify(message)}, queue: ${this.constructor.queueName}. Simulating crash...`);
console.log(`Please wait for another consumer to recover from this failure. It would take some time...`);
this.stop();
} else {
console.log(`Got message ${JSON.stringify(message)} from Queue ${this.constructor.queueName}. Acknowledging...`);
cb();
}
}
};
InstanceClass.queueName = queueName;
return new InstanceClass();
}
function getProducer(queueName) {
return new Producer(queueName);
}
// This creates a consumer which acknowledges all received messages on queue 'queue_b'
const consumerQueueB = getConsumer('queue_b');
consumerQueueB.run();
// Produce a message on queue 'queue_b'
const producerQueueB = getProducer('queue_b');
producerQueueB.produce({ id: 'b', hello: 'world' }, (err) => {
if (err) {
throw err;
}
});
// This creates a consumer which "crashes" once a message is received
const consumer1QueueA = getConsumer('queue_a', true);
/**
* Start an other consumer instance on queue 'queue_a'
* just after the first consumer1QueueA crashed...
*
* Here we just listen to the 'halt' event which get emitted once consumer1QueueA goes down.
*/
consumer1QueueA.on('halt', () => {
const consumer2QueueA = getConsumer('queue_a');
consumer2QueueA.run();
});
// Start waiting for new messages...
consumer1QueueA.run();
// Produce a message on queue 'queue_a'
const producer1QueueA = getProducer('queue_a');
producer1QueueA.produce({ id: 'a', hello: 'world' }, (err) => {
if (err) {
throw err;
}
});
The script output should be like:
Got message {"id":"b","hello":"world"} from Queue queue_b. Acknowledging...
Got message: {"id":"a","hello":"world"}, queue: queue_a. Simulating crash...
Please wait for another consumer to recover from this failure. It would take some time...
Got message {"id":"a","hello":"world"} from Queue queue_a. Acknowledging...
As you see from the output the message {"id":"a","hello":"world"}
was not re-queued on queue_b
after consumer crash.
from redis-smq.
Sorry that issue has been actually fixed, I didn't delete previous appendonly.aof file mounted from docker container to my host.
from redis-smq.
Related Issues (20)
- Checking if a message handler exists HOT 7
- Invalid rateLimit.interval. Expected a positive integer >= 1000 HOT 2
- Are there any plans to implement client SDKs in other languages? Like java HOT 2
- Any chance of updating Redis to v4 HOT 10
- [分享]可以让Redis消息队列更好的一篇文章 [Share] An article that can make Redis message queues better
- Feature request: Topic based routing HOT 3
- Cannot serialize `bigint` HOT 1
- Redis smq randomly throws an error that make app crashes HOT 2
- Support ioredis cluster configuration
- Upgrade to Redis 4 HOT 5
- Use instance based instead of a system wide configuration HOT 2
- Producer & Consumer seem to be ignoring config HOT 6
- How are messages stored in brokers in redis-smq? HOT 1
- Not working with docker compose HOT 5
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected HOT 15
- [Question] How to avoid duplicated tasks? HOT 6
- LockManagerExtendError: Acquired lock could not be extended HOT 3
- random retryDelay HOT 4
- [Feature] Support option for a missing interval in the scheduler. HOT 4
- How to delete message in consumer HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis-smq.