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 5a74e01ba9..4091083040 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 @@ @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 void process(final CloudEvent subscription, final EventEmitter subscriptionItems = JsonUtils.parseTypeReferenceObject(subscription.getTextData(), new TypeReference>() { }); + + 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 @@ private void doAclCheck(final CloudEvent subscription) throws AclException { List subscriptionItems = JsonUtils.parseTypeReferenceObject(subscription.getTextData(), new TypeReference>() { }); + Objects.requireNonNull(subscriptionItems, "subscriptionItems must not be null"); if (eventMeshGrpcServer.getEventMeshGrpcConfiguration().isEventMeshServerSecurityEnable()) { for (final SubscriptionItem item : subscriptionItems) { this.acl.doAclCheckInHttpReceive(EventMeshCloudEventUtils.getConsumerGroup(subscription),