You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2022/11/03 14:00:30 UTC

[incubator-eventmesh] branch master updated: fix CI error: example

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/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 93ee71e4 fix CI error: example
     new e052a8fd Merge pull request #2106 from horoc/fix-ci-error-example
93ee71e4 is described below

commit 93ee71e4bcb4143d871421df45c02d7c01ab554e
Author: horoc <ho...@gmail.com>
AuthorDate: Thu Nov 3 20:01:47 2022 +0800

    fix CI error: example
---
 .../apache/eventmesh/common/ExampleConstants.java  |  8 +++----
 .../WorkflowAsyncPublishInstance.java              |  5 +++--
 .../grpc/sub/CloudEventsSubscribeReply.java        |  2 +-
 .../grpc/sub/app/controller/SubController.java     |  5 ++---
 .../eventmesh/grpc/sub/app/service/SubService.java | 10 ++++-----
 .../http/demo/sub/controller/SubController.java    |  5 ++---
 .../http/demo/sub/service/SubService.java          | 26 +++++++++++-----------
 7 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/common/ExampleConstants.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/common/ExampleConstants.java
index 91edf378..49b13aac 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/common/ExampleConstants.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/common/ExampleConstants.java
@@ -52,8 +52,8 @@ public class ExampleConstants {
 
     public static final String EVENTMESH_SELECTOR_TYPE = "eventmesh.selector.type";
 
-	public static final String ENV = "P";
-	public static final String IDC = "FT";
-	public static final String SUB_SYS = "1234";
-	public static final String SERVER_PORT = "server.port";
+    public static final String ENV = "P";
+    public static final String IDC = "FT";
+    public static final String SUB_SYS = "1234";
+    public static final String SERVER_PORT = "server.port";
 }
diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/pub/eventmeshmessage/WorkflowAsyncPublishInstance.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/pub/eventmeshmessage/WorkflowAsyncPublishInstance.java
index c954338b..6ab88cd3 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/pub/eventmeshmessage/WorkflowAsyncPublishInstance.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/pub/eventmeshmessage/WorkflowAsyncPublishInstance.java
@@ -66,14 +66,15 @@ public class WorkflowAsyncPublishInstance {
         nacosSelector.init();
         SelectorFactory.register(selectorType, nacosSelector);
 
-        EventMeshWorkflowClientConfig eventMeshWorkflowClientConfig = EventMeshWorkflowClientConfig.builder().serverName(workflowServerName).build();
-        EventMeshWorkflowClient eventMeshWorkflowClient = new EventMeshWorkflowClient(eventMeshWorkflowClientConfig);
 
         ExecuteRequest.Builder executeRequest = ExecuteRequest.newBuilder();
         Map<String, String> content = new HashMap<>();
         content.put("order_no", "workflowmessage");
         executeRequest.setInput(new Gson().toJson(content));
         executeRequest.setId("testcreateworkflow");
+
+        EventMeshWorkflowClientConfig eventMeshWorkflowClientConfig = EventMeshWorkflowClientConfig.builder().serverName(workflowServerName).build();
+        EventMeshWorkflowClient eventMeshWorkflowClient = new EventMeshWorkflowClient(eventMeshWorkflowClientConfig);
         ExecuteResponse response = eventMeshWorkflowClient.getWorkflowClient().execute(executeRequest.build());
         logger.info("received response: {}", response.toString());
 
diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/CloudEventsSubscribeReply.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/CloudEventsSubscribeReply.java
index 71ca1169..5e813fa4 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/CloudEventsSubscribeReply.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/CloudEventsSubscribeReply.java
@@ -38,7 +38,7 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class CloudEventsSubscribeReply implements ReceiveMsgHook<CloudEvent> {
 
-    public final static CloudEventsSubscribeReply handler = new CloudEventsSubscribeReply();
+    public static final CloudEventsSubscribeReply handler = new CloudEventsSubscribeReply();
 
     public static void main(String[] args) throws InterruptedException {
         Properties properties = Utils.readPropertiesFile(ExampleConstants.CONFIG_FILE_NAME);
diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/controller/SubController.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/controller/SubController.java
index f215eae8..f5de48de 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/controller/SubController.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/controller/SubController.java
@@ -17,8 +17,6 @@
 
 package org.apache.eventmesh.grpc.sub.app.controller;
 
-import io.cloudevents.CloudEventData;
-import io.cloudevents.core.format.EventFormat;
 import org.apache.eventmesh.client.tcp.common.EventMeshCommon;
 import org.apache.eventmesh.common.protocol.http.common.ProtocolKey;
 import org.apache.eventmesh.common.utils.JsonUtils;
@@ -38,11 +36,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import io.cloudevents.CloudEvent;
+import io.cloudevents.CloudEventData;
+import io.cloudevents.core.format.EventFormat;
 import io.cloudevents.core.provider.EventFormatProvider;
 
 import lombok.extern.slf4j.Slf4j;
 
-
 @Slf4j
 @RestController
 @RequestMapping("/sub")
diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/service/SubService.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/service/SubService.java
index df9c43ed..0c01ab5b 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/service/SubService.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/service/SubService.java
@@ -19,6 +19,11 @@
 
 package org.apache.eventmesh.grpc.sub.app.service;
 
+import static org.apache.eventmesh.common.ExampleConstants.ENV;
+import static org.apache.eventmesh.common.ExampleConstants.IDC;
+import static org.apache.eventmesh.common.ExampleConstants.SERVER_PORT;
+import static org.apache.eventmesh.common.ExampleConstants.SUB_SYS;
+
 import org.apache.eventmesh.client.grpc.config.EventMeshGrpcClientConfig;
 import org.apache.eventmesh.client.grpc.consumer.EventMeshGrpcConsumer;
 import org.apache.eventmesh.common.ExampleConstants;
@@ -40,11 +45,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.stereotype.Component;
 
-import static org.apache.eventmesh.common.ExampleConstants.SERVER_PORT;
-import static org.apache.eventmesh.common.ExampleConstants.ENV;
-import static org.apache.eventmesh.common.ExampleConstants.IDC;
-import static org.apache.eventmesh.common.ExampleConstants.SUB_SYS;
-
 @Component
 public class SubService implements InitializingBean {
 
diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/controller/SubController.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/controller/SubController.java
index a4ae5f33..dfbd8287 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/controller/SubController.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/controller/SubController.java
@@ -17,8 +17,6 @@
 
 package org.apache.eventmesh.http.demo.sub.controller;
 
-import io.cloudevents.CloudEventData;
-import io.cloudevents.core.format.EventFormat;
 import org.apache.eventmesh.client.tcp.common.EventMeshCommon;
 import org.apache.eventmesh.common.protocol.http.common.ProtocolKey;
 import org.apache.eventmesh.common.utils.JsonUtils;
@@ -38,12 +36,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import io.cloudevents.CloudEvent;
+import io.cloudevents.CloudEventData;
+import io.cloudevents.core.format.EventFormat;
 import io.cloudevents.core.provider.EventFormatProvider;
 import io.cloudevents.jackson.JsonFormat;
 
 import lombok.extern.slf4j.Slf4j;
 
-
 @Slf4j
 @RestController
 @RequestMapping("/sub")
diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java
index c8451018..5aac2cbb 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/service/SubService.java
@@ -19,6 +19,11 @@
 
 package org.apache.eventmesh.http.demo.sub.service;
 
+import static org.apache.eventmesh.common.ExampleConstants.ENV;
+import static org.apache.eventmesh.common.ExampleConstants.IDC;
+import static org.apache.eventmesh.common.ExampleConstants.SERVER_PORT;
+import static org.apache.eventmesh.common.ExampleConstants.SUB_SYS;
+
 import org.apache.eventmesh.client.http.conf.EventMeshHttpClientConfig;
 import org.apache.eventmesh.client.http.consumer.EventMeshHttpConsumer;
 import org.apache.eventmesh.common.ExampleConstants;
@@ -44,11 +49,6 @@ import org.springframework.stereotype.Component;
 
 import com.google.common.collect.Lists;
 
-import static org.apache.eventmesh.common.ExampleConstants.SERVER_PORT;
-import static org.apache.eventmesh.common.ExampleConstants.ENV;
-import static org.apache.eventmesh.common.ExampleConstants.IDC;
-import static org.apache.eventmesh.common.ExampleConstants.SUB_SYS;
-
 @Component
 public class SubService implements InitializingBean {
 
@@ -59,7 +59,7 @@ public class SubService implements InitializingBean {
     final Properties properties = Utils.readPropertiesFile(ExampleConstants.CONFIG_FILE_NAME);
 
     final List<SubscriptionItem> topicList = Lists.newArrayList(
-            new SubscriptionItem(ExampleConstants.EVENTMESH_HTTP_ASYNC_TEST_TOPIC, SubscriptionMode.CLUSTERING, SubscriptionType.ASYNC)
+        new SubscriptionItem(ExampleConstants.EVENTMESH_HTTP_ASYNC_TEST_TOPIC, SubscriptionMode.CLUSTERING, SubscriptionType.ASYNC)
     );
     final String localIp = IPUtils.getLocalAddress();
     final String localPort = properties.getProperty(SERVER_PORT);
@@ -75,13 +75,13 @@ public class SubService implements InitializingBean {
 
         final String eventMeshIPPort = eventMeshIp + ":" + eventMeshHttpPort;
         EventMeshHttpClientConfig eventMeshClientConfig = EventMeshHttpClientConfig.builder()
-                .liteEventMeshAddr(eventMeshIPPort)
-                .consumerGroup(ExampleConstants.DEFAULT_EVENTMESH_TEST_CONSUMER_GROUP)
-                .env(ENV)
-                .idc(IDC)
-                .ip(IPUtils.getLocalAddress())
-                .sys(SUB_SYS)
-                .pid(String.valueOf(ThreadUtils.getPID())).build();
+            .liteEventMeshAddr(eventMeshIPPort)
+            .consumerGroup(ExampleConstants.DEFAULT_EVENTMESH_TEST_CONSUMER_GROUP)
+            .env(ENV)
+            .idc(IDC)
+            .ip(IPUtils.getLocalAddress())
+            .sys(SUB_SYS)
+            .pid(String.valueOf(ThreadUtils.getPID())).build();
 
         eventMeshHttpConsumer = new EventMeshHttpConsumer(eventMeshClientConfig);
         eventMeshHttpConsumer.heartBeat(topicList, url);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org