feat:vertx消费增加多实例
parent
b83f314c9d
commit
ec9928b690
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue