Alonexc commented on code in PR #3736:
URL: https://github.com/apache/eventmesh/pull/3736#discussion_r1166476344
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/consumer/ConsumerManager.java:
##########
@@ -89,10 +89,8 @@ public void shutdown() throws Exception {
}
public EventMeshConsumer getEventMeshConsumer(final String consumerGroup) {
- EventMeshConsumer consumer = consumerTable.get(consumerGroup);
- if (consumer == null) {
- consumer = new EventMeshConsumer(eventMeshGrpcServer,
consumerGroup);
- consumerTable.put(consumerGroup, consumer);
+ return consumerTable.computeIfAbsent(consumerGroup, key ->
+ consumerTable.put(consumerGroup, new
EventMeshConsumer(eventMeshGrpcServer, consumerGroup)));
}
return consumer;
Review Comment:
Need to delete 94, 95 lines of code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]