public class MqClientDefault extends Object implements MqClientInternal
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
autoAcknowledge |
| 构造器和说明 |
|---|
MqClientDefault(String... urls) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
acknowledge(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message from,
MqMessageReceivedImpl message,
boolean isOk)
消费回执
|
MqClient |
autoAcknowledge(boolean auto)
自动回执
|
CompletableFuture<String> |
call(String apiName,
String apiToken,
String topic,
String consumerGroup)
接口调用
|
void |
close()
关闭
|
MqClient |
config(org.noear.socketd.transport.client.ClientConfigHandler configHandler)
客户端配置
|
MqClient |
connect()
连接
|
void |
disconnect()
断开连接
|
protected MqSubscription |
getSubscription(String topic,
String consumerGroup) |
protected Collection<MqSubscription> |
getSubscriptionAll() |
protected int |
getSubscriptionSize() |
void |
publish(String topic,
IMqMessage message)
同步发布消息
|
CompletableFuture<Boolean> |
publishAsync(String topic,
IMqMessage message)
发布消息
|
void |
subscribe(String topic,
String consumerGroup,
MqConsumeHandler consumerHandler)
订阅主题
|
void |
unpublish(String topic,
String tid)
取消发布
|
CompletableFuture<Boolean> |
unpublishAsync(String topic,
String tid)
取消发布
|
void |
unsubscribe(String topic,
String consumerGroup)
取消订阅主题
|
public MqClientDefault(String... urls)
public MqClient connect() throws IOException
MqClientconnect 在接口中 MqClientIOExceptionpublic void disconnect()
throws IOException
MqClientdisconnect 在接口中 MqClientIOExceptionpublic MqClient config(org.noear.socketd.transport.client.ClientConfigHandler configHandler)
MqClientpublic MqClient autoAcknowledge(boolean auto)
autoAcknowledge 在接口中 MqClientauto - 自动(默认为 true)public CompletableFuture<String> call(String apiName, String apiToken, String topic, String consumerGroup) throws IOException
MqClientcall 在接口中 MqClientIOExceptionpublic void subscribe(String topic, String consumerGroup, MqConsumeHandler consumerHandler) throws IOException
subscribe 在接口中 MqClienttopic - 主题consumerGroup - 消费者组consumerHandler - 消费处理IOExceptionpublic void unsubscribe(String topic, String consumerGroup) throws IOException
MqClientunsubscribe 在接口中 MqClienttopic - 主题consumerGroup - 消费者组IOExceptionpublic void publish(String topic, IMqMessage message) throws IOException
MqClientpublish 在接口中 MqClienttopic - 主题message - 消息IOExceptionpublic CompletableFuture<Boolean> publishAsync(String topic, IMqMessage message) throws IOException
publishAsync 在接口中 MqClienttopic - 主题message - 消息IOExceptionpublic void unpublish(String topic, String tid) throws IOException
MqClientunpublish 在接口中 MqClienttopic - 主题tid - 事务idIOExceptionpublic CompletableFuture<Boolean> unpublishAsync(String topic, String tid) throws IOException
MqClientunpublishAsync 在接口中 MqClienttopic - 主题tid - 事务idIOExceptionpublic void acknowledge(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message from,
MqMessageReceivedImpl message,
boolean isOk)
throws IOException
acknowledge 在接口中 MqClientInternalmessage - 收到的消息isOk - 回执session - 会话from - 来源消息IOExceptionprotected MqSubscription getSubscription(String topic, String consumerGroup)
protected Collection<MqSubscription> getSubscriptionAll()
protected int getSubscriptionSize()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2024. All rights reserved.