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/02/24 03:22:17 UTC

[incubator-eventmesh] branch master updated: [ISSUE #786] remove eventmesh-sdk-java model redundant code (#789)

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 874d5fa  [ISSUE #786] remove eventmesh-sdk-java model redundant code (#789)
874d5fa is described below

commit 874d5fa9401312091defd1287009532952158f3b
Author: lucky-lsr <45...@users.noreply.github.com>
AuthorDate: Thu Feb 24 11:20:18 2022 +0800

    [ISSUE #786] remove eventmesh-sdk-java model redundant code (#789)
    
    Co-authored-by: lucky-lsr <ha...@126.com>
    close #786
---
 .../client/http/consumer/HandleResult.java         |  25 -----
 .../http/consumer/context/LiteConsumeContext.java  | 103 ---------------------
 .../consumer/listener/LiteMessageListener.java     |  34 -------
 .../client/tcp/common/RequestContext.java          |   5 -
 4 files changed, 167 deletions(-)

diff --git a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/HandleResult.java b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/HandleResult.java
deleted file mode 100644
index c5a9a85..0000000
--- a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/HandleResult.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.eventmesh.client.http.consumer;
-
-public enum HandleResult {
-    OK,
-    NOLISTEN,
-    RETRY,
-    FAIL
-}
diff --git a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/context/LiteConsumeContext.java b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/context/LiteConsumeContext.java
deleted file mode 100644
index 63635f0..0000000
--- a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/context/LiteConsumeContext.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.eventmesh.client.http.consumer.context;
-
-import org.apache.eventmesh.common.Constants;
-
-import org.apache.commons.lang3.time.DateFormatUtils;
-
-public class LiteConsumeContext {
-
-    private String eventMeshIp;
-
-    private String eventMeshEnv;
-
-    private String eventMeshIdc;
-
-    private String eventMeshCluster;
-
-    // Local RETRY times
-    private int retryTimes = 0;
-
-    private long createTime = System.currentTimeMillis();
-
-    public LiteConsumeContext(String eventMeshIp, String eventMeshEnv,
-                              String eventMeshIdc,
-                              String eventMeshCluster) {
-        this.eventMeshIp = eventMeshIp;
-        this.eventMeshEnv = eventMeshEnv;
-        this.eventMeshIdc = eventMeshIdc;
-        this.eventMeshCluster = eventMeshCluster;
-
-    }
-
-    public String getEventMeshIp() {
-        return eventMeshIp;
-    }
-
-    public void setEventMeshIp(String eventMeshIp) {
-        this.eventMeshIp = eventMeshIp;
-    }
-
-    public String getEventMeshEnv() {
-        return eventMeshEnv;
-    }
-
-    public void setEventMeshEnv(String eventMeshEnv) {
-        this.eventMeshEnv = eventMeshEnv;
-    }
-
-    public String getEventMeshIdc() {
-        return eventMeshIdc;
-    }
-
-    public void setEventMeshIdc(String eventMeshIdc) {
-        this.eventMeshIdc = eventMeshIdc;
-    }
-
-    public String getEventMeshCluster() {
-        return eventMeshCluster;
-    }
-
-    public void setEventMeshCluster(String eventMeshCluster) {
-        this.eventMeshCluster = eventMeshCluster;
-    }
-
-    public int getRetryTimes() {
-        return retryTimes;
-    }
-
-    public void setRetryTimes(int retryTimes) {
-        this.retryTimes = retryTimes;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("liteConsumeContext={")
-                .append("eventMeshIp=").append(eventMeshIp).append(",")
-                .append("eventMeshEnv=").append(eventMeshEnv).append(",")
-                .append("eventMeshIdc=").append(eventMeshIdc).append(",")
-                .append("eventMeshCluster=").append(eventMeshCluster).append(",")
-                .append("retryTimes=").append(retryTimes).append(",")
-                .append("createTime=").append(DateFormatUtils.format(createTime, Constants.DATE_FORMAT))
-                .append("}");
-        return sb.toString();
-    }
-
-}
diff --git a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/listener/LiteMessageListener.java b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/listener/LiteMessageListener.java
deleted file mode 100644
index 78de022..0000000
--- a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/listener/LiteMessageListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.eventmesh.client.http.consumer.listener;
-
-
-import org.apache.eventmesh.client.http.consumer.HandleResult;
-import org.apache.eventmesh.client.http.consumer.context.LiteConsumeContext;
-import org.apache.eventmesh.common.EventMeshMessage;
-
-/**
- * LiteMessageListener
- */
-public interface LiteMessageListener {
-
-    HandleResult handle(EventMeshMessage eventMeshMessage, LiteConsumeContext liteConsumeContext);
-
-    boolean reject();
-
-}
diff --git a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/RequestContext.java b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/RequestContext.java
index a713bd8..3f3fe0c 100644
--- a/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/RequestContext.java
+++ b/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/RequestContext.java
@@ -84,11 +84,6 @@ public class RequestContext {
 
 
     public static Object key(Package request) {
-        //MessageType type = request.getHeader().getType();
-        //if(MessageType.SyncRequest == type || MessageType.SyncResponse == type
-        //        || MessageType.AsyncRequest == type || MessageType.AsyncResponse == type) {
-        //    return request.getBody().getSysHeader().getUniqueId() ;
-        //}
         return request.getHeader().getSeq();
     }
 }

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