Skip to content

Commit

Permalink
move constant OPEN_MESSAGE_PROTOCOL_NAME to EventMeshCommon.clss
Browse files Browse the repository at this point in the history
  • Loading branch information
scwlkq committed Feb 22, 2024
1 parent a64c5d3 commit d751223
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ public class EventMeshCommon {
public static final int DEFAULT_TIME_OUT_MILLS = 20 * 1000;

public static final String EM_MESSAGE_PROTOCOL_NAME = "eventmeshmessage";

public static final String OPEN_MESSAGE_PROTOCOL_NAME = "openmessage";
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,15 @@

public class MessageUtils {

private static final int SEQ_LENGTH = 10;

/**
* USERAGENT for PUB
*/
public static final String USER_AGENT_PURPOSE_PUB = "pub";

/**
* USERAGENT for SUB
*/
public static final String USER_AGENT_PURPOSE_SUB = "sub";

public static final String OPEN_MESSAGE_PROTOCOL_NAME = "openmessage";
private static final int SEQ_LENGTH = 10;

public static Package hello(UserAgent user) {
final Package msg = getPackage(Command.HELLO_REQUEST);
Expand Down Expand Up @@ -110,7 +106,7 @@ public static Package buildPackage(Object message, Command command) {
msg.getHeader().putProperty(Constants.PROTOCOL_DESC, "tcp");
msg.setBody(message);
} else if (message instanceof Message) {
msg.getHeader().putProperty(Constants.PROTOCOL_TYPE, OPEN_MESSAGE_PROTOCOL_NAME);
msg.getHeader().putProperty(Constants.PROTOCOL_TYPE, EventMeshCommon.OPEN_MESSAGE_PROTOCOL_NAME);
// todo: this version need to be confirmed.
msg.getHeader().putProperty(Constants.PROTOCOL_VERSION, SpecVersion.V1.toString());
} else {
Expand Down

0 comments on commit d751223

Please sign in to comment.