This commit is contained in:
@@ -28,9 +28,7 @@ public class MessageProducers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MessageProducer getProducer(MessageRecord message) {
|
public MessageProducer getProducer(MessageRecord message) {
|
||||||
int hash = message.hash();
|
int hash = index.incrementAndGet();
|
||||||
if (hash == 0) {
|
|
||||||
hash = index.incrementAndGet();
|
|
||||||
if (index.get() > 1000 * producers.length) {
|
if (index.get() > 1000 * producers.length) {
|
||||||
synchronized (index) {
|
synchronized (index) {
|
||||||
if (index.get() > 1000 * producers.length) {
|
if (index.get() > 1000 * producers.length) {
|
||||||
@@ -38,7 +36,6 @@ public class MessageProducers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return producers[hash % producers.length];
|
return producers[hash % producers.length];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user