This is an automated email from the ASF dual-hosted git repository.

mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 51a117154 [ISSUE #4195] Do some code optimization.[SubscribeProcessor] 
(#4383)
51a117154 is described below

commit 51a11715468d80c3b9d50da79e5d74d77629c08d
Author: Gautam Sagar <[email protected]>
AuthorDate: Thu Aug 24 20:14:48 2023 -0500

    [ISSUE #4195] Do some code optimization.[SubscribeProcessor] (#4383)
    
    * #4195 issue: Update SubscribeProcessor.java
    
    * apache#4195 issue: Modified  SubscribeProcessor.java
    
    * apache#4195 issue:Fixed SubscribeProcessor.java
    
    * apache#4195 issue: Changed SubscribeProcessor.java
    
    * apache#4195 issue:Resolved Syntax Error in SubscribeProcessor.java
    
    * Commiting after removing CI Merge Errors
---
 .../runtime/core/protocol/grpc/processor/SubscribeProcessor.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/processor/SubscribeProcessor.java
 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/processor/SubscribeProcessor.java
index 5a74e01ba..409108304 100644
--- 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/processor/SubscribeProcessor.java
+++ 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/processor/SubscribeProcessor.java
@@ -46,9 +46,9 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class SubscribeProcessor {
 
-    private final transient EventMeshGrpcServer eventMeshGrpcServer;
+    private final EventMeshGrpcServer eventMeshGrpcServer;
 
-    private final transient GrpcType grpcType = GrpcType.WEBHOOK;
+    private static final GrpcType grpcType = GrpcType.WEBHOOK;
 
     private final Acl acl;
 
@@ -70,7 +70,6 @@ public class SubscribeProcessor {
             
ServiceUtils.sendResponseCompleted(StatusCode.EVENTMESH_PROTOCOL_BODY_ERR, 
emitter);
             return;
         }
-
         try {
             doAclCheck(subscription);
         } catch (AclException e) {
@@ -88,6 +87,8 @@ public class SubscribeProcessor {
         List<SubscriptionItem> subscriptionItems = 
JsonUtils.parseTypeReferenceObject(subscription.getTextData(),
             new TypeReference<List<SubscriptionItem>>() {
             });
+        
+        Objects.requireNonNull(subscriptionItems, "subscriptionItems must not 
be null");
         final String env = EventMeshCloudEventUtils.getEnv(subscription);
         final String idc = EventMeshCloudEventUtils.getIdc(subscription);
         final String sys = EventMeshCloudEventUtils.getSys(subscription);
@@ -143,6 +144,7 @@ public class SubscribeProcessor {
         List<SubscriptionItem> subscriptionItems = 
JsonUtils.parseTypeReferenceObject(subscription.getTextData(),
             new TypeReference<List<SubscriptionItem>>() {
             });
+        Objects.requireNonNull(subscriptionItems, "subscriptionItems must not 
be null");
         if 
(eventMeshGrpcServer.getEventMeshGrpcConfiguration().isEventMeshServerSecurityEnable())
 {
             for (final SubscriptionItem item : subscriptionItems) {
                 
this.acl.doAclCheckInHttpReceive(EventMeshCloudEventUtils.getConsumerGroup(subscription),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to