Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.ABIS_HANDLER_BUS_IN,
MessageBusAddress.ABIS_HANDLER_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.ABIS_HANDLER_BUS_IN,
MessageBusAddress.ABIS_HANDLER_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ public void setListener(Message message) {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.ABIS_MIDDLEWARE_BUS_IN,
MessageBusAddress.ABIS_MIDDLEWARE_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.ABIS_MIDDLEWARE_BUS_IN,
MessageBusAddress.ABIS_MIDDLEWARE_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public void deployVerticle() {

@Override
public void start(){
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.BIO_DEDUPE_BUS_IN, MessageBusAddress.BIO_DEDUPE_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.BIO_DEDUPE_BUS_IN, MessageBusAddress.BIO_DEDUPE_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.BIOMETRIC_AUTHENTICATION_BUS_IN,
MessageBusAddress.BIOMETRIC_AUTHENTICATION_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.BIOMETRIC_AUTHENTICATION_BUS_IN,
MessageBusAddress.BIOMETRIC_AUTHENTICATION_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.BIOMETRIC_EXTRACTION_BUS_IN,
MessageBusAddress.BIOMETRIC_EXTRACTION_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.BIOMETRIC_EXTRACTION_BUS_IN,
MessageBusAddress.BIOMETRIC_EXTRACTION_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());

}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ public void deployVerticle() {

@Override
public void start(){
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.DEMO_DEDUPE_BUS_IN, MessageBusAddress.DEMO_DEDUPE_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.DEMO_DEDUPE_BUS_IN, MessageBusAddress.DEMO_DEDUPE_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.FINALIZATION_BUS_IN,
MessageBusAddress.FINALIZATION_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.FINALIZATION_BUS_IN,
MessageBusAddress.FINALIZATION_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());

}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ public void setListener(Message message) {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN, MessageBusAddress.MANUAL_ADJUDICATION_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN, MessageBusAddress.MANUAL_ADJUDICATION_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.UIN_GENERATION_BUS_IN,
MessageBusAddress.UIN_GENERATION_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.UIN_GENERATION_BUS_IN,
MessageBusAddress.UIN_GENERATION_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.apache.activemq.command.ActiveMQTextMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
Expand Down Expand Up @@ -48,7 +47,6 @@
* @author Pranav Kumar
* @since 0.0.1
*/
@RefreshScope
@Service
@Configuration
@ComponentScan(basePackages = { "${mosip.auth.adapter.impl.basepackage}",
Expand Down Expand Up @@ -176,8 +174,9 @@ public void setListener(Message message) {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN, MessageBusAddress.MANUAL_ADJUDICATION_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN, MessageBusAddress.MANUAL_ADJUDICATION_BUS_OUT);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -nP 'VERIFICATION_BUS_(IN|OUT)|MANUAL_ADJUDICATION_BUS_(IN|OUT)' \
  registration-processor/core-processor/registration-processor-verification-stage/src/main/java/io/mosip/registration/processor/verification/stage/VerificationStage.java

Repository: mosip/registration

Length of output: 509


🏁 Script executed:

#!/bin/bash
rg -nP 'VERIFICATION_BUS_IN|VERIFICATION_BUS_OUT|MANUAL_ADJUDICATION_BUS_IN|MANUAL_ADJUDICATION_BUS_OUT' \
  registration-processor/core-processor/registration-processor-verification-stage/src/main/java/io/mosip/registration/processor/verification/stage/VerificationStage.java

Repository: mosip/registration

Length of output: 509


Incorrect MessageBusAddress constants in start()

Line 179 configures the health-check router using MANUAL_ADJUDICATION_BUS_IN and MANUAL_ADJUDICATION_BUS_OUT. This is VerificationStage, and the rest of the class (lines 158 and 190) correctly uses VERIFICATION_BUS_IN and VERIFICATION_BUS_OUT. Using the wrong addresses will cause the health check to monitor the incorrect message bus channels.

🐛 Proposed fix
-		io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN, MessageBusAddress.MANUAL_ADJUDICATION_BUS_OUT);
+		io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.VERIFICATION_BUS_IN, MessageBusAddress.VERIFICATION_BUS_OUT);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN, MessageBusAddress.MANUAL_ADJUDICATION_BUS_OUT);
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.VERIFICATION_BUS_IN, MessageBusAddress.VERIFICATION_BUS_OUT);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@registration-processor/core-processor/registration-processor-verification-stage/src/main/java/io/mosip/registration/processor/verification/stage/VerificationStage.java`
at line 179, The health-check router setup in VerificationStage.start() is using
the wrong MessageBusAddress constants, which makes it point at the manual
adjudication bus instead of the verification bus. Update the postUrl(getVertx(),
...) call to use the same VERIFICATION_BUS_IN and VERIFICATION_BUS_OUT symbols
already used elsewhere in VerificationStage so the health check monitors the
correct channels.

router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
Expand Down Expand Up @@ -42,7 +41,6 @@
* The Class PacketReceiverStage.
*/

@RefreshScope
@Service
@Configuration
@ComponentScan(basePackages = { "${mosip.auth.adapter.impl.basepackage}",
Expand Down Expand Up @@ -112,9 +110,10 @@ public void deployVerticle() {
*/
@Override
public void start() {
router.setRoute(this.postUrl(vertx, null, MessageBusAddress.PACKET_RECEIVER_OUT));
io.vertx.ext.web.Router vertxRouter = this.postUrl(vertx, null, MessageBusAddress.PACKET_RECEIVER_OUT);
router.setRoute(vertxRouter);
this.routes(router);
this.createServer(router.getRouter(), getPort());
this.createServer(vertxRouter, getPort());
}

/**
Expand All @@ -124,10 +123,9 @@ public void start() {
* the router
*/
private void routes(MosipRouter router) {

router.post(getServletPath() + "/registrationpackets");
router.handler(this::processURL, this::processPacket, this::failure);
};
}

/**
* This is for failure handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,10 @@ private void getAdditionalCredentialFields(String regId, String process,
*/
@Override
public void start() {
router.setRoute(this.postUrl(getVertx(),
MessageBusAddress.CREDENTIAL_REQUESTOR_BUS_IN, MessageBusAddress.CREDENTIAL_REQUESTOR_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(),
MessageBusAddress.CREDENTIAL_REQUESTOR_BUS_IN, MessageBusAddress.CREDENTIAL_REQUESTOR_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

public String generatePin() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.json.simple.parser.ParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
Expand Down Expand Up @@ -84,8 +83,6 @@
* @author M1048358 Alok
* @since 1.0.0
*/
@RefreshScope

@Service
@Configuration
@ComponentScan(basePackages = { "${mosip.auth.adapter.impl.basepackage}",
Expand Down Expand Up @@ -187,8 +184,9 @@ public void deployVerticle() {
*/
@Override
public void start() {
router.setRoute(this.postUrl(vertx, MessageBusAddress.MESSAGE_SENDER_BUS, null));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(vertx, MessageBusAddress.MESSAGE_SENDER_BUS, null);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ public void deployVerticle() {

@Override
public void start(){
router.setRoute(this.postUrl(getVertx(),
MessageBusAddress.CMD_VALIDATOR_BUS_IN, MessageBusAddress.CMD_VALIDATOR_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(),
MessageBusAddress.CMD_VALIDATOR_BUS_IN, MessageBusAddress.CMD_VALIDATOR_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.INTRODUCER_VALIDATOR_BUS_IN,
MessageBusAddress.INTRODUCER_VALIDATOR_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.INTRODUCER_VALIDATOR_BUS_IN,
MessageBusAddress.INTRODUCER_VALIDATOR_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.OPERATOR_VALIDATOR_BUS_IN,
MessageBusAddress.OPERATOR_VALIDATOR_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.OPERATOR_VALIDATOR_BUS_IN,
MessageBusAddress.OPERATOR_VALIDATOR_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.mosip.registration.processor.stages.config;

import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -14,7 +13,6 @@
* The beans belonging to other libraries has their own config class to declare the required beans
*/
@Configuration
@RefreshScope
public class PacketClassifierConfig {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;
Expand All @@ -19,7 +18,6 @@
*
* @author Vishwanath V
*/
@RefreshScope
@Service
@Configuration
@ComponentScan(basePackages = { "${mosip.auth.adapter.impl.basepackage}",
Expand Down Expand Up @@ -69,9 +67,10 @@ public void deployVerticle() {

@Override
public void start(){
router.setRoute(this.postUrl(getVertx(),
MessageBusAddress.PACKET_CLASSIFIER_BUS_IN, MessageBusAddress.PACKET_CLASSIFIER_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(),
MessageBusAddress.PACKET_CLASSIFIER_BUS_IN, MessageBusAddress.PACKET_CLASSIFIER_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ public void deployVerticle() {

@Override
public void start(){
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.PACKET_UPLOADER_IN,
MessageBusAddress.PACKET_UPLOADER_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.PACKET_UPLOADER_IN,
MessageBusAddress.PACKET_UPLOADER_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ public void deployVerticle() {

@Override
public void start(){
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.PACKET_VALIDATOR_BUS_IN,
MessageBusAddress.PACKET_VALIDATOR_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.PACKET_VALIDATOR_BUS_IN,
MessageBusAddress.PACKET_VALIDATOR_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}
/*
* (non-Javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ protected String getPropertyPrefix() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.QUALITY_CLASSIFIER_BUS_IN,
MessageBusAddress.QUALITY_CLASSIFIER_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.QUALITY_CLASSIFIER_BUS_IN,
MessageBusAddress.QUALITY_CLASSIFIER_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ protected String getPropertyPrefix() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.SECUREZONE_NOTIFICATION_IN,
MessageBusAddress.SECUREZONE_NOTIFICATION_OUT));
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.SECUREZONE_NOTIFICATION_IN,
MessageBusAddress.SECUREZONE_NOTIFICATION_OUT);
router.setRoute(vertxRouter);
this.routes(router);
this.createServer(router.getRouter(), getPort());
this.createServer(vertxRouter, getPort());
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ public void deployVerticle() {

@Override
public void start() {
router.setRoute(this.postUrl(getVertx(), MessageBusAddress.SUPERVISOR_VALIDATOR_BUS_IN,
MessageBusAddress.SUPERVISOR_VALIDATOR_BUS_OUT));
this.createServer(router.getRouter(), getPort());
io.vertx.ext.web.Router vertxRouter = this.postUrl(getVertx(), MessageBusAddress.SUPERVISOR_VALIDATOR_BUS_IN,
MessageBusAddress.SUPERVISOR_VALIDATOR_BUS_OUT);
router.setRoute(vertxRouter);
this.createServer(vertxRouter, getPort());
}

@Override
Expand Down
Loading