public class MqBorkerListener extends MqBorkerListenerBase implements MqBorkerInternal
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.noear.socketd.broker.BrokerListener |
brokerListener |
protected MqQps |
qpsDistribute |
protected MqQps |
qpsPublish |
protected ScheduledFuture<?> |
qpsScheduled |
distributeThread, isStarted, log, proxyMode, queueMap, serverAccessMap, sessionAllMap, subscribeLock, subscribeMap, transactionMessageMap, watcher| 构造器和说明 |
|---|
MqBorkerListener(boolean proxyMode) |
| 限定符和类型 | 方法和说明 |
|---|---|
MqBorkerListener |
addAccess(String accessKey,
String accessSecretKey)
配置访问账号
|
MqBorkerListener |
addAccessAll(Map<String,String> accessMap)
配置访问账号
|
protected boolean |
auth(org.noear.socketd.transport.core.Session session)
鉴权失败返回false
|
void |
doOnEvent(String event,
org.noear.socketd.transport.core.listener.MessageHandler handler)
添加事件扩展
|
MqQps |
getQpsDistribute()
获取派发 Qps
|
MqQps |
getQpsPublish()
获取发布 Qps
|
void |
onClose(org.noear.socketd.transport.core.Session session)
会话关闭时
|
void |
onError(org.noear.socketd.transport.core.Session session,
Throwable error)
会话出错时
|
void |
onOpen(org.noear.socketd.transport.core.Session session)
会话打开时
|
void |
onReply(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message message) |
void |
onSend(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message message) |
protected void |
onSubscribe(org.noear.socketd.transport.core.Session s,
org.noear.socketd.transport.core.Message m) |
protected void |
onUnsubscribe(org.noear.socketd.transport.core.Session s,
org.noear.socketd.transport.core.Message m) |
void |
save()
保存
|
void |
start(org.noear.socketd.utils.RunnableEx<Exception> onStart)
启动
|
void |
stop(Runnable onStop)
停止
|
MqBorkerListener |
watcher(MqWatcher watcher)
配置监视器
|
chanelType, distributeDo, getQueue, getQueueMap, getSessionAll, getSessionCount, getSubscribeMap, hasSubscribe, queueGetOrInit, removeQueue, routingDo, routingToQueueDo, routingToQueueName, subscribeDo, unRoutingDo, unsubscribeDodoOn, doOnClose, doOnError, doOnMessage, doOnOpen, onMessageclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetQueue, getQueueMap, getSessionAll, getSessionCount, getSubscribeMap, hasSubscribe, removeQueue, routingDo, routingToQueueDo, subscribeDo, unsubscribeDoprotected final org.noear.socketd.broker.BrokerListener brokerListener
protected final MqQps qpsPublish
protected final MqQps qpsDistribute
protected final ScheduledFuture<?> qpsScheduled
public MqQps getQpsDistribute()
MqBorkerInternalgetQpsDistribute 在接口中 MqBorkerInternalpublic MqQps getQpsPublish()
MqBorkerInternalgetQpsPublish 在接口中 MqBorkerInternalpublic void onSend(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message message)
onSend 在接口中 org.noear.socketd.transport.core.ListeneronSend 在类中 org.noear.socketd.transport.core.listener.EventListenerpublic void onReply(org.noear.socketd.transport.core.Session session,
org.noear.socketd.transport.core.Message message)
onReply 在接口中 org.noear.socketd.transport.core.ListeneronReply 在类中 org.noear.socketd.transport.core.listener.EventListenerpublic MqBorkerListener watcher(MqWatcher watcher)
public MqBorkerListener addAccess(String accessKey, String accessSecretKey)
accessKey - 访问者身份accessSecretKey - 访问者密钥public MqBorkerListener addAccessAll(Map<String,String> accessMap)
accessMap - 访问账号集合public void save()
save 在接口中 MqBorkerInternalpublic void start(org.noear.socketd.utils.RunnableEx<Exception> onStart) throws Exception
Exceptionpublic void stop(Runnable onStop)
public void onOpen(org.noear.socketd.transport.core.Session session)
throws IOException
onOpen 在接口中 org.noear.socketd.transport.core.ListeneronOpen 在类中 org.noear.socketd.transport.core.listener.EventListenerIOExceptionprotected boolean auth(org.noear.socketd.transport.core.Session session)
session - public void onClose(org.noear.socketd.transport.core.Session session)
onClose 在接口中 org.noear.socketd.transport.core.ListeneronClose 在类中 org.noear.socketd.transport.core.listener.EventListenerpublic void onError(org.noear.socketd.transport.core.Session session,
Throwable error)
onError 在接口中 org.noear.socketd.transport.core.ListeneronError 在类中 org.noear.socketd.transport.core.listener.EventListenerpublic void doOnEvent(String event, org.noear.socketd.transport.core.listener.MessageHandler handler)
MqBorkerInternaldoOnEvent 在接口中 MqBorkerInternalevent - 事件handler - 处理protected void onSubscribe(org.noear.socketd.transport.core.Session s,
org.noear.socketd.transport.core.Message m)
throws IOException
IOExceptionprotected void onUnsubscribe(org.noear.socketd.transport.core.Session s,
org.noear.socketd.transport.core.Message m)
throws IOException
IOExceptionCopyright © 2024. All rights reserved.