代码拉取完成,页面将自动刷新
同步操作将从 noear/folkmq 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/**
* 消息客户端
*
* @author noear
* @since 1.0
*/
public interface MqClient {
/**
* 连接
*/
MqClient connect() throws IOException;
/**
* 断开连接
*/
void disconnect() throws IOException;
/**
* 客户端配置
*/
MqClient config(ClientConfigHandler configHandler);
/**
* 自动回执
*
* @param auto 自动(默认为 true)
*/
MqClient autoAcknowledge(boolean auto);
/**
* 发布重试
*
* @param times 次数(默认为 0)
* */
MqClient publishRetryTimes(int times);
/**
* 订阅主题
*
* @param topic 主题
* @param consumer 消费者(实例 ip 或 集群 name)
* @param consumerHandler 消费处理
*/
void subscribe(String topic, String consumer, MqConsumeHandler consumerHandler) throws IOException;
/**
* 取消订阅主题
*
* @param topic 主题
* @param consumer 消费者(实例 ip 或 集群 name)
*/
void unsubscribe(String topic, String consumer) throws IOException;
/**
* 发布消息
*
* @param topic 主题
* @param message 消息
*/
CompletableFuture<?> publish(String topic, IMqMessage message) throws IOException;
}
/**
* 消息接口
*/
public interface IMqMessage {
/**
* 事务ID
*/
String getTid();
/**
* 内容
*/
String getContent();
/**
* 定时时间
*/
Date getScheduled();
/**
* 质量等级(0 或 1)
*/
int getQos();
}
/**
* 消费处理器
*/
public interface MqConsumeHandler {
/**
* 消费
*
* @param message 收到的消息
*/
void consume(MqMessage message) throws IOException;
}
/**
* 收到的消息接口
*/
public interface IMqMessageReceived extends IMqMessage {
/**
* 主题
*/
String getTopic();
/**
* 已派发次数
*/
int getTimes();
/**
* 回执
*/
void acknowledge(boolean isOk) throws IOException;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。