- java.lang.Object
-
- org.redkale.mq.spi.MessageAgent
-
- 所有已实现的接口:
Resourcable
,MessageManager
public abstract class MessageAgent extends Object implements MessageManager
MQ管理器详情见: https://redkale.org
- 从以下版本开始:
- 2.1.0
- 作者:
- zhangjx
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
MessageAgent.MessageConsumerWrapper<T>
protected static class
MessageAgent.MessageProducerWrapper
-
字段概要
字段 修饰符和类型 字段 说明 protected Application
application
protected ReentrantLock
clientConsumerLock
protected ReentrantLock
clientProducerLock
protected AnyValue
config
protected Environment
environment
protected MessageClient
httpMessageClient
protected Logger
logger
protected MessageProducer
messageBaseProducer
protected MessageClientProducer
messageClientProducer
protected CopyOnWriteArrayList<MessageConsumer>
messageConsumerList
protected ReentrantLock
messageProducerLock
protected Map<ConvertType,MessageAgent.MessageProducerWrapper>
messageProducerMap
protected MessageCoder<MessageRecord>
messageRecordCoder
protected Map<String,Map<String,MessageAgent.MessageConsumerWrapper>>
messageRegexConsumerMap
protected Map<String,Map<String,MessageAgent.MessageConsumerWrapper>>
messageTopicConsumerMap
protected String
name
protected String
nodeid
protected String
nodeName
protected MessageClient
sncpMessageClient
protected ScheduledThreadPoolExecutor
timeoutExecutor
-
构造器概要
构造器 构造器 说明 MessageAgent()
-
方法概要
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
application
protected Application application
-
environment
protected Environment environment
-
nodeid
protected String nodeid
-
nodeName
protected String nodeName
-
name
protected String name
-
config
protected AnyValue config
-
messageProducerLock
protected final ReentrantLock messageProducerLock
-
messageBaseProducer
protected MessageProducer messageBaseProducer
-
messageProducerMap
protected Map<ConvertType,MessageAgent.MessageProducerWrapper> messageProducerMap
-
messageConsumerList
protected final CopyOnWriteArrayList<MessageConsumer> messageConsumerList
-
messageTopicConsumerMap
protected final Map<String,Map<String,MessageAgent.MessageConsumerWrapper>> messageTopicConsumerMap
-
messageRegexConsumerMap
protected final Map<String,Map<String,MessageAgent.MessageConsumerWrapper>> messageRegexConsumerMap
-
httpMessageClient
protected MessageClient httpMessageClient
-
sncpMessageClient
protected MessageClient sncpMessageClient
-
messageClientProducer
protected MessageClientProducer messageClientProducer
-
clientConsumerLock
protected final ReentrantLock clientConsumerLock
-
clientProducerLock
protected final ReentrantLock clientProducerLock
-
messageRecordCoder
protected MessageCoder<MessageRecord> messageRecordCoder
-
timeoutExecutor
protected ScheduledThreadPoolExecutor timeoutExecutor
-
-
方法详细资料
-
init
public void init(AnyValue config)
-
execute
public void execute(Runnable event)
-
start
public void start(List<MessageConsumer> consumers)
-
stop
public void stop()
-
destroy
public void destroy(AnyValue config)
-
loadMessageProducer
public MessageProducer loadMessageProducer(ResourceProducer ann)
-
initMessageConsumer
protected StringBuilder initMessageConsumer(List<MessageConsumer> consumers)
-
resourceName
public String resourceName()
- 指定者:
resourceName
在接口中Resourcable
-
getLogger
public Logger getLogger()
-
getTimeoutSeconds
public int getTimeoutSeconds()
-
getName
public String getName()
-
getConfig
public AnyValue getConfig()
-
setConfig
public void setConfig(AnyValue config)
-
getWorkExecutor
public ExecutorService getWorkExecutor()
-
getHttpRpcClient
public HttpRpcClient getHttpRpcClient()
-
getHttpMessageClient
public MessageClient getHttpMessageClient()
-
getSncpMessageClient
public MessageClient getSncpMessageClient()
-
isRpc
public boolean isRpc()
-
getMessageRecordCoder
public MessageCoder<MessageRecord> getMessageRecordCoder()
-
getMessageClientProducer
public MessageClientProducer getMessageClientProducer()
-
startMessageConsumer
protected abstract void startMessageConsumer()
-
stopMessageConsumer
protected abstract void stopMessageConsumer()
-
startMessageProducer
protected abstract void startMessageProducer()
-
stopMessageProducer
protected abstract void stopMessageProducer()
-
startMessageClientConsumer
protected abstract void startMessageClientConsumer()
-
stopMessageClientConsumer
protected abstract void stopMessageClientConsumer()
-
startMessageClientProducer
protected abstract MessageClientProducer startMessageClientProducer()
-
onResourceChange
@ResourceChanged public abstract void onResourceChange(ResourceEvent[] events)
-
createTopic
public abstract CompletableFuture<Void> createTopic(String... topics)
从接口复制的说明:MessageManager
创建topic- 指定者:
createTopic
在接口中MessageManager
- 参数:
topics
- topic集合- 返回:
- 是否完成
-
deleteTopic
public abstract CompletableFuture<Void> deleteTopic(String... topics)
从接口复制的说明:MessageManager
删除topic,如果不存在则跳过- 指定者:
deleteTopic
在接口中MessageManager
- 参数:
topics
- topic集合- 返回:
- 是否完成
-
queryTopic
public abstract CompletableFuture<List<String>> queryTopic()
从接口复制的说明:MessageManager
查询所有topic- 指定者:
queryTopic
在接口中MessageManager
- 返回:
- topic集合
-
acceptsConf
public abstract boolean acceptsConf(AnyValue config)
-
putService
public final void putService(NodeHttpServer ns, Service service, HttpServlet servlet)
-
putService
public final void putService(NodeSncpServer ns, Service service, SncpServlet servlet)
-
getHttpAppRespTopic
public final String getHttpAppRespTopic()
-
getSncpAppRespTopic
public final String getSncpAppRespTopic()
-
getNodeid
public final String getNodeid()
-
-