xin.alum.aim.constant.AIMConstant Maven / Gradle / Ivy
/*
* Copyright 2013-2019 Xia Jun([email protected]).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
***************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
*/
package xin.alum.aim.constant;
/**
* 常量
*/
public interface AIMConstant {
/**
* 应用服务名称
*/
String PROJECT_NAME = "AIM";
/**
* 集群配置前缀
*/
String CLUSTER_PROPERTIES_PREFIX = "alum.aim.cluster";
/**
* 集群配置名称
*/
String CLUSTER_PROPERTIES_MODE = "mode";
/**
* 消息头长度为字节数,第一个字节为消息类型,第二,第三字节 转换int后为消息长度
*/
int DATA_HEADER_LENGTH = 8;
int DATA_TYPE_PONG = 0;
int DATA_TYPE_PING = 1;
int DATA_TYPE_MESSAGE = 2;
int DATA_TYPE_SENT = 3;
int DATA_TYPE_REPLY = 4;
/**
* 心跳超时次数
*/
String KEY_PING = "PING";
String KEY_PONG = "PONG";
/**
* TCP 协议文本行分隔符
*/
String TEXT_FRAME_Delimiters = "\n";
/**
* TEXT-JSON 包最大长度
*/
int TEXT_FRAME_MAX_LENGTH = 8192;
/**
* 根据并发量大小配置缓冲区大小
*/
int WRITE_BUFFER_LOW_WATER_MARK = 32 * 1024;
int WRITE_BUFFER_HIGH_WATER_MARK = 64 * 1024;
}