- java.lang.Object
-
- org.redkale.mq.spi.MessageClient
-
- 所有已实现的接口:
ClusterRpcClient<MessageRecord,MessageRecord>
,MessageProcessor
public class MessageClient extends Object implements ClusterRpcClient<MessageRecord,MessageRecord>, MessageProcessor
详情见: https://redkale.org- 从以下版本开始:
- 2.1.0
- 作者:
- zhangjx
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Logger
logger
protected AtomicLong
msgSeqno
protected ReentrantLock
processorLock
protected String
protocol
-
构造器概要
构造器 限定符 构造器 说明 protected
MessageClient(String protocol, MessageAgent messageAgent, String appRespTopic)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 MessageRecord
createMessageRecord(byte ctype, String topic, String respTopic, byte[] content)
MessageRecord
createMessageRecord(byte ctype, String topic, String respTopic, String traceid, byte[] content)
MessageRecord
createMessageRecord(long seqid, byte ctype, String topic, String respTopic, byte[] content)
MessageRecord
createMessageRecord(long seqid, byte ctype, String topic, String respTopic, String traceid, byte[] content)
String
getAppRespTopic()
MessageCoder<MessageRecord>
getClientMessageCoder()
MessageAgent
getMessageAgent()
MessageClientProducer
getProducer()
String
getProtocol()
Collection<String>
getTopics()
boolean
isEmpty()
void
process(MessageRecord msg, long time)
CompletableFuture<Void>
produceMessage(MessageRecord message)
发送消息,无需响应void
putMessageServlet(MessageServlet servlet)
CompletableFuture<MessageRecord>
sendMessage(MessageRecord message)
发送消息,需要响应
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
processorLock
protected final ReentrantLock processorLock
-
msgSeqno
protected final AtomicLong msgSeqno
-
protocol
protected final String protocol
-
-
构造器详细资料
-
MessageClient
protected MessageClient(String protocol, MessageAgent messageAgent, String appRespTopic)
-
-
方法详细资料
-
process
public void process(MessageRecord msg, long time)
- 指定者:
process
在接口中MessageProcessor
-
getTopics
public Collection<String> getTopics()
-
produceMessage
public CompletableFuture<Void> produceMessage(MessageRecord message)
从接口复制的说明:ClusterRpcClient
发送消息,无需响应- 指定者:
produceMessage
在接口中ClusterRpcClient<MessageRecord,MessageRecord>
- 参数:
message
- 消息体- 返回:
- 应答
-
sendMessage
public CompletableFuture<MessageRecord> sendMessage(MessageRecord message)
从接口复制的说明:ClusterRpcClient
发送消息,需要响应- 指定者:
sendMessage
在接口中ClusterRpcClient<MessageRecord,MessageRecord>
- 参数:
message
- 消息体- 返回:
- 应答消息
-
putMessageServlet
public void putMessageServlet(MessageServlet servlet)
-
isEmpty
public boolean isEmpty()
-
createMessageRecord
public MessageRecord createMessageRecord(byte ctype, String topic, String respTopic, byte[] content)
-
createMessageRecord
public MessageRecord createMessageRecord(byte ctype, String topic, String respTopic, String traceid, byte[] content)
-
createMessageRecord
public MessageRecord createMessageRecord(long seqid, byte ctype, String topic, String respTopic, byte[] content)
-
createMessageRecord
public MessageRecord createMessageRecord(long seqid, byte ctype, String topic, String respTopic, String traceid, byte[] content)
-
getProtocol
public String getProtocol()
-
getMessageAgent
public MessageAgent getMessageAgent()
-
getClientMessageCoder
public MessageCoder<MessageRecord> getClientMessageCoder()
-
getProducer
public MessageClientProducer getProducer()
-
getAppRespTopic
public String getAppRespTopic()
-
-