mq
This commit is contained in:
@@ -110,8 +110,8 @@ public abstract class MessageAgent implements Resourcable {
|
|||||||
this.workExecutor = threads > 0 ? WorkThread.createExecutor(threads, "Redkale-MessageConsumerThread-[" + name + "]-%s")
|
this.workExecutor = threads > 0 ? WorkThread.createExecutor(threads, "Redkale-MessageConsumerThread-[" + name + "]-%s")
|
||||||
: WorkThread.createWorkExecutor(Utility.cpus(), "Redkale-MessageConsumerThread-[" + name + "]-%s");
|
: WorkThread.createWorkExecutor(Utility.cpus(), "Redkale-MessageConsumerThread-[" + name + "]-%s");
|
||||||
}
|
}
|
||||||
this.httpMessageClient = new MessageClient(this, this.httpAppRespTopic);
|
this.httpMessageClient = new MessageClient("http", this, this.httpAppRespTopic);
|
||||||
this.sncpMessageClient = new MessageClient(this, this.sncpAppRespTopic);
|
this.sncpMessageClient = new MessageClient("sncp", this, this.sncpAppRespTopic);
|
||||||
|
|
||||||
String coderType = config.getValue("coder", "");
|
String coderType = config.getValue("coder", "");
|
||||||
if (!coderType.trim().isEmpty()) {
|
if (!coderType.trim().isEmpty()) {
|
||||||
@@ -198,8 +198,6 @@ public abstract class MessageAgent implements Resourcable {
|
|||||||
this.messageConsumerList.clear();
|
this.messageConsumerList.clear();
|
||||||
this.messageConsumerMap.clear();
|
this.messageConsumerMap.clear();
|
||||||
//-------------- MessageClient --------------
|
//-------------- MessageClient --------------
|
||||||
this.httpMessageClient.stop();
|
|
||||||
this.sncpMessageClient.stop();
|
|
||||||
if (this.messageClientProducer != null) {
|
if (this.messageClientProducer != null) {
|
||||||
this.messageClientProducer.stop();
|
this.messageClientProducer.stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,12 +48,15 @@ public class MessageClient implements ClusterRpcClient<MessageRecord, MessageRec
|
|||||||
|
|
||||||
protected final AtomicLong msgSeqno;
|
protected final AtomicLong msgSeqno;
|
||||||
|
|
||||||
|
protected final String protocol;
|
||||||
|
|
||||||
//key: reqTopic
|
//key: reqTopic
|
||||||
private final HashMap<String, MessageProcessor> messageProcessors = new HashMap<>();
|
private final HashMap<String, MessageProcessor> messageProcessors = new HashMap<>();
|
||||||
|
|
||||||
final ConcurrentHashMap<Long, MessageRespFuture> respQueue = new ConcurrentHashMap<>();
|
final ConcurrentHashMap<Long, MessageRespFuture> respQueue = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
protected MessageClient(MessageAgent messageAgent, String appRespTopic) {
|
protected MessageClient(String protocol, MessageAgent messageAgent, String appRespTopic) {
|
||||||
|
this.protocol = protocol;
|
||||||
this.messageAgent = messageAgent;
|
this.messageAgent = messageAgent;
|
||||||
this.appRespTopic = appRespTopic;
|
this.appRespTopic = appRespTopic;
|
||||||
this.msgSeqno = messageAgent.msgSeqno;
|
this.msgSeqno = messageAgent.msgSeqno;
|
||||||
@@ -206,10 +209,8 @@ public class MessageClient implements ClusterRpcClient<MessageRecord, MessageRec
|
|||||||
return ctype;
|
return ctype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start() {
|
public String getProtocol() {
|
||||||
}
|
return protocol;
|
||||||
|
|
||||||
public void stop() {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageAgent getMessageAgent() {
|
public MessageAgent getMessageAgent() {
|
||||||
|
|||||||
Reference in New Issue
Block a user