Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change TCP Decoder and Encoder #621

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,16 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class EventMeshMessage {

private String topic;
Map<String, String> properties = new ConcurrentHashMap<>();
private String body;

public EventMeshMessage() {
}

public EventMeshMessage(String topic, Map<String, String> properties, String body) {
this.topic = topic;
this.properties = properties;
this.body = body;
}

public String getTopic() {
return topic;
}
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

public void setTopic(String topic) {
this.topic = topic;
}

public Map<String, String> getProperties() {
return properties;
}

public void setProperties(Map<String, String> properties) {
this.properties = properties;
}

public String getBody() {
return body;
}

public void setBody(String body) {
this.body = body;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EventMeshMessage {

@Override
public String toString() {
return "EventMeshMessage{" +
"topic='" + topic + '\'' +
", properties=" + properties +
", body='" + body + '\'' +
'}';
}
private String topic;
private Map<String, String> properties = new ConcurrentHashMap<>();
private String body;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
import java.util.HashMap;
import java.util.Map;

import lombok.Data;

@Data
public class Header {

private Command cmd;
private int code;
private String desc;
private String seq;
private Map<String, Object> properties;
private Command cmd;
private int code;
private String desc;
private String seq;
private Map<String, Object> properties = new HashMap<>();

public Header() {
}
Expand All @@ -45,6 +48,7 @@ public Header(int code, String desc, String seq, Map<String, Object> properties)
this.properties = properties;
}


public Command getCommand() {
return cmd;
}
Expand Down Expand Up @@ -97,18 +101,7 @@ public Object getProperty(final String name) {
if (null == this.properties) {
this.properties = new HashMap<>();
}

return this.properties.get(name);
}

@Override
public String toString() {
return "Header{" +
"cmd=" + cmd +
", code=" + code +
", desc='" + desc + '\'' +
", seq='" + seq + '\'' +
", properties=" + properties +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,20 @@

import org.apache.eventmesh.common.protocol.ProtocolTransportObject;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Package implements ProtocolTransportObject {

private Header header;
private Object body;

public Package() {
}

public Package(Header header) {
this.header = header;
}

public Package(Header header, Object body) {
this.header = header;
this.body = body;
}
}
Loading