@@ -87,8 +87,7 @@ public EventMeshGrpcConsumer(final EventMeshGrpcClientConfig clientConfig) {
8787 }
8888
8989 public void init () {
90- this .channel = ManagedChannelBuilder .forAddress (clientConfig .getServerAddr (), clientConfig .getServerPort ()).usePlaintext ()
91- .build ();
90+ this .channel = ManagedChannelBuilder .forAddress (clientConfig .getServerAddr (), clientConfig .getServerPort ()).usePlaintext ().build ();
9291 this .consumerClient = ConsumerServiceGrpc .newBlockingStub (channel );
9392 this .consumerAsyncClient = ConsumerServiceGrpc .newStub (channel );
9493 this .heartbeatClient = HeartbeatServiceGrpc .newBlockingStub (channel );
@@ -125,8 +124,8 @@ public void subscribe(final List<SubscriptionItem> subscriptionItems) {
125124
126125 addSubscription (subscriptionItems , SDK_STREAM_URL , GrpcType .STREAM );
127126
128- CloudEvent subscription = EventMeshCloudEventBuilder .buildEventSubscription (clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE , null ,
129- subscriptionItems );
127+ CloudEvent subscription = EventMeshCloudEventBuilder .buildEventSubscription (
128+ clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE , null , subscriptionItems );
130129 synchronized (this ) {
131130 if (subStreamHandler == null ) {
132131 subStreamHandler = new SubStreamHandler <>(consumerAsyncClient , clientConfig , listener );
@@ -137,8 +136,8 @@ public void subscribe(final List<SubscriptionItem> subscriptionItems) {
137136 }
138137
139138 private Response subscribeWebhook (List <SubscriptionItem > subscriptionItems , String url ) {
140- final CloudEvent subscription = EventMeshCloudEventBuilder .buildEventSubscription (clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE ,
141- url , subscriptionItems );
139+ final CloudEvent subscription = EventMeshCloudEventBuilder .buildEventSubscription (
140+ clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE , url , subscriptionItems );
142141 try {
143142 CloudEvent response = consumerClient .subscribe (subscription );
144143 log .info ("Received response:{}" , response );
@@ -169,8 +168,8 @@ public Response unsubscribe(final List<SubscriptionItem> subscriptionItems, fina
169168
170169 removeSubscription (subscriptionItems );
171170
172- final CloudEvent cloudEvent = EventMeshCloudEventBuilder .buildEventSubscription (clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE , url ,
173- subscriptionItems );
171+ final CloudEvent cloudEvent = EventMeshCloudEventBuilder .buildEventSubscription (
172+ clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE , url , subscriptionItems );
174173 try {
175174 final CloudEvent response = consumerClient .unsubscribe (cloudEvent );
176175 log .info ("Received response:{}" , response );
@@ -191,8 +190,8 @@ public Response unsubscribe(final List<SubscriptionItem> subscriptionItems) {
191190
192191 removeSubscription (subscriptionItems );
193192
194- final CloudEvent cloudEvent = EventMeshCloudEventBuilder .buildEventSubscription (clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE , null ,
195- subscriptionItems );
193+ final CloudEvent cloudEvent = EventMeshCloudEventBuilder .buildEventSubscription (
194+ clientConfig , EventMeshProtocolType . EVENT_MESH_MESSAGE , null , subscriptionItems );
196195
197196 try {
198197 final CloudEvent response = consumerClient .unsubscribe (cloudEvent );
@@ -277,14 +276,12 @@ private void resubscribe() {
277276
278277 subscriptionGroup .forEach ((url , items ) -> {
279278 if (isStreamSub .get ()) {
280- CloudEvent subscription = EventMeshCloudEventBuilder .buildEventSubscription (clientConfig , EventMeshProtocolType .EVENT_MESH_MESSAGE ,
281- url ,
282- items );
279+ CloudEvent subscription = EventMeshCloudEventBuilder .buildEventSubscription (
280+ clientConfig , EventMeshProtocolType .EVENT_MESH_MESSAGE , url , items );
283281 subStreamHandler .sendSubscription (subscription );
284282 } else {
285283 subscribeWebhook (items , url );
286284 }
287-
288285 });
289286 }
290287
0 commit comments