MessageManager接口异步化

This commit is contained in:
redkale
2024-07-03 15:04:36 +08:00
parent 8fde50fabf
commit 20d400178b
3 changed files with 291 additions and 291 deletions

View File

@@ -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>

View File

@@ -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();
}

View File

@@ -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);