Skip to content

Commit

Permalink
[pulsar-proxy] fix logging for published messages (apache#6474)
Browse files Browse the repository at this point in the history
### Motivation
Proxy-logging fetches incorrect producerId for `Send` command because of that logging always gets producerId as 0 and it fetches invalid topic name for the logging.

### Modification
Fixed topic logging by fetching correct producerId for `Send` command.
  • Loading branch information
sijie committed Mar 5, 2020
1 parent 4284e39 commit 65cc303
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
logging(ctx.channel() , cmd.getType() , "", null);
break;
}
topicName = TopicName.get(ParserProxyHandler.producerHashMap.get(String.valueOf(cmd.getProducer().getProducerId()) + "," + String.valueOf(ctx.channel().id())));
topicName = TopicName.get(ParserProxyHandler.producerHashMap.get(String.valueOf(cmd.getSend().getProducerId()) + "," + String.valueOf(ctx.channel().id())));
MessageParser.parseMessage(topicName, -1L,
-1L,buffer,(message) -> {
messages.add(message);
Expand Down

0 comments on commit 65cc303

Please sign in to comment.