This commit is contained in:
Redkale
2020-07-31 10:26:26 +08:00
parent 29a21d060b
commit f4a2f2af94

View File

@@ -28,9 +28,7 @@ public class MessageProducers {
}
public MessageProducer getProducer(MessageRecord message) {
int hash = message.hash();
if (hash == 0) {
hash = index.incrementAndGet();
int hash = index.incrementAndGet();
if (index.get() > 1000 * producers.length) {
synchronized (index) {
if (index.get() > 1000 * producers.length) {
@@ -38,7 +36,6 @@ public class MessageProducers {
}
}
}
}
return producers[hash % producers.length];
}