WebsocketConstants.java 1.1 KB
package com.huaheng.pc.stompwebsocket;
/**
 * @author
 */
public class WebsocketConstants {
    //{服务端最小心跳间隔,期望客户端的心跳间隔}
    public final static long[] HEART_BEAT = new long[]{1000000, 50000};

    //公共话题代理名称
    public final static String BROKER_TOPIC = "/topic";

    //点对点消息代理名称
    public final static String BROKER_QUEUE = "/queue";

    //点对点消息的用户前缀,终端订阅时要加上该前缀
    public final static String USER_PRIFIX = "/user";

    //终端通过websocket上行的MessageMapping前缀
    public final static String APP_PRIFIX = "/app";

    //建立websocket握手的http地址
    public final static String ENDPOINT = "/endpoint";

    //定义一个message类型的公共话题: /topic/message
    //终端订阅公共话题的路径:
    public final static String TOPIC_MESSAGE = BROKER_TOPIC + "/message";

    //定义一个message类型的点对点话题(暂时无用)
    public final static String QUEUE_MESSAGE = BROKER_QUEUE + "/message";

    public final static String HEADER_MEG_ID = "msg-id";
}