Skip to content

Commit

Permalink
Merge pull request #1360 from urviljoshi/prid-h-h
Browse files Browse the repository at this point in the history
Prid health check cherry-pick
  • Loading branch information
ckm007 authored Aug 19, 2022
2 parents e20bcf1 + 224199e commit 33f4802
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.kernel.pridgenerator.constant.EventType;
import io.mosip.kernel.pridgenerator.constant.HibernatePersistenceConstant;
import io.mosip.kernel.pridgenerator.constant.PRIDGeneratorConstant;
import io.mosip.kernel.pridgenerator.constant.PRIDHealthConstants;
Expand Down Expand Up @@ -156,7 +157,7 @@ public void dispSpaceHealthChecker(Future<Status> future) {
*/
public void verticleHealthHandler(Future<Status> future, Vertx vertx) {

vertx.eventBus().send(PRIDGeneratorConstant.PRID_GENERATOR_ADDRESS, PRIDHealthConstants.PING, response -> {
vertx.eventBus().send(EventType.CHECKPOOL, PRIDHealthConstants.PING, response -> {

if (response.succeeded()) {
final JsonObject result = resultBuilder.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void start(Future<Void> future) {
.produces(PRIDGeneratorConstant.APPLICATION_JSON);
// mount all the routers to parent router
parentRouter.mountSubRouter(environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH), metricRouter);
parentRouter.mountSubRouter(environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH), healthCheckRouter);
parentRouter.get(environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH)+PRIDGeneratorConstant.HEALTH_ENDPOINT).handler(healthCheckHandler);
parentRouter.mountSubRouter(
environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH) + PRIDGeneratorConstant.PRID,
pridFetcherRouter.createRouter(vertx));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.core.env.Environment;

import io.mosip.kernel.pridgenerator.constant.EventType;
import io.mosip.kernel.pridgenerator.constant.PRIDHealthConstants;
import io.mosip.kernel.pridgenerator.constant.PridLifecycleStatus;
import io.mosip.kernel.pridgenerator.service.PridService;
import io.vertx.core.AbstractVerticle;
Expand Down Expand Up @@ -64,6 +65,7 @@ public void start(Future<Void> startFuture) {
LOGGER.info("event type is send {} eventBus{}", handler.isSend(), eventBus);
LOGGER.info("locked generation");
}
handler.reply(PRIDHealthConstants.ACTIVE);
});

MessageConsumer<String> initPoolConsumer = eventBus.consumer(EventType.INITPOOL);
Expand Down

0 comments on commit 33f4802

Please sign in to comment.