public interface MqClient
| 限定符和类型 | 方法和说明 |
|---|---|
MqClient |
autoAcknowledge(boolean auto)
自动回执
|
MqClient |
config(org.noear.socketd.transport.client.ClientConfigHandler configHandler)
客户端配置
|
MqClient |
connect()
连接
|
void |
disconnect()
断开连接
|
default CompletableFuture<?> |
publish(String topic,
String content)
发布消息
|
default CompletableFuture<?> |
publish(String topic,
String content,
Date scheduled)
发布消息
|
CompletableFuture<?> |
publish(String topic,
String content,
Date scheduled,
int qos)
发布消息
|
default CompletableFuture<?> |
publish(String topic,
String content,
int qos)
发布消息
|
void |
subscribe(String topic,
String consumer,
MqConsumerHandler consumerHandler)
订阅主题
|
void |
unsubscribe(String topic,
String consumer)
取消订阅主题
|
MqClient connect() throws IOException
IOExceptionvoid disconnect()
throws IOException
IOExceptionMqClient config(org.noear.socketd.transport.client.ClientConfigHandler configHandler)
MqClient autoAcknowledge(boolean auto)
void subscribe(String topic, String consumer, MqConsumerHandler consumerHandler) throws IOException
topic - 主题consumer - 消费者(实例 ip 或 集群 name)consumerHandler - 消费处理IOExceptionvoid unsubscribe(String topic, String consumer) throws IOException
topic - 主题consumer - 消费者(实例 ip 或 集群 name)IOExceptiondefault CompletableFuture<?> publish(String topic, String content) throws IOException
topic - 主题content - 消息内容IOExceptiondefault CompletableFuture<?> publish(String topic, String content, int qos) throws IOException
topic - 主题content - 消息内容qos - 质量等级(0 或 1)IOExceptiondefault CompletableFuture<?> publish(String topic, String content, Date scheduled) throws IOException
topic - 主题content - 消息内容scheduled - 预定派发时间IOExceptionCompletableFuture<?> publish(String topic, String content, Date scheduled, int qos) throws IOException
topic - 主题content - 消息内容scheduled - 预定派发时间qos - 质量等级(0 或 1)IOExceptionCopyright © 2023. All rights reserved.