public class MqClientDefault extends Object implements MqClientInternal
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
autoAcknowledge |
protected ExecutorService |
handleExecutor |
protected MqResponder |
responder |
| 构造器和说明 |
|---|
MqClientDefault(String... urls) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
acknowledge(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message from,
MqMessageReceivedImpl message,
boolean isOk,
org.noear.socketd.transport.core.Entity reply)
消费回执
|
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 String |
diversionOrNull(String topic,
MqMessage message) |
protected MqSubscription |
getSubscription(String topic,
String consumerGroup) |
protected Collection<MqSubscription> |
getSubscriptionAll() |
protected int |
getSubscriptionSize() |
MqClient |
handleExecutor(ExecutorService handleExecutor)
消息处理执行器
|
String |
name()
名字
|
MqClient |
nameAs(String name)
名字取为
|
MqTransaction |
newTransaction()
创建事务
|
void |
publish(String topic,
MqMessage message)
同步发布消息
|
void |
publish2(String tmid,
List<String> tidAry,
boolean isRollback)
发布二次提交
|
CompletableFuture<Boolean> |
publishAsync(String topic,
MqMessage message)
发布消息
|
org.noear.socketd.transport.stream.RequestStream |
request(String atName,
String topic,
MqMessage message)
请求
|
MqClient |
response(MqResponder responder)
响应
|
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)
取消订阅主题
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubscribe, unsubscribeprotected MqResponder responder
protected ExecutorService handleExecutor
protected boolean autoAcknowledge
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 handleExecutor(ExecutorService handleExecutor)
MqClienthandleExecutor 在接口中 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 publish2(String tmid, List<String> tidAry, boolean isRollback) throws IOException
MqClientInternalpublish2 在接口中 MqClientInternaltmid - 事务管理idtidAry - 事务集合isRollback - 是否回滚IOExceptionpublic void publish(String topic, MqMessage message) throws IOException
MqClientpublish 在接口中 MqClienttopic - 主题message - 消息IOExceptionpublic CompletableFuture<Boolean> publishAsync(String topic, MqMessage 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 org.noear.socketd.transport.stream.RequestStream request(String atName, String topic, MqMessage message) throws IOException
MqClientrequest 在接口中 MqClientIOExceptionpublic MqClient response(MqResponder responder)
MqClientpublic MqTransaction newTransaction()
MqClientnewTransaction 在接口中 MqClientpublic void acknowledge(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message from,
MqMessageReceivedImpl message,
boolean isOk,
org.noear.socketd.transport.core.Entity reply)
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.