You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by ma...@apache.org on 2022/10/25 12:38:31 UTC

[incubator-eventmesh] branch master updated: fix #1848

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

majorhe 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 2cd7c70c fix #1848
     new eea472d5 Merge pull request #1851 from haihuiyang/master
2cd7c70c is described below

commit 2cd7c70ca79382a4ddc2f609fe0f5f7d427dcd3a
Author: happyfeet <ha...@gmail.com>
AuthorDate: Tue Oct 25 20:06:25 2022 +0800

    fix #1848
---
 .../org/apache/eventmesh/tcp/demo/sub/cloudevents/AsyncSubscribe.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/eventmesh-examples/src/main/java/org/apache/eventmesh/tcp/demo/sub/cloudevents/AsyncSubscribe.java b/eventmesh-examples/src/main/java/org/apache/eventmesh/tcp/demo/sub/cloudevents/AsyncSubscribe.java
index a4f46a60..ea087369 100644
--- a/eventmesh-examples/src/main/java/org/apache/eventmesh/tcp/demo/sub/cloudevents/AsyncSubscribe.java
+++ b/eventmesh-examples/src/main/java/org/apache/eventmesh/tcp/demo/sub/cloudevents/AsyncSubscribe.java
@@ -68,6 +68,10 @@ public class AsyncSubscribe implements ReceiveMsgHook<CloudEvent> {
 
     @Override
     public Optional<CloudEvent> handle(CloudEvent msg) {
+        if (msg.getData() == null) {
+            log.warn("receive async msg's data is null.");
+            return Optional.empty();
+        }
         String content = new String(msg.getData().toBytes(), StandardCharsets.UTF_8);
         log.info("receive async msg: {}|{}", msg, content);
         return Optional.empty();


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