单机消息发布、订阅,代码整改,加掉了

This commit is contained in:
ztzh_xieyun 2024-05-11 18:09:16 +08:00
parent 028035dec5
commit b8429e1d6a

View File

@ -373,6 +373,7 @@ public class AppConfigHandler {
initConnectionCircuitBreaker();
createVertxRouter();
consumerClusterEventMsg();
}
private static Config hazelcastConfig(SacVertxConfig sacVertxConfig) {
@ -415,6 +416,15 @@ public class AppConfigHandler {
log.info("hazelcastClusterManager create success");
initConnectionCircuitBreaker();
createVertxRouter();
consumerClusterEventMsg();
} else {
res.cause().printStackTrace();
log.info("hazelcastClusterManager create failure");
}
});
}
private static void consumerClusterEventMsg() {
// 订阅消息
VERTX.eventBus().consumer("sac_cluster_event", message -> {
if (message.body() != null) {
@ -432,11 +442,6 @@ public class AppConfigHandler {
}
}
});
} else {
res.cause().printStackTrace();
log.info("hazelcastClusterManager create failure");
}
});
}
/***