Skip to content

Commit 8de354f

Browse files
paladimpaladim
andauthored
fix(event):synchronization of sending to zeromq (#5536)
Co-authored-by: paladim <[email protected]>
1 parent 1ec48e1 commit 8de354f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

framework/src/main/java/org/tron/common/logsfilter/nativequeue/NativeMessageQueue.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ public void publishTrigger(String data, String topic) {
6464
}
6565

6666
try {
67-
publisher.sendMore(topic);
68-
publisher.send(data);
67+
synchronized (this) {
68+
publisher.sendMore(topic);
69+
publisher.send(data);
70+
}
6971
} catch (RuntimeException e) {
7072
logger.error("write data to zeromq failed, data:{}, topic:{}, error:{}", data, topic,
7173
e.getMessage());

0 commit comments

Comments
 (0)