public interface MqClient
| 限定符和类型 | 方法和说明 |
|---|---|
MqClient |
autoAcknowledge(boolean auto)
自动回执
|
CompletableFuture<?> |
publish(String topic,
String content)
发布消息
|
CompletableFuture<?> |
publish(String topic,
String content,
Date scheduled)
发布消息
|
void |
subscribe(String topic,
String consumer,
MqConsumerHandler consumerHandler)
订阅主题
|
MqClient autoAcknowledge(boolean auto)
void subscribe(String topic, String consumer, MqConsumerHandler consumerHandler) throws IOException
topic - 主题consumer - 消费者(实例 ip 或 集群 name)consumerHandler - 消费处理IOExceptionCompletableFuture<?> publish(String topic, String content) throws IOException
topic - 主题content - 消息内容IOExceptionCompletableFuture<?> publish(String topic, String content, Date scheduled) throws IOException
topic - 主题content - 消息内容scheduled - 预定派发时间IOExceptionCopyright © 2023. All rights reserved.