MessageManager接口异步化
This commit is contained in:
@@ -82,11 +82,11 @@
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>ossrh</id>
|
||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>ossrh</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package org.redkale.mq;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.redkale.inject.Resourcable;
|
||||
|
||||
/**
|
||||
@@ -20,22 +21,22 @@ public interface MessageManager extends Resourcable {
|
||||
* 创建topic
|
||||
*
|
||||
* @param topics topic集合
|
||||
* @return 是否成功
|
||||
* @return 是否完成
|
||||
*/
|
||||
public boolean createTopic(String... topics);
|
||||
public CompletableFuture<Void> createTopic(String... topics);
|
||||
|
||||
/**
|
||||
* 删除topic,如果不存在则跳过
|
||||
*
|
||||
* @param topics topic集合
|
||||
* @return 是否成功
|
||||
* @return 是否完成
|
||||
*/
|
||||
public boolean deleteTopic(String... topics);
|
||||
public CompletableFuture<Void> deleteTopic(String... topics);
|
||||
|
||||
/**
|
||||
* 查询所有topic
|
||||
*
|
||||
* @return topic集合
|
||||
*/
|
||||
public abstract List<String> queryTopic();
|
||||
public abstract CompletableFuture<List<String>> queryTopic();
|
||||
}
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
*/
|
||||
package org.redkale.mq.spi;
|
||||
|
||||
import static org.redkale.boot.Application.RESNAME_APP_NAME;
|
||||
import static org.redkale.boot.Application.RESNAME_APP_NODEID;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -20,6 +17,8 @@ import java.util.logging.*;
|
||||
import org.redkale.annotation.*;
|
||||
import org.redkale.annotation.AutoLoad;
|
||||
import org.redkale.boot.*;
|
||||
import static org.redkale.boot.Application.RESNAME_APP_NAME;
|
||||
import static org.redkale.boot.Application.RESNAME_APP_NODEID;
|
||||
import org.redkale.cluster.HttpRpcClient;
|
||||
import org.redkale.convert.Convert;
|
||||
import org.redkale.convert.ConvertFactory;
|
||||
@@ -414,17 +413,17 @@ public abstract class MessageAgent implements MessageManager {
|
||||
@ResourceChanged
|
||||
public abstract void onResourceChange(ResourceEvent[] events);
|
||||
|
||||
//
|
||||
// 新增topic
|
||||
@Override
|
||||
public abstract boolean createTopic(String... topics);
|
||||
public abstract CompletableFuture<Void> createTopic(String... topics);
|
||||
|
||||
// 删除topic,如果不存在则跳过
|
||||
@Override
|
||||
public abstract boolean deleteTopic(String... topics);
|
||||
public abstract CompletableFuture<Void> deleteTopic(String... topics);
|
||||
|
||||
// 查询所有topic
|
||||
@Override
|
||||
public abstract List<String> queryTopic();
|
||||
public abstract CompletableFuture<List<String>> queryTopic();
|
||||
|
||||
// ServiceLoader时判断配置是否符合当前实现类
|
||||
public abstract boolean acceptsConf(AnyValue config);
|
||||
|
||||
Reference in New Issue
Block a user