feat:vertx消费增加多实例

master
xiwa 2024-03-03 12:39:48 +08:00
parent b83f314c9d
commit ec9928b690
21 changed files with 25 additions and 22 deletions

View File

@ -6,7 +6,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<artifactId>iot-common-core</artifactId>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-message-bus</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-message-bus</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -12,6 +12,7 @@ package cc.iotkit.vertx;
import cc.iotkit.mq.ConsumerHandler;
import cc.iotkit.mq.MqConsumer;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.EventBus;
import io.vertx.core.eventbus.Message;
@ -25,12 +26,14 @@ public class VertxMqConsumer<T> implements MqConsumer<T> {
private final MqConsumerVerticle<T> consumerVerticle;
private final CountDownLatch countDownLatch = new CountDownLatch(1);
private final CountDownLatch countDownLatch = new CountDownLatch(4);
@SneakyThrows
public VertxMqConsumer(Class<T> cls) {
consumerVerticle = new MqConsumerVerticle<>(cls);
VertxManager.getVertx().deployVerticle(consumerVerticle, stringAsyncResult -> countDownLatch.countDown());
for (int i = 0; i < 4; i++) {
VertxManager.getVertx().deployVerticle(consumerVerticle,new DeploymentOptions().setWorker(true), stringAsyncResult -> countDownLatch.countDown());
}
//等待初始化穿完成
countDownLatch.await();
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-message-bus</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>cc.iotkit</groupId>
<artifactId>iot-iita-core</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<artifactId>iot-oss-local</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>cc.iotkit</groupId>
<artifactId>iot-iita-core</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<artifactId>iot-plugin-core</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<artifactId>iot-iita-core</artifactId>
<groupId>cc.iotkit</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<artifactId>iot-script-engine</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>cc.iotkit</groupId>
<artifactId>iot-iita-core</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<groupId>com.gitee.starblues</groupId>

View File

@ -6,7 +6,7 @@
<groupId>cc.iotkit</groupId>
<artifactId>iot-iita-core</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<packaging>pom</packaging>
<modules>