Skip to content

Commit

Permalink
fix(event):synchronization of sending to zeromq (tronprotocol#5536)
Browse files Browse the repository at this point in the history
Co-authored-by: paladim <paladim@example.com>
  • Loading branch information
paladim and paladim authored Oct 26, 2023
1 parent 1ec48e1 commit 8de354f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ public void publishTrigger(String data, String topic) {
}

try {
publisher.sendMore(topic);
publisher.send(data);
synchronized (this) {
publisher.sendMore(topic);
publisher.send(data);
}
} catch (RuntimeException e) {
logger.error("write data to zeromq failed, data:{}, topic:{}, error:{}", data, topic,
e.getMessage());
Expand Down

0 comments on commit 8de354f

Please sign in to comment.