xwm1992 commented on a change in pull request #572:
URL:
https://github.com/apache/incubator-eventmesh/pull/572#discussion_r737216384
##########
File path:
eventmesh-protocol-plugin/eventmesh-protocol-openmessage/src/main/java/org/apache/eventmesh/protocol/openmessage/OpenMessageProtocolAdaptor.java
##########
@@ -0,0 +1,32 @@
+package org.apache.eventmesh.protocol.openmessage;
+
+import org.apache.eventmesh.protocol.api.ProtocolAdaptor;
+import org.apache.eventmesh.protocol.api.ProtocolType;
+
+import io.cloudevents.CloudEvent;
+import io.cloudevents.core.v1.CloudEventV1;
+import io.openmessaging.api.Message;
+
+/**
+ * OpenMessage protocol adaptor, used to transform protocol between
+ * {@link CloudEvent} with {@link Message}.
+ *
+ * @since 1.3.0
+ */
+public class OpenMessageProtocolAdaptor implements ProtocolAdaptor<Message> {
+
+ @Override
+ public CloudEventV1 toCloudEventV1(Message message) {
+ return null;
+ }
+
+ @Override
+ public Message fromCloudEventV1(CloudEventV1 cloudEvent) {
Review comment:
return value should be `package`
##########
File path:
eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/CloudEventProtocolAdaptor.java
##########
@@ -0,0 +1,24 @@
+package org.apache.eventmesh.protocol.cloudevents;
+
+import org.apache.eventmesh.protocol.api.ProtocolAdaptor;
+import org.apache.eventmesh.protocol.api.ProtocolType;
+
+import io.cloudevents.core.v1.CloudEventV1;
+
+public class CloudEventProtocolAdaptor implements
ProtocolAdaptor<CloudEventV1> {
+
+ @Override
+ public CloudEventV1 toCloudEventV1(CloudEventV1 cloudEvent) {
Review comment:
input parameter should be `package`
##########
File path:
eventmesh-protocol-plugin/eventmesh-protocol-openmessage/src/main/java/org/apache/eventmesh/protocol/openmessage/OpenMessageProtocolAdaptor.java
##########
@@ -0,0 +1,32 @@
+package org.apache.eventmesh.protocol.openmessage;
+
+import org.apache.eventmesh.protocol.api.ProtocolAdaptor;
+import org.apache.eventmesh.protocol.api.ProtocolType;
+
+import io.cloudevents.CloudEvent;
+import io.cloudevents.core.v1.CloudEventV1;
+import io.openmessaging.api.Message;
+
+/**
+ * OpenMessage protocol adaptor, used to transform protocol between
+ * {@link CloudEvent} with {@link Message}.
+ *
+ * @since 1.3.0
+ */
+public class OpenMessageProtocolAdaptor implements ProtocolAdaptor<Message> {
+
+ @Override
+ public CloudEventV1 toCloudEventV1(Message message) {
Review comment:
Here we may change the input parameters to `package`
##########
File path:
eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/CloudEventProtocolAdaptor.java
##########
@@ -0,0 +1,24 @@
+package org.apache.eventmesh.protocol.cloudevents;
+
+import org.apache.eventmesh.protocol.api.ProtocolAdaptor;
+import org.apache.eventmesh.protocol.api.ProtocolType;
+
+import io.cloudevents.core.v1.CloudEventV1;
+
+public class CloudEventProtocolAdaptor implements
ProtocolAdaptor<CloudEventV1> {
+
+ @Override
+ public CloudEventV1 toCloudEventV1(CloudEventV1 cloudEvent) {
+ return cloudEvent;
+ }
+
+ @Override
+ public CloudEventV1 fromCloudEventV1(CloudEventV1 cloudEvent) {
Review comment:
return value should be `package`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]