All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.godmao.mqbroker.message.SingleMessage Maven / Gradle / Ivy

There is a newer version: 0.2.7.RELEASE
Show newest version
package com.godmao.mqbroker.message;


/**
 * 服务器消息 - 单服务消息
 */

public class SingleMessage {
    public static final byte cmd = 10;

    private SingleMessage() {
    }

    public static class Request {
        private final byte   model; // 消息模型  1 负载均衡/默认轮训策略/LOADBALANCE  2 广播/BROADCASTING
        private final long   delay; // 延时
        private final String topic; // 主题
        private final byte[] data;  // 消息

        public Request(byte model, long delay, String topic, byte[] data) {
            this.model = model;
            this.delay = delay;
            this.topic = topic;
            this.data = data;
        }

        public byte getModel() {
            return model;
        }

        public long getDelay() {
            return delay;
        }

        public String getTopic() {
            return topic;
        }

        public byte[] getData() {
            return data;
        }

        public byte getCmd() {
            return cmd;
        }
    }

    public static class Response {
        private final String topic; // 主题
        private final byte[] data;  // 消息

        public Response(String topic, byte[] data) {
            this.topic = topic;
            this.data = data;
        }

        public String getTopic() {
            return topic;
        }

        public byte[] getData() {
            return data;
        }


        public byte getCmd() {
            return cmd;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy