Comments (9)
Unable to reproduce with the test below. What did I miss?
int loops = 10;
AtomicInteger counter = new AtomicInteger();
for (int j = 0; j < loops; j++) {
RTopic t = redisson.getTopic("PUBSUB_" + j);
t.addListener(String.class, new MessageListener<String>() {
@Override
public void onMessage(CharSequence channel, String msg) {
System.out.println("channel " + channel + " " + msg);
counter.incrementAndGet();
}
});
}
for (int j = 0; j < loops; j++) {
RTopic t = redisson.getTopic("PUBSUB_" + j);
for (int i = 0; i < 10; i++) {
t.publish("message " + j + "_" + i);
}
}
Thread.sleep(1000);
assertThat(counter.get()).isEqualTo(loops * 10);
from redisson.
It is not easy to reproduce in a short period of time. You need to continue publishing messages, and then after running for a period of time, you will find that several channels cannot be consumed.
Unable to reproduce with the test below. What did I miss?
from redisson.
I don't know the specific reason. In my scenario: the same redis, the same number of channels, the same publish, the same configuration, and different Redisson versions.
I once suspected that the redis buffer overflow caused the client connection to be disconnected. I used the client list
command to check the buffer usage and found that the buffer was very sufficient, thus ruling out the possibility of the redis server actively disconnecting.
Then I tried to add the Status listener of the Topic, and found that when the count bit of the publish result was 0, the status listener did not trigger any unsubscribe event. I tried repeatedly by switching different Redisson versions, and found that only 3.25.1 had no problem, so I had to Roll back to previous version.
from redisson.
Can you try 3.26.0?
from redisson.
Can you try 3.26.0?
I can test it later when I have time, but I'm sorry not now.
from redisson.
do you invoke RTopic.addListener() only once per channel? Total 10 channels?
from redisson.
This is my code. Each channel only triggers this code once.
RTopic rt = getTopic(topic);
rt.addListener(new StatusListener() {
@Override
public void onSubscribe(String channel) {
logger.debug("redis channel subscribed {}", channel);
}
@Override
public void onUnsubscribe(String channel) {
logger.info("redis channel unsubscribed {}", channel);
}
});
rt.addListener(
TransformMessage.class,
(channel, msg) -> executor.execute(() -> consume(MQMessage.create(channel.toString(), msg), consumer))
);
from redisson.
Do you use a single Redis server or cluster setup?
from redisson.
No, my production environment uses sentinel mode.
Do you use a single Redis server or cluster setup?
from redisson.
Related Issues (20)
- Lambda task not work in RExecutorService
- Destroy should automatically remove all listeners on the object
- RedisConnection is not released after network loopback HOT 4
- Add RSearch.getIndexes() method HOT 1
- RSearch AggregationOptions#loadAll() method doesn't work HOT 1
- org.jboss.marshalling not incuded with latest redisson version ? HOT 3
- Support eviction from RMapCache based on underlying size of the map in bytes
- urgent problem HOT 1
- "Unable to connect" message after Connection created - part 2 HOT 4
- (过期消息积压在RDelayedQueue)Expired messages are backlogged in RDelayedQueue, expired but not transferred to the expired queue HOT 2
- redisson:tomcat_notified_nodes keys created without an expiration HOT 1
- StacklessClosedChannelException happend after redis instance switching.
- RedissonLock - infinity loop of acquiring/releasing, the number of available permits is greater than 1. HOT 8
- Redis Sentintel mode: PubSub stops working after Redis restart
- SET in pipeline don't return result of an operation HOT 3
- nodes (ip/port) that leave the cluster and then rejoin are never reflected in redison cluster topology, but are in CLUSTER NODES HOT 4
- "RedissonShutdownException: Redisson is shutdown" error during graceful shutdown (deployment) HOT 5
- Name mapper behavior in context of Redis operation which takes additional key parameter
- Settings into application.properties file. HOT 1
- Redisson needs to support chaining BITFIELD increment commands HOT 2
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 redisson.