Pil0tXia commented on code in PR #4507:
URL: https://github.com/apache/eventmesh/pull/4507#discussion_r1373417609


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/UnSubscribeProcessor.java:
##########
@@ -226,7 +222,7 @@ public void processRequest(final ChannelHandlerContext ctx, 
final AsyncContext<H
                         UnSubscribeResponseBody.class);
                     final long endTime = System.currentTimeMillis();
                     log.error("message|eventMesh2mq|REQ|ASYNC|send2MQCost={}ms"
-                        + "|topic={}|url={}", endTime - startTime,
+                            + "|topic={}|url={}", endTime - startTime,
                         
JsonUtils.toJSONString(unSubscribeRequestBody.getTopics()),
                         unSubscribeRequestBody.getUrl(), e);

Review Comment:
   ```suggestion
   log.error("message|eventMesh2mq|REQ|ASYNC|send2MQCost={}ms|topic={}|url={}", 
endTime - startTime,
                           
JsonUtils.toJSONString(unSubscribeRequestBody.getTopics()), 
unSubscribeRequestBody.getUrl(), e);
   ```
   
   The same as L201-L204 in this class.



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/LocalUnSubscribeEventProcessor.java:
##########
@@ -235,12 +229,12 @@ public void handler(final HandlerService.HandlerSpecific 
handlerSpecific, final
 
     @Override
     public String[] paths() {
-        return new String[]{RequestURI.UNSUBSCRIBE_LOCAL.getRequestURI()};
+        return new String[] {RequestURI.UNSUBSCRIBE_LOCAL.getRequestURI()};
     }
 
     private void registerClient(final HttpEventWrapper requestWrapper,
-        final String consumerGroup,
-        final List<String> topicList, final String url) {
+                                final String consumerGroup,
+                                final List<String> topicList, final String 
url) {
         Objects.requireNonNull(requestWrapper, "requestWrapper can not be 
null");

Review Comment:
   Redundant indention here. These params can be merged into one line.



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/group/ClientGroupWrapper.java:
##########
@@ -249,7 +227,7 @@ public boolean removeSubscription(SubscriptionItem 
subscriptionItem, Session ses
         String topic = subscriptionItem.getTopic();
         if (session == null
             || !StringUtils.equalsIgnoreCase(group,
-                
EventMeshUtil.buildClientGroup(session.getClient().getGroup()))) {
+            EventMeshUtil.buildClientGroup(session.getClient().getGroup()))) {

Review Comment:
   ```suggestion
   if (session == null || !StringUtils.equalsIgnoreCase(group, 
EventMeshUtil.buildClientGroup(session.getClient().getGroup()))) {
   ```
   
   The same as L333-L335, L365-L367, L395-L397, L427-L429.



##########
eventmesh-sdks/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/EventMeshGrpcConsumer.java:
##########
@@ -64,14 +65,11 @@
 public class EventMeshGrpcConsumer implements AutoCloseable {
 
     private static final String SDK_STREAM_URL = "grpc_stream";
-    private ManagedChannel channel;
     private final EventMeshGrpcClientConfig clientConfig;
-
     private final Map<String, SubscriptionInfo> subscriptionMap = new 
ConcurrentHashMap<>();
-
     private final ScheduledThreadPoolExecutor scheduler = new 
ScheduledThreadPoolExecutor(Runtime.getRuntime().availableProcessors(),
         new EventMeshThreadFactory("GRPCClientScheduler", true));
-
+    private ManagedChannel channel;
     private ConsumerServiceBlockingStub consumerClient;

Review Comment:
   Field sequence problem here.



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/push/AsyncHTTPPushRequest.java:
##########
@@ -76,9 +77,8 @@ public class AsyncHTTPPushRequest extends 
AbstractHTTPPushRequest {
     public static final Logger CMD_LOGGER = 
LoggerFactory.getLogger(EventMeshConstants.CMD);
 
     public static final Logger LOGGER = 
LoggerFactory.getLogger("AsyncHTTPPushRequest");
-
-    public String currPushUrl;
     private final Map<String, Set<AbstractHTTPPushRequest>> waitingRequests;
+    public String currPushUrl;
 

Review Comment:
   Field sequence problem here.



##########
eventmesh-sdks/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/SubStreamHandler.java:
##########
@@ -47,13 +48,11 @@ public class SubStreamHandler<T> extends Thread implements 
Serializable {
     private final transient ConsumerServiceStub consumerAsyncClient;
 
     private final transient EventMeshGrpcClientConfig clientConfig;
-
-    private transient StreamObserver<CloudEvent> sender;
-
     private final ReceiveMsgHook<T> listener;
+    private transient StreamObserver<CloudEvent> sender;
 
     public SubStreamHandler(final ConsumerServiceStub consumerAsyncClient, 
final EventMeshGrpcClientConfig clientConfig,
-        final ReceiveMsgHook<T> listener) {
+                            final ReceiveMsgHook<T> listener) {
         this.consumerAsyncClient = consumerAsyncClient;

Review Comment:
   Redundant indention and field sequence problem here. 
   
   **I will refrain from further annotating similar questions below. You can 
independently review them on this page:**
   
   
![image](https://github.com/apache/eventmesh/assets/41445332/0ad19437-0597-4923-adf4-d7c26d030ff7)
   



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/group/ClientGroupWrapper.java:
##########
@@ -75,52 +76,33 @@
 public class ClientGroupWrapper {
 
     private final String sysId;
-
-    private String group;
-
-    private EventMeshTCPConfiguration eventMeshTCPConfiguration;
-
     private final EventMeshTCPServer eventMeshTCPServer;
-
-    private TcpRetryer tcpRetryer;
-
-    private EventMeshTcpMonitor eventMeshTcpMonitor;
-
-    private DownstreamDispatchStrategy downstreamDispatchStrategy;
-
     private final ReadWriteLock groupLock = new ReentrantReadWriteLock();

Review Comment:
   Field sequence problem here.



-- 
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]

Reply via email to