You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2021/07/13 17:50:07 UTC

[GitHub] [incubator-eventmesh] yzhao244 opened a new pull request #434: OpenSchema integration with EventMesh

yzhao244 opened a new pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434


   <!--
   ### Contribution Checklist
   
     - Name the pull request in the form "[ISSUE #XXXX] Title of the pull request", 
       where *XXXX* should be replaced by the actual issue number.
       Skip *[ISSUE #XXXX]* if there is no associated github issue for this pull request.
   
     - Fill out the template below to describe the changes contributed by the pull request. 
       That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue. 
       Please do not mix up code from multiple issues.
     
     - Each commit in the pull request should have a meaningful commit message.
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, 
       leaving only the filled out template below.
   
   (The sections below can be removed for hotfixes of typos)
   -->
   
   <!--
   (If this PR fixes a GitHub issue, please add `Fixes ISSUE#<XXX>`.)
   -->
   
   Fixes ISSUE#339.
   
   ### Motivation
   
   - Support Schema Registry feature in EventMesh by integrating with OpenSchema Specifications 
   
   *Explain why you want to make the changes and what problem you're trying to solve.*
   
   - The purpose of this pull request is for introducing Schema Registry as part of the EventMesh.
   The Schema Registry is a central repository with RESTful interfaces for developers to define and register standard schemas. Addresses the problem of inconsistent or incompatible data(event) format between event producer and event consumer.
   
   
   
   ### Modifications
   
   - Added eventmesh-store-api module which is an abstract layer abstracts the CRUD capability of the schema registry into this module.
   - Added eventmesh-store-h2 module which contains the actual implementation
   - Modified eventmesh-runtime which exposes three new subject APIs (schemaregistry/createSubject, /schemaregistry/readSubjectByName and /schemaregistry/showAllSubjectNames) via ClientManageController.
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? yes
   - If yes, how is the feature documented? Another follow up issue or PR will be created for adding the documentation
   - If a feature is not applicable for documentation, explain why?
   - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r671396893



##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/common/ServiceException.java
##########
@@ -0,0 +1,50 @@
+package org.apache.eventmesh.store.api.openschema.common;
+
+
+import org.apache.eventmesh.store.api.openschema.response.ErrorResponse;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ServiceException extends Exception {
+      private static final long serialVersionUID = 1L;
+      
+	  private int errorCode;
+	  private String errorMessage;
+
+	  //public ErrorResponse(@JsonProperty("error_code") int errorCode,
+	  //                     @JsonProperty("error_message") String errorMessage) {
+	  public ServiceException(ServiceError serviceError) {		  
+		super(serviceError.getMessage());
+	    this.errorCode = serviceError.getErrorCode();
+	    this.errorMessage = serviceError.getMessage();
+	  }
+
+	  @JsonProperty("error_code")
+	  public int getErrorCode() {
+	    return errorCode;
+	  }
+
+	  @JsonProperty("error_code")
+	  public void setErrorCode(int error_code) {

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-883840991


   @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670975428



##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/ConfigUpdateRequest.java
##########
@@ -0,0 +1,26 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ConfigUpdateRequest {
+
+	  private String compatibilityLevel;
+
+	 /* @ApiModelProperty(value = "Compatability Level",
+	      allowableValues = "BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, "
+	          + "FULL_TRANSITIVE, NONE")*/
+	  @JsonProperty("compatibility")

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r671396813



##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/common/CompatibilityLevel.java
##########
@@ -0,0 +1,42 @@
+package org.apache.eventmesh.store.api.openschema.common;
+
+public enum CompatibilityLevel {
+	  NONE,
+	  BACKWARD,
+	  BACKWARD_TRANSITIVE,
+	  FORWARD,
+	  FORWARD_TRANSITIVE,
+	  FULL,
+	  FULL_TRANSITIVE;
+
+	  public final String name;

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670978169



##########
File path: eventmesh-runtime/build.gradle
##########
@@ -29,8 +29,12 @@ List open_message = [
         "io.openmessaging:openmessaging-api:2.2.1-pubsub"
 ]
 
+List h2_database = [

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-881233115


   > > Hello, @yzhao244 ! I looked interface at the development, it seems that some interfaces are missing. I refer to https://github.com/openmessaging/openschema/blob/master/spec.md
   > > for instance:
   > > 7.1.2
   > > 7.2.4
   > > 7.2.6
   > > 7.2.7
   > 
   > @Jackzeng1224 Thanks for the question. Yes, you are right. The current commit so far only contains three Subject related APIs such as create subject, readySubjectbyname and showAllSubjects which have been mentioned in my first comment of this PR. :) . However, I am going to implement the rest of missing interfaces as soon as we are okay with the new modules(eventmesh-store-api and eventmesh-store-plugin), because I can follow new modules standards to code/implement the rest of interfaces. lol
   
   Thanks for answering questions! Looking forward to eventmesh-store-plugin module


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] qqeasonchen commented on pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-884753995


   > > > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > > > 
   > > > 
   > > > @yzhao244 Hi, I have a question, the h2 is a memory database, it seems doesn't support distributed, how can the different eventmesh-runtime sync the schema change?
   > > 
   > > 
   > > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > 
   > @qqeasonchen I answered your questions below. :)
   > 
   > 1. Eventmesh-store-api can be moved into eventmesh-store-plugin, just like connector.
   >    Yes, I have pushed my latest changes which moved Eventmesh-store-api to be under eventmesh-store-plugin.
   > 2. Did all the apis in the openSchema implement now?
   >    Not yet, I am thinking it is better delivering OpenSchema Integration in an incremental delivery fashion. :) .. In total, OpenSchema APIs can be seen as three groups.. /subject/ related APIs, /schema/ related APIs, /config/compatibility related APIs which I would suggest to deliver each group by individually separated PRs. The PR 434 currently delivers /subject/ related APIs.
   >    Three child issues are [Implement OpenSchema Subject APIs #453
   >    ](https://github.com/apache/incubator-eventmesh/issues/453), [Implement OpenSchema Schema APIs #454](https://github.com/apache/incubator-eventmesh/issues/454), [Implement OpenSchema Compatibility APIs #455](https://github.com/apache/incubator-eventmesh/issues/455)
   > 3. Did the management apis implement now?
   >    Three new subject APIs (schemaregistry/createSubject, /schemaregistry/readSubjectByName and /schemaregistry/showAllSubjectNames) via ClientManageController. The rest of the OpenSchema APIs will be tracked/implemented by individually separated issues and PRs
   > 4. Did the sdk implement now?
   >    Sorry, do you mean by eventmesh-sdk-java? All OpenSchema APIs are exposed as a RESTful API via webhook in ClientManageController.
   
   @yzhao244 Individually separated PRs is good for me. But it is not very clear about how to use schema when pub/sub events, it seems eventmesh provides a management service for schema only in the request implementations, am i right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] ruanwenjun commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670986723



##########
File path: eventmesh-store-h2/src/main/java/org/apache/eventmesh/store/h2/schema/util/DBDataSource.java
##########
@@ -0,0 +1,42 @@
+package org.apache.eventmesh.store.h2.schema.util;
+
+import org.apache.eventmesh.store.h2.schema.configuration.DBConfiguration;
+import org.apache.commons.dbcp2.BasicDataSource;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class DBDataSource {
+    private static BasicDataSource ds = null;
+
+    private DBDataSource() {
+
+    }
+
+    public static synchronized DBDataSource createDataSource(DBConfiguration dbConfig) {

Review comment:
       But when we execute `createDataSource` method twice, we will get two `DBDataSource` instances, this is confusion, I think you would better make this class to be a real singleton.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r671397618



##########
File path: eventmesh-store-h2/src/main/java/org/apache/eventmesh/store/h2/schema/util/DBDataSource.java
##########
@@ -0,0 +1,42 @@
+package org.apache.eventmesh.store.h2.schema.util;
+
+import org.apache.eventmesh.store.h2.schema.configuration.DBConfiguration;
+import org.apache.commons.dbcp2.BasicDataSource;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class DBDataSource {
+    private static BasicDataSource ds = null;
+
+    private DBDataSource() {
+
+    }
+
+    public static synchronized DBDataSource createDataSource(DBConfiguration dbConfig) {

Review comment:
       You are right. I pushed fixes to DBDataSource class. thx




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-884363526


   > > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > > 
   > > 
   > > @yzhao244 Hi, I have a question, the h2 is a memory database, it seems doesn't support distributed, how can the different eventmesh-runtime sync the schema change?
   > 
   > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > 
   
   @qqeasonchen I answered your questions below. :)
   > 1. Eventmesh-store-api can be moved into eventmesh-store-plugin, just like connector.
          Yes, I have pushed my latest changes which moved Eventmesh-store-api to be under eventmesh-store-plugin.
   > 2. Did all the apis in the openSchema implement now?
           Not yet, I am thinking it is better delivering OpenSchema Integration in an incremental delivery fashion. :) .. In total, OpenSchema APIs can be seen as three groups.. /subject/ related APIs, /schema/ related APIs, /config/compatibility related APIs which I would suggest to deliver each group by individually separated PRs. The PR 434 currently delivers /subject/ related APIs.
          Three child issues are [Implement OpenSchema Subject APIs #453
   ](https://github.com/apache/incubator-eventmesh/issues/453), [Implement OpenSchema Schema APIs #454](https://github.com/apache/incubator-eventmesh/issues/454), [Implement OpenSchema Compatibility APIs #455](https://github.com/apache/incubator-eventmesh/issues/455)
   > 3. Did the management apis implement now?
          Three new subject APIs (schemaregistry/createSubject, /schemaregistry/readSubjectByName and /schemaregistry/showAllSubjectNames) via ClientManageController. The rest of the OpenSchema APIs will be tracked/implemented by individually separated issues and PRs
   > 4. Did the sdk implement now?
         Sorry, do you mean by eventmesh-sdk-java? All OpenSchema APIs are exposed as a RESTful API via webhook in ClientManageController. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-881191164


   > @yzhao244 It might be better to add a new module such like `eventmesh-store-plugin`, and make the `eventmesh-store-h2` as a submodule of `eventmesh-store-plugin`, this makes it easier to manage plugins.
   > 
   > And we have recently enhanced the SPI module #419, you can use `EventMeshExtensionFactory.getExtension(Class<T> extensionType, String extensionName)` to get plugin instance rather than using `ServiceLoader`. You can find some detail of SPI in `eventmesh-connector-rocketmq` module.
   
   @ruanwenjun Thanks for the suggestion. I have made eventmesh-store-h2 as a submodule of eventmesh-store-plugin module  and enhanced my implementation by using EventMeshExtensionFactory.getExtension instead of ServiceLoader. :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882272173


   @yzhao244  hello,I looked at DBDataSource(), this "ds" does not belong to the object. Did you look right?
   ![image](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670977941



##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java
##########
@@ -57,6 +60,10 @@ public void start() throws IOException {
         server.createContext("/clientManage/redirectClientByPath", new RedirectClientByPathHandler(eventMeshTCPServer));
         server.createContext("/clientManage/redirectClientByIpPort", new RedirectClientByIpPortHandler(eventMeshTCPServer));
         server.createContext("/clientManage/showListenClientByTopic", new ShowListenClientByTopicHandler(eventMeshTCPServer));
+        
+        server.createContext("/schemaregistry/createSubject", new CreateSubjectHandler());

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] ruanwenjun commented on pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-886139800


   @yzhao244 Great, you mean if we use `Mysql` then we don't need to consider Scheme synchronization, because all the runtimes connect to the same Mysql.  And if we use a public file system(e.g. NFS) to store h2 persistent file, then we also needn't consider Scheme synchronization, because the h2 help us to the job, am I right?
   By the way, I don't know much about this, but I think your plan is ok. I think you would better send a mail to the community, let more people know your plan, and Apache community believes that all important decision need to be made in mail list.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] qqeasonchen commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-883941369


   > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > 
   > @yzhao244 Hi, I have a question, the h2 is a memory database, it seems doesn't support distributed, how can the different eventmesh-runtime sync the schema change?
   
   
   
   > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   
   1. Eventmesh-store-api can be moved into eventmesh-store-plugin, just like connector.
   2. Did all the apis in the openSchema implement now?
   3. Did the management apis implement now?
   4. Did the sdk implement now?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882649903


   > @yzhao244 hello,I looked at DBDataSource(), this "ds" does not belong to the object. Did you look right?
   > ![image](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   
   You are right, I removed "static" when defining BasicDataSource ds. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-887265813


   @yzhao244    hello,Can the module be tested and used normally now? or still to be modified.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 edited a comment on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 edited a comment on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-884363526


   > > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > > 
   > > 
   > > @yzhao244 Hi, I have a question, the h2 is a memory database, it seems doesn't support distributed, how can the different eventmesh-runtime sync the schema change?
   > 
   > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > 
   
   @qqeasonchen I answered your questions below. :)
    1. Eventmesh-store-api can be moved into eventmesh-store-plugin, just like connector.
          Yes, I have pushed my latest changes which moved Eventmesh-store-api to be under eventmesh-store-plugin.
    2. Did all the apis in the openSchema implement now?
           Not yet, I am thinking it is better delivering OpenSchema Integration in an incremental delivery fashion. :) .. In total, OpenSchema APIs can be seen as three groups.. /subject/ related APIs, /schema/ related APIs, /config/compatibility related APIs which I would suggest to deliver each group by individually separated PRs. The PR 434 currently delivers /subject/ related APIs.
          Three child issues are [Implement OpenSchema Subject APIs #453
   ](https://github.com/apache/incubator-eventmesh/issues/453), [Implement OpenSchema Schema APIs #454](https://github.com/apache/incubator-eventmesh/issues/454), [Implement OpenSchema Compatibility APIs #455](https://github.com/apache/incubator-eventmesh/issues/455)
    3. Did the management apis implement now?
          Three new subject APIs (schemaregistry/createSubject, /schemaregistry/readSubjectByName and /schemaregistry/showAllSubjectNames) via ClientManageController. The rest of the OpenSchema APIs will be tracked/implemented by individually separated issues and PRs
     4. Did the sdk implement now?
         Sorry, do you mean by eventmesh-sdk-java? All OpenSchema APIs are exposed as a RESTful API via webhook in ClientManageController. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] ruanwenjun commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-883931083


   > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   
   @yzhao244 Hi, I have a question, the h2 is a memory database, it seems doesn't support distributed, how can the different eventmesh-runtime sync the schema change?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670975624



##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ServiceLoader;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.runtime.util.NetUtils;
+import org.apache.eventmesh.store.api.openschema.common.ServiceException;
+import org.apache.eventmesh.store.api.openschema.request.SubjectCreateRequest;
+import org.apache.eventmesh.store.api.openschema.response.SubjectResponse;
+import org.apache.eventmesh.store.api.openschema.service.SchemaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+public class CreateSubjectHandler implements HttpHandler {
+	
+	private Logger logger = LoggerFactory.getLogger(CreateSubjectHandler.class);
+	
+	private static ObjectMapper jsonMapper;
+	
+	static {
+        jsonMapper = new ObjectMapper();        
+        jsonMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+        jsonMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+        jsonMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);          
+    }
+	
+    @Override
+    public void handle(HttpExchange httpExchange) throws IOException {
+        String result = "";
+        OutputStream out = httpExchange.getResponseBody();
+        try {
+            String params = NetUtils.parsePostBody(httpExchange);                                
+            SubjectCreateRequest subjectCreateRequest = jsonMapper.readValue(params, SubjectCreateRequest.class);                
+            String subject = subjectCreateRequest.getSubject();
+            
+            if (StringUtils.isBlank(subject)) {
+                result = "Create subject failed. Parameter subject not found.";
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+            SchemaService schemaService = getSchemaService();
+            SubjectResponse subjectResponse = schemaService.createSubject(subjectCreateRequest);
+            if (subjectResponse != null) {
+                logger.info("createTopic subject: {}", subject);                      
+                httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+                httpExchange.sendResponseHeaders(200, 0);
+                result = jsonMapper.writeValueAsString(subjectResponse);                
+                logger.info(result);
+                out.write(result.getBytes());
+                return;
+            } else {
+                httpExchange.sendResponseHeaders(500, 0);
+                result = String.format("create subject failed! Server side error");
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+        } catch (ServiceException e) {            	
+        	httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+            httpExchange.sendResponseHeaders(500, 0);                            
+            result = jsonMapper.writeValueAsString(e.getErrorResponse());
+            logger.error(result);
+            out.write(result.getBytes());
+            return;
+        } finally {
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                    logger.warn("out close failed...", e);
+                }
+            }
+        }
+    }
+    
+    private SchemaService getSchemaService() {

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] ruanwenjun commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879830719


   @yzhao244 It might be better to add a new module such like `eventmesh-store-plugin`, and make the `eventmesh-store-h2` as a submodule of `eventmesh-store-plugin`, this makes it easier to manage plugins.
   
   And we have recently enhanced the SPI module #419, you can use `EventMeshExtensionFactory.getExtension(Class<T> extensionType, String extensionName)` to get plugin instance rather than using `ServiceLoader`. You can find some detail of SPI in `eventmesh-connector-rocketmq` module.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] ruanwenjun commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r669568396



##########
File path: eventmesh-runtime/build.gradle
##########
@@ -29,8 +29,12 @@ List open_message = [
         "io.openmessaging:openmessaging-api:2.2.1-pubsub"
 ]
 
+List h2_database = [

Review comment:
       This dependency should move to `eventmesh-store-h2`.

##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ServiceLoader;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.runtime.util.NetUtils;
+import org.apache.eventmesh.store.api.openschema.common.ServiceException;
+import org.apache.eventmesh.store.api.openschema.request.SubjectCreateRequest;
+import org.apache.eventmesh.store.api.openschema.response.SubjectResponse;
+import org.apache.eventmesh.store.api.openschema.service.SchemaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+public class CreateSubjectHandler implements HttpHandler {
+	
+	private Logger logger = LoggerFactory.getLogger(CreateSubjectHandler.class);
+	
+	private static ObjectMapper jsonMapper;

Review comment:
       It might be better use `JsonUtils` to serialize or deserialize JSON.

##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java
##########
@@ -57,6 +60,10 @@ public void start() throws IOException {
         server.createContext("/clientManage/redirectClientByPath", new RedirectClientByPathHandler(eventMeshTCPServer));
         server.createContext("/clientManage/redirectClientByIpPort", new RedirectClientByIpPortHandler(eventMeshTCPServer));
         server.createContext("/clientManage/showListenClientByTopic", new ShowListenClientByTopicHandler(eventMeshTCPServer));
+        
+        server.createContext("/schemaregistry/createSubject", new CreateSubjectHandler());

Review comment:
       `schemaregistry` should rename to `schemaRegistry`

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/common/ServiceError.java
##########
@@ -0,0 +1,72 @@
+package org.apache.eventmesh.store.api.openschema.common;
+
+public enum ServiceError {
+    /**
+     * 
+     */
+    ERR_SCHEMA_EMPTY("442", 442, "schema info cannot be empty"),
+
+    /**
+     * 
+     */
+    ERR_PERM_NO_AUTH("401", 401, "40101 - no permission to access"),
+
+    /**
+     * 
+     */
+    ERR_SCHEMA_INVALID("404", 404, "40401 - schema information does not exist in our record"),
+    
+    /**
+     * 
+     */
+    ERR_SCHEMA_VERSION_INVALID("404", 404, "40402 - schema version does not exist in our record"),
+    
+    /**
+     * 
+     */
+    ERR_SUBJECT_INVALID("404", 404, "40401 - schema version does not exist in this subject"),
+    
+    /**
+     * 
+     */
+    ERR_SCHEMA_FORMAT_INVALID("422", 422, "40401 - schema format is invalid"),
+    
+    /**
+     * 
+     */
+    ERR_SCHEMA_VERSION_FORMAT_INVALID("422", 422, "40402 - schema version format is invalid"),
+    
+    /**
+     * 
+     */
+    ERR_SERVER_ERROR("500", 500, "I50001 -  Internal Server Error"),
+
+    /**
+     * resource level error definitions
+     */
+    ERR_RES_NOT_FOUND("500", 500, "50002 - Request Timeout");
+
+    private String status;

Review comment:
       The `status` seems to be redundant.

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/BaseRequest.java
##########
@@ -0,0 +1,19 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class BaseRequest {
+	
+	private String id;
+	
+	@JsonProperty("id")

Review comment:
       `@JsonProperty("id")` can remove

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/common/ServiceException.java
##########
@@ -0,0 +1,50 @@
+package org.apache.eventmesh.store.api.openschema.common;
+
+
+import org.apache.eventmesh.store.api.openschema.response.ErrorResponse;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ServiceException extends Exception {
+      private static final long serialVersionUID = 1L;
+      
+	  private int errorCode;
+	  private String errorMessage;
+
+	  //public ErrorResponse(@JsonProperty("error_code") int errorCode,
+	  //                     @JsonProperty("error_message") String errorMessage) {
+	  public ServiceException(ServiceError serviceError) {		  
+		super(serviceError.getMessage());
+	    this.errorCode = serviceError.getErrorCode();
+	    this.errorMessage = serviceError.getMessage();
+	  }
+
+	  @JsonProperty("error_code")
+	  public int getErrorCode() {
+	    return errorCode;
+	  }
+
+	  @JsonProperty("error_code")
+	  public void setErrorCode(int error_code) {

Review comment:
       Use Camel-Case, rename to errorCode

##########
File path: eventmesh-store-h2/src/main/java/org/apache/eventmesh/store/h2/schema/util/DBDataSource.java
##########
@@ -0,0 +1,42 @@
+package org.apache.eventmesh.store.h2.schema.util;
+
+import org.apache.eventmesh.store.h2.schema.configuration.DBConfiguration;
+import org.apache.commons.dbcp2.BasicDataSource;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class DBDataSource {
+    private static BasicDataSource ds = null;
+
+    private DBDataSource() {
+
+    }
+
+    public static synchronized DBDataSource createDataSource(DBConfiguration dbConfig) {

Review comment:
       The `DBDataSource` is singleton? 

##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;

Review comment:
       Add license header here.

##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ServiceLoader;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.runtime.util.NetUtils;
+import org.apache.eventmesh.store.api.openschema.common.ServiceException;
+import org.apache.eventmesh.store.api.openschema.request.SubjectCreateRequest;
+import org.apache.eventmesh.store.api.openschema.response.SubjectResponse;
+import org.apache.eventmesh.store.api.openschema.service.SchemaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+public class CreateSubjectHandler implements HttpHandler {
+	
+	private Logger logger = LoggerFactory.getLogger(CreateSubjectHandler.class);
+	
+	private static ObjectMapper jsonMapper;
+	
+	static {
+        jsonMapper = new ObjectMapper();        
+        jsonMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+        jsonMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+        jsonMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);          
+    }
+	
+    @Override
+    public void handle(HttpExchange httpExchange) throws IOException {
+        String result = "";
+        OutputStream out = httpExchange.getResponseBody();
+        try {
+            String params = NetUtils.parsePostBody(httpExchange);                                
+            SubjectCreateRequest subjectCreateRequest = jsonMapper.readValue(params, SubjectCreateRequest.class);                
+            String subject = subjectCreateRequest.getSubject();
+            
+            if (StringUtils.isBlank(subject)) {
+                result = "Create subject failed. Parameter subject not found.";
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+            SchemaService schemaService = getSchemaService();
+            SubjectResponse subjectResponse = schemaService.createSubject(subjectCreateRequest);
+            if (subjectResponse != null) {
+                logger.info("createTopic subject: {}", subject);                      
+                httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+                httpExchange.sendResponseHeaders(200, 0);
+                result = jsonMapper.writeValueAsString(subjectResponse);                
+                logger.info(result);
+                out.write(result.getBytes());
+                return;
+            } else {
+                httpExchange.sendResponseHeaders(500, 0);
+                result = String.format("create subject failed! Server side error");
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+        } catch (ServiceException e) {            	
+        	httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+            httpExchange.sendResponseHeaders(500, 0);                            
+            result = jsonMapper.writeValueAsString(e.getErrorResponse());
+            logger.error(result);
+            out.write(result.getBytes());
+            return;
+        } finally {
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                    logger.warn("out close failed...", e);
+                }
+            }
+        }
+    }
+    
+    private SchemaService getSchemaService() {

Review comment:
       Use EventMeshExtensionFactory to load plugin, by the way, there may cause NPE.

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/common/CompatibilityLevel.java
##########
@@ -0,0 +1,42 @@
+package org.apache.eventmesh.store.api.openschema.common;
+
+public enum CompatibilityLevel {
+	  NONE,
+	  BACKWARD,
+	  BACKWARD_TRANSITIVE,
+	  FORWARD,
+	  FORWARD_TRANSITIVE,
+	  FULL,
+	  FULL_TRANSITIVE;
+
+	  public final String name;

Review comment:
       This attribute seems to be redundant if the name just represent name().

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/ConfigUpdateRequest.java
##########
@@ -0,0 +1,26 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ConfigUpdateRequest {
+
+	  private String compatibilityLevel;
+
+	 /* @ApiModelProperty(value = "Compatability Level",

Review comment:
       Remove unused code.

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/SchemaCreateRequest.java
##########
@@ -0,0 +1,124 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SchemaCreateRequest extends BaseRequest{
+	
+	  private String name;
+	  private String comment;
+	  private String serialization;
+	  private String schemaType;
+	  private String schemaDefinition;
+	  private String validator;
+	  private String version;	   
+	  
+	  @JsonCreator
+	  public SchemaCreateRequest(@JsonProperty("name") String name,

Review comment:
       Remove `@JsonCreator` and `@JsonProperty`

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/CompatibilityCheckRequest.java
##########
@@ -0,0 +1,23 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class CompatibilityCheckRequest {
+	
+	private String schema;
+	
+	@JsonProperty("schema")

Review comment:
       `@JsonProperty("id")` can remove

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/ConfigUpdateRequest.java
##########
@@ -0,0 +1,26 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ConfigUpdateRequest {
+
+	  private String compatibilityLevel;
+
+	 /* @ApiModelProperty(value = "Compatability Level",
+	      allowableValues = "BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, "
+	          + "FULL_TRANSITIVE, NONE")*/
+	  @JsonProperty("compatibility")

Review comment:
       It might make confusion why the returned attribute don't match.

##########
File path: eventmesh-store-api/build.gradle
##########
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+

Review comment:
       Keep only one empty line.

##########
File path: eventmesh-store-api/gradle.properties
##########
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+group=org.apache.eventmesh
+version=1.2.0-SNAPSHOT
+jdk=1.7

Review comment:
       Use jdk 1.8

##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ServiceLoader;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.runtime.util.NetUtils;
+import org.apache.eventmesh.store.api.openschema.common.ServiceException;
+import org.apache.eventmesh.store.api.openschema.request.SubjectCreateRequest;
+import org.apache.eventmesh.store.api.openschema.response.SubjectResponse;
+import org.apache.eventmesh.store.api.openschema.service.SchemaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+public class CreateSubjectHandler implements HttpHandler {
+	
+	private Logger logger = LoggerFactory.getLogger(CreateSubjectHandler.class);
+	
+	private static ObjectMapper jsonMapper;
+	
+	static {
+        jsonMapper = new ObjectMapper();        
+        jsonMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+        jsonMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+        jsonMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);          
+    }
+	
+    @Override
+    public void handle(HttpExchange httpExchange) throws IOException {
+        String result = "";
+        OutputStream out = httpExchange.getResponseBody();
+        try {
+            String params = NetUtils.parsePostBody(httpExchange);                                
+            SubjectCreateRequest subjectCreateRequest = jsonMapper.readValue(params, SubjectCreateRequest.class);                
+            String subject = subjectCreateRequest.getSubject();
+            
+            if (StringUtils.isBlank(subject)) {
+                result = "Create subject failed. Parameter subject not found.";
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+            SchemaService schemaService = getSchemaService();
+            SubjectResponse subjectResponse = schemaService.createSubject(subjectCreateRequest);
+            if (subjectResponse != null) {
+                logger.info("createTopic subject: {}", subject);                      
+                httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+                httpExchange.sendResponseHeaders(200, 0);
+                result = jsonMapper.writeValueAsString(subjectResponse);                
+                logger.info(result);
+                out.write(result.getBytes());
+                return;
+            } else {
+                httpExchange.sendResponseHeaders(500, 0);
+                result = String.format("create subject failed! Server side error");
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+        } catch (ServiceException e) {            	
+        	httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+            httpExchange.sendResponseHeaders(500, 0);                            
+            result = jsonMapper.writeValueAsString(e.getErrorResponse());
+            logger.error(result);
+            out.write(result.getBytes());
+            return;
+        } finally {

Review comment:
       Use try with resource instead of try finally

##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/BaseRequest.java
##########
@@ -0,0 +1,19 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class BaseRequest {

Review comment:
       The request might implement `Serializable`

##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/constants/EventMeshConstants.java
##########
@@ -112,5 +112,7 @@
     public static final String LEAVE_TIME = "LEAVE_TIME";            //leaveBrokerTime
     public static final String ARRIVE_TIME = "ARRIVE_TIME";
     public static final String STORE_TIME = "STORE_TIME";
-
+    
+    public static final String MANAGE_SCHEMA_SUBJECT = "subject";

Review comment:
       The meaning of `subject` seems unclear. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] qqeasonchen commented on pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-888052897


   @yzhao244 That would be good if the desing was clear.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882649903


   > @yzhao244 hello,I looked at DBDataSource(), this "ds" does not belong to the object. Did you look right?
   > ![image](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   
   You are right, I removed "static" when defining BasicDataSource ds. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882987258


   > > @yzhao244你好,我看了DBDataSource(),这个“ds”不属于对象。你看对了吗?
   > > ![图像](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   > 
   > 你是对的,我在定义 BasicDataSource ds 时删除了“静态”。
   Thanks! I will try again
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882987258


   > > @yzhao244你好,我看了DBDataSource(),这个“ds”不属于对象。你看对了吗?
   > > ![图像](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   > 
   > 你是对的,我在定义 BasicDataSource ds 时删除了“静态”。
   Thanks! I will try again
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] qqeasonchen commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879561794


   @yzhao244 License check seems failed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670977852



##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;

Review comment:
       fixed license header




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 edited a comment on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 edited a comment on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-881245517


   @yzhao244  hello,I found a problem with createDataSource. First, the new H2SchemaAdapter is initialized.
   ![image](https://user-images.githubusercontent.com/35483870/125909606-06ab9b5e-1b6c-4313-b4b7-30db84c0bf42.png)
   DBDataSource.createDataSource(dbConfig) in the start() method.
   There should be a problem with the createDataSource() method. For example: ds, new DBDataSource(). It is different from other methods of creating data sources.   
   ![image](https://user-images.githubusercontent.com/35483870/125909797-080420a9-1b82-4fc7-bf12-7ac570cf5a2a.png)
   ![image](https://user-images.githubusercontent.com/35483870/125911314-a69c5b73-2d8b-4bfe-bc19-cff637521efa.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] codecov-commenter edited a comment on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879511284


   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#434](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d490f04) into [develop](https://codecov.io/gh/apache/incubator-eventmesh/commit/d8ac875e58f0f77458fe0e3373cc408594466b1f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d8ac875) will **decrease** coverage by `0.11%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/graphs/tree.svg?width=650&height=150&src=pr&token=IfkrgV55GT&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             develop    #434      +/-   ##
   ============================================
   - Coverage       8.49%   8.38%   -0.12%     
     Complexity       256     256              
   ============================================
     Files            228     231       +3     
     Lines          10783   10930     +147     
     Branches         918     932      +14     
   ============================================
     Hits             916     916              
   - Misses          9793    9940     +147     
     Partials          74      74              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntime/admin/controller/ClientManageController.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2NvbnRyb2xsZXIvQ2xpZW50TWFuYWdlQ29udHJvbGxlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...sh/runtime/admin/handler/CreateSubjectHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvQ3JlYXRlU3ViamVjdEhhbmRsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...untime/admin/handler/ReadSubjectByNameHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvUmVhZFN1YmplY3RCeU5hbWVIYW5kbGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...time/admin/handler/ShowAllSubjectNamesHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvU2hvd0FsbFN1YmplY3ROYW1lc0hhbmRsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...apache/eventmesh/runtime/boot/EventMeshServer.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2Jvb3QvRXZlbnRNZXNoU2VydmVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ventmesh/runtime/constants/EventMeshConstants.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvbnN0YW50cy9FdmVudE1lc2hDb25zdGFudHMuamF2YQ==) | `0.00% <ø> (ø)` | |
   | [...va/org/apache/eventmesh/runtime/util/NetUtils.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL3V0aWwvTmV0VXRpbHMuamF2YQ==) | `9.67% <0.00%> (-2.83%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d8ac875...d490f04](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670974544



##########
File path: eventmesh-store-h2/src/main/java/org/apache/eventmesh/store/h2/schema/util/DBDataSource.java
##########
@@ -0,0 +1,42 @@
+package org.apache.eventmesh.store.h2.schema.util;
+
+import org.apache.eventmesh.store.h2.schema.configuration.DBConfiguration;
+import org.apache.commons.dbcp2.BasicDataSource;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class DBDataSource {
+    private static BasicDataSource ds = null;
+
+    private DBDataSource() {
+
+    }
+
+    public static synchronized DBDataSource createDataSource(DBConfiguration dbConfig) {

Review comment:
       Yes, DBDataSource is singleton. Basically, it performs init, start and shutdown as part of EventMeshServer init, start and shutdown process. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] qqeasonchen commented on pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-887969755


   @yzhao244 Could you please submmit this feature to branch openschema? i think eventmesh-rest can be merged to develop first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] qqeasonchen commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879846369


   > @yzhao244 It might be better to add a new module such like `eventmesh-store-plugin`, and make the `eventmesh-store-h2` as a submodule of `eventmesh-store-plugin`, this makes it easier to manage plugins.
   > 
   > And we have recently enhanced the SPI module #419, you can use `EventMeshExtensionFactory.getExtension(Class<T> extensionType, String extensionName)` to get plugin instance rather than using `ServiceLoader`. You can find some detail of SPI in `eventmesh-connector-rocketmq` module.
   
   yes, @ruanwenjun It seems also needs a eventmesh-connector-plugin moudle.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-880182264


   @qqeasonchen @ruanwenjun Thanks a lot for the review comments. I will start to address them :) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r671396721



##########
File path: eventmesh-store-api/gradle.properties
##########
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+group=org.apache.eventmesh
+version=1.2.0-SNAPSHOT
+jdk=1.7

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879284420


   - POST http://localhost:10106/schemaregistry/createSubject
   The following is the payload of creating a new subject 
   ```
   {
   	"subject": "test-topic",
   	"namespace": "org.apache.rocketmq",
   	"tenant": "messaging/rocketmq",
   	"app": "rocketmq",
   	"description": "rocketmq user information",
   	"compatibility": "NONE",
   	"status": "deprecated"
   }
   ```
   - GET http://localhost:10106/schemaregistry/readSubjectByName?subject=test-topic
   - GET http://localhost:10106/schemaregistry/showAllSubjectNames
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-881185972


   
   
   
   
   > Hello, @yzhao244 ! I looked interface at the development, it seems that some interfaces are missing. I refer to https://github.com/openmessaging/openschema/blob/master/spec.md
   > for instance:
   > 7.1.2
   > 7.2.4
   > 7.2.6
   > 7.2.7
   
   @Jackzeng1224 Thanks for the question.  Yes, you are right. The current commit so far only contains three Subject related APIs such as create subject, readySubjectbyname and showAllSubjects which have been mentioned in my first comment of this PR. :) . However, I am going to implement the rest of missing interfaces as soon as we are okay with the new modules(eventmesh-store-api and eventmesh-store-plugin), because I can follow new modules standards to code/implement the rest of interfaces. lol  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-884039945


   @yzhao244  hello,this problem occurs with the new receiving code.  "configurationWraper"  or "configurationWrapper"?
   ![image](https://user-images.githubusercontent.com/35483870/126466128-a36369d5-990b-45dd-9e3b-a8e613f966f1.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] codecov-commenter commented on pull request #434: OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879511284


   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#434](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e7c33c1) into [develop](https://codecov.io/gh/apache/incubator-eventmesh/commit/d8ac875e58f0f77458fe0e3373cc408594466b1f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d8ac875) will **decrease** coverage by `0.11%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/graphs/tree.svg?width=650&height=150&src=pr&token=IfkrgV55GT&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             develop    #434      +/-   ##
   ============================================
   - Coverage       8.49%   8.38%   -0.12%     
     Complexity       256     256              
   ============================================
     Files            228     231       +3     
     Lines          10783   10930     +147     
     Branches         918     932      +14     
   ============================================
     Hits             916     916              
   - Misses          9793    9940     +147     
     Partials          74      74              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntime/admin/controller/ClientManageController.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2NvbnRyb2xsZXIvQ2xpZW50TWFuYWdlQ29udHJvbGxlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...sh/runtime/admin/handler/CreateSubjectHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvQ3JlYXRlU3ViamVjdEhhbmRsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...untime/admin/handler/ReadSubjectByNameHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvUmVhZFN1YmplY3RCeU5hbWVIYW5kbGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...time/admin/handler/ShowAllSubjectNamesHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvU2hvd0FsbFN1YmplY3ROYW1lc0hhbmRsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...apache/eventmesh/runtime/boot/EventMeshServer.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2Jvb3QvRXZlbnRNZXNoU2VydmVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ventmesh/runtime/constants/EventMeshConstants.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvbnN0YW50cy9FdmVudE1lc2hDb25zdGFudHMuamF2YQ==) | `0.00% <ø> (ø)` | |
   | [...va/org/apache/eventmesh/runtime/util/NetUtils.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/434/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL3V0aWwvTmV0VXRpbHMuamF2YQ==) | `9.67% <0.00%> (-2.83%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d8ac875...e7c33c1](https://codecov.io/gh/apache/incubator-eventmesh/pull/434?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670977696



##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ServiceLoader;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.runtime.util.NetUtils;
+import org.apache.eventmesh.store.api.openschema.common.ServiceException;
+import org.apache.eventmesh.store.api.openschema.request.SubjectCreateRequest;
+import org.apache.eventmesh.store.api.openschema.response.SubjectResponse;
+import org.apache.eventmesh.store.api.openschema.service.SchemaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+public class CreateSubjectHandler implements HttpHandler {
+	
+	private Logger logger = LoggerFactory.getLogger(CreateSubjectHandler.class);
+	
+	private static ObjectMapper jsonMapper;
+	
+	static {
+        jsonMapper = new ObjectMapper();        
+        jsonMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+        jsonMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+        jsonMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);          
+    }
+	
+    @Override
+    public void handle(HttpExchange httpExchange) throws IOException {
+        String result = "";
+        OutputStream out = httpExchange.getResponseBody();
+        try {
+            String params = NetUtils.parsePostBody(httpExchange);                                
+            SubjectCreateRequest subjectCreateRequest = jsonMapper.readValue(params, SubjectCreateRequest.class);                
+            String subject = subjectCreateRequest.getSubject();
+            
+            if (StringUtils.isBlank(subject)) {
+                result = "Create subject failed. Parameter subject not found.";
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+            SchemaService schemaService = getSchemaService();
+            SubjectResponse subjectResponse = schemaService.createSubject(subjectCreateRequest);
+            if (subjectResponse != null) {
+                logger.info("createTopic subject: {}", subject);                      
+                httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+                httpExchange.sendResponseHeaders(200, 0);
+                result = jsonMapper.writeValueAsString(subjectResponse);                
+                logger.info(result);
+                out.write(result.getBytes());
+                return;
+            } else {
+                httpExchange.sendResponseHeaders(500, 0);
+                result = String.format("create subject failed! Server side error");
+                logger.error(result);
+                out.write(result.getBytes());
+                return;
+            }
+        } catch (ServiceException e) {            	
+        	httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+            httpExchange.sendResponseHeaders(500, 0);                            
+            result = jsonMapper.writeValueAsString(e.getErrorResponse());
+            logger.error(result);
+            out.write(result.getBytes());
+            return;
+        } finally {

Review comment:
       In catch block, out.write(result.getBytes()); is used to return error response.. Therefore, out.write(result.getBytes()) becomes undefined if defining "OutputStream out" using Try with resource 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882987258


   > > @yzhao244你好,我看了DBDataSource(),这个“ds”不属于对象。你看对了吗?
   > > ![图像](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   > 
   > 你是对的,我在定义 BasicDataSource ds 时删除了“静态”。
   Thanks! I will try again
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-881135896


   Hello, @yzhao244 !  I looked  interface at the development, it seems that some interfaces are missing. I refer to https://github.com/openmessaging/openschema/blob/master/spec.md
   for instance: 
       7.1.2 
       7.2.4 
       7.2.6 
       7.2.7 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] qqeasonchen commented on pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-887958530


   @yzhao244 hi, I suggest split this pr into several small ones, so that it can easily be reviewed and merged, for example, eventmesh-rest、eventmesh-store-api、eventmesh-store-h2 ect.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-884370419


   > > @qqeasonchen @ruanwenjun Hi guys, do you have any concerns before merging this PR? Please let me know if I missed anything here. :)
   > 
   > @yzhao244 Hi, I have a question, the h2 is a memory database, it seems doesn't support distributed, how can the different eventmesh-runtime sync the schema change?
   
   very good question.. Actually, h2 can be turned into a persistent database by using the following example configuration (datasource.url=jdbc:h2:file:~/subdirectory/demodb) which persists data in file system. 
   Additionally,  database configuration/url can be easily changed to point to any MySQL database service as an example based on end-user's choice for different eventmesh-runtime instances to sync the schema change.  I am thinking to create separate issue for tracking documentation works for OpenSchema Integration and h2 plugin module. 
   ![image](https://user-images.githubusercontent.com/15642771/126534383-3cdcf93b-3594-4d24-b22a-9e31e8a0421e.png)
     


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670128605



##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ServiceLoader;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.runtime.util.NetUtils;
+import org.apache.eventmesh.store.api.openschema.common.ServiceException;
+import org.apache.eventmesh.store.api.openschema.request.SubjectCreateRequest;
+import org.apache.eventmesh.store.api.openschema.response.SubjectResponse;
+import org.apache.eventmesh.store.api.openschema.service.SchemaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+public class CreateSubjectHandler implements HttpHandler {
+	
+	private Logger logger = LoggerFactory.getLogger(CreateSubjectHandler.class);
+	
+	private static ObjectMapper jsonMapper;

Review comment:
       @ruanwenjun just to confirm :) .. do you mean by creating a new utility class called "JsonUtils" under path (org.apache.eventmesh.runtime.util) which leverages ObjectMapper for JSON serialization or deserialization? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] ruanwenjun commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670156049



##########
File path: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/CreateSubjectHandler.java
##########
@@ -0,0 +1,94 @@
+package org.apache.eventmesh.runtime.admin.handler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ServiceLoader;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.eventmesh.runtime.util.NetUtils;
+import org.apache.eventmesh.store.api.openschema.common.ServiceException;
+import org.apache.eventmesh.store.api.openschema.request.SubjectCreateRequest;
+import org.apache.eventmesh.store.api.openschema.response.SubjectResponse;
+import org.apache.eventmesh.store.api.openschema.service.SchemaService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+public class CreateSubjectHandler implements HttpHandler {
+	
+	private Logger logger = LoggerFactory.getLogger(CreateSubjectHandler.class);
+	
+	private static ObjectMapper jsonMapper;

Review comment:
       Maybe it can be placed at common module




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882649903


   > @yzhao244 hello,I looked at DBDataSource(), this "ds" does not belong to the object. Did you look right?
   > ![image](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   
   You are right, I removed "static" when defining BasicDataSource ds. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 edited a comment on pull request #434: OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 edited a comment on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879284420


   - POST http://localhost:10106/schemaregistry/createSubject
   The following is the payload of creating a new subject 
   ```
   {
   	"subject": "test-topic",
   	"namespace": "org.apache.rocketmq",
   	"tenant": "messaging/rocketmq",
   	"app": "rocketmq",
   	"description": "rocketmq user information",
   	"compatibility": "NONE",
   	"status": "deprecated"
   }
   ```
   - GET http://localhost:10106/schemaregistry/readSubjectByName?subject=test-topic
   - GET http://localhost:10106/schemaregistry/showAllSubjectNames
   
   As shown above, the above APIs are not very closely following best practice of REST APIs. Therefore, I have proposed in the issue #339 to restify the EventMesh Schema Registry APIs by adding a new module. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 edited a comment on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 edited a comment on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-882987258


   > > @yzhao244 hello,I looked at DBDataSource(), this "ds" does not belong to the object. Did you look right?
   > > ![图像](https://user-images.githubusercontent.com/35483870/126111657-05d2d6f8-04c8-4cd1-b102-7aefcc648174.png)
   > 
   > You are right, I removed "static" when defining BasicDataSource ds.
   Thanks! I will try again
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] Jackzeng1224 commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
Jackzeng1224 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-881245517


   @yzhao244  hello,I found a problem with createDataSource. First, the new H2SchemaAdapter is initialized.
   ![image](https://user-images.githubusercontent.com/35483870/125909606-06ab9b5e-1b6c-4313-b4b7-30db84c0bf42.png)
   DBDataSource.createDataSource(dbConfig) in the start() method.
   There should be a problem with the createDataSource() method. For example: ds, new DBDataSource(). It is different from other methods of creating data sources.
   ![image](https://user-images.githubusercontent.com/35483870/125909797-080420a9-1b82-4fc7-bf12-7ac570cf5a2a.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-887992047


   @qqeasonchen @Jackzeng1224 @ruanwenjun Hi guys, I agree with @qqeasonchen that splitting this pr into smaller ones will be easier and safer for reviewing and merging each individual plugin/module. Therefore, I am thinking to close this PR and will submit separate PRs for each module after some modifications. 
   
   Additionally, @ruanwenjun brought a good point regarding decision-making of important design. Should I create a design doc and push it to https://github.com/apache/incubator-eventmesh/tree/develop/docs/en/features (similar as eventmesh-stream-design.md which explains design in details and gets the whole community's awareness instead of only explaining designs under an issue) :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 commented on a change in pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 commented on a change in pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#discussion_r670975487



##########
File path: eventmesh-store-api/src/main/java/org/apache/eventmesh/store/api/openschema/request/ConfigUpdateRequest.java
##########
@@ -0,0 +1,26 @@
+package org.apache.eventmesh.store.api.openschema.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ConfigUpdateRequest {
+
+	  private String compatibilityLevel;
+
+	 /* @ApiModelProperty(value = "Compatability Level",

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] yzhao244 closed pull request #434: [ISSUE #453] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
yzhao244 closed pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [incubator-eventmesh] ruanwenjun commented on pull request #434: [ISSUE #339] OpenSchema integration with EventMesh

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on pull request #434:
URL: https://github.com/apache/incubator-eventmesh/pull/434#issuecomment-879917620


   @qqeasonchen You are right, the `eventmesh-connector-plugin` is at this pr #433 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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