优化mq
This commit is contained in:
@@ -1734,7 +1734,7 @@ public final class Application {
|
||||
if (sb.length() > 0) {
|
||||
logger.info(sb.toString().trim());
|
||||
}
|
||||
logger.info("MessageAgent(names=" + JsonConvert.root().convertTo(names) + ") start in " + (System.currentTimeMillis() - s) + " ms");
|
||||
logger.info("MessageAgent(names=" + JsonConvert.root().convertTo(names) + ") started in " + (System.currentTimeMillis() - s) + " ms");
|
||||
}
|
||||
|
||||
void loadClassesByFilters(String excludelibs, final ClassFilter... filters) throws IOException {
|
||||
|
||||
@@ -156,7 +156,7 @@ public abstract class MessageAgent implements Resourcable {
|
||||
return map;
|
||||
}
|
||||
|
||||
//Application.shutdown 在执行server.shutdown之前执行
|
||||
//Application.stop 在执行server.shutdown之前执行
|
||||
public void stop() {
|
||||
this.stopMessageConsumer();
|
||||
this.stopMessageProducer();
|
||||
@@ -165,7 +165,7 @@ public abstract class MessageAgent implements Resourcable {
|
||||
});
|
||||
}
|
||||
|
||||
//Application.shutdown 在所有server.shutdown执行后执行
|
||||
//Application.stop 在所有server.shutdown执行后执行
|
||||
public void destroy(AnyValue config) {
|
||||
for (MessageConsumer consumer : messageConsumerList) {
|
||||
consumer.destroy(config);
|
||||
@@ -176,10 +176,10 @@ public abstract class MessageAgent implements Resourcable {
|
||||
this.httpMessageClient.close();
|
||||
this.sncpMessageClient.close();
|
||||
if (this.sncpClientProducer != null) {
|
||||
this.sncpClientProducer.shutdown();
|
||||
this.sncpClientProducer.stop();
|
||||
}
|
||||
if (this.httpClientProducer != null) {
|
||||
this.httpClientProducer.shutdown();
|
||||
this.httpClientProducer.stop();
|
||||
}
|
||||
if (this.clientMessageCoder instanceof Service) {
|
||||
((Service) this.clientMessageCoder).destroy(config);
|
||||
|
||||
@@ -32,9 +32,7 @@ public abstract class MessageClientProducer {
|
||||
|
||||
public abstract CompletableFuture<Void> apply(MessageRecord message);
|
||||
|
||||
public abstract void startup();
|
||||
|
||||
public abstract void shutdown();
|
||||
public abstract void stop();
|
||||
|
||||
public boolean isClosed() {
|
||||
return closed.get();
|
||||
|
||||
@@ -304,7 +304,7 @@ public abstract class AbstractDataSqlSource extends AbstractDataSource implement
|
||||
if (pos > 0) {
|
||||
url = url.substring(0, pos) + "...";
|
||||
}
|
||||
return getClass().getSimpleName() + "{url=" + url + ", maxconns=" + readMaxConns() + executorToString() + "}";
|
||||
return getClass().getSimpleName() + "{url=" + url + ", maxconns=" + readMaxConns() + ", dbtype=" + dbtype() + ", " + DATA_SOURCE_TABLE_AUTODDL + "=" + autoDDL + executorToString() + "}";
|
||||
} else {
|
||||
String readUrl = readConfProps.getProperty(DATA_SOURCE_URL);
|
||||
int pos = readUrl.indexOf('?');
|
||||
@@ -316,7 +316,9 @@ public abstract class AbstractDataSqlSource extends AbstractDataSource implement
|
||||
if (pos > 0) {
|
||||
writeUrl = writeUrl.substring(0, pos) + "...";
|
||||
}
|
||||
return getClass().getSimpleName() + "{read-url=" + readUrl + ", read-maxconns=" + readMaxConns() + executorToString() + ",write-url=" + writeUrl + ", write-maxconns=" + writeMaxConns() + "}";
|
||||
return getClass().getSimpleName() + "{read-url=" + readUrl + ", read-maxconns=" + readMaxConns()
|
||||
+ ",write-url=" + writeUrl + ", write-maxconns=" + writeMaxConns()
|
||||
+ ", dbtype=" + dbtype() + ", " + DATA_SOURCE_TABLE_AUTODDL + "=" + autoDDL + executorToString() + "}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user