Skip to content
Merged
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
@@ -0,0 +1 @@
\echo 'rollback Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
2 changes: 1 addition & 1 deletion kernel/kernel-bioapi-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
<micrometer.core.version>1.4.2</micrometer.core.version>
<micrometer.registry.prometheus.version>1.4.2</micrometer.registry.prometheus.version>
<kernel.core.version>1.2.1.0-SNAPSHOT</kernel.core.version>
<kernel.cbeff.version>1.2.0.1</kernel.cbeff.version>
<kernel.cbeff.version>1.2.0.4</kernel.cbeff.version>
<jacoco.maven.plugin.version>0.8.5</jacoco.maven.plugin.version>
</properties>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import javax.annotation.PostConstruct;

import io.mosip.kernel.idgenerator.util.Utility;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down Expand Up @@ -65,6 +66,10 @@ public class IDGeneratorVertxApplication {
*/
private static Logger LOGGER;

private static final long DEFAULT_VID_JOB_FREQUENCY = 10000L;

private static final long DEFAULT_UIN_JOB_FREQUENCY=10000L;

/**
* Server context path.
*/
Expand Down Expand Up @@ -173,7 +178,7 @@ private static void startApplication() {
Verticle[] workerVerticles = { new VidPoolCheckerVerticle(context), new VidPopulatorVerticle(context),
new VidExpiryVerticle(context), new VidIsolatorVerticle(context) };
Stream.of(workerVerticles).forEach(verticle -> deploy(verticle, workerOptions, vertx));
vertx.setTimer(1000, handler -> initVIDPool());
vertx.setTimer(getVidInitJobFrequency(), handler -> initVIDPool());
Verticle[] uinVerticles = { new UinGeneratorVerticle(context),new UinTransferVerticle(context)};
Stream.of(uinVerticles).forEach(verticle -> vertx.deployVerticle(verticle, stringAsyncResult -> {
if (stringAsyncResult.succeeded()) {
Expand All @@ -183,6 +188,7 @@ private static void startApplication() {
+ stringAsyncResult.cause());
}
}));
vertx.setTimer(getUinInitJobFrequency(), handler -> initUINPool());
vertx.setTimer(1000, handler -> initUINPool());
}

Expand All @@ -205,4 +211,18 @@ private static void deploy(Verticle verticle, DeploymentOptions opts, Vertx vert
}
});
}

/**
* Get VID init job frequency from system properties or default.
*/
private static long getVidInitJobFrequency() {
return Utility.getLongProperty("mosip.kernel.vid.init-job-frequency", DEFAULT_VID_JOB_FREQUENCY);
}

/**
* Get UIN init job frequency from system properties or default.
*/
private static long getUinInitJobFrequency() {
return Utility.getLongProperty("mosip.kernel.uin.init-job-frequency", DEFAULT_UIN_JOB_FREQUENCY);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.mosip.kernel.idgenerator.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.function.Function;

public class Utility {

private static final Logger LOGGER = LoggerFactory.getLogger(Utility.class);

public static <T> T getProperty(String propertyKey, T defaultValue, Function<String, T> parser) {
try {
String value = System.getProperty(propertyKey);
if (value == null || value.trim().isEmpty()) {
LOGGER.info("{} is missing. Using default: {}", propertyKey, defaultValue);
return defaultValue;
}
return parser.apply(value.trim());
} catch (Exception e) {
LOGGER.warn("Error reading property {}. Using default: {}", propertyKey, defaultValue, e);
return defaultValue;
}
}

public static long getLongProperty(String propertyKey, long defaultValue) {
return getProperty(propertyKey, defaultValue, Long::parseLong);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public interface UinRepository extends JpaRepository<UinEntity, String> {
@Query(value = "UPDATE kernel.uin SET uin_status=:status, upd_by=:contextUser, upd_dtimes=:uptimes where uin=:uin", nativeQuery = true)
public void updateStatus(@Param("status") String status, @Param("contextUser") String contextUser,
@Param("uptimes") LocalDateTime uptimes, @Param("uin") String uin);
@Query(value = "select uu.uin, uu.cr_by, uu.cr_dtimes, uu.del_dtimes, uu.is_deleted, uu.upd_by, uu.upd_dtimes, uu.uin_status from kernel.uin uu where uu.uin_status=?", nativeQuery = true)
public List<UinEntity> findByStatus(String status);

@Query(value = "select uu.uin, uu.cr_by, uu.cr_dtimes, uu.del_dtimes, uu.is_deleted, uu.upd_by, uu.upd_dtimes, uu.uin_status from kernel.uin uu where uu.uin_status=:status LIMIT :pageSize", nativeQuery = true)
public List<UinEntity> findByStatus(@Param("status") String status, @Param("pageSize") int pageSize);

long countByStatusAndIsDeletedFalse(String status);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -61,7 +62,10 @@ public class UinServiceImpl implements UinService {
*/
@Autowired
private UINMetaDataUtil metaDataUtil;


@Value("${mosip.kernel.uin.page.size:50000}")
private int pageSize;

@Autowired
private VertxAuthenticationProvider authHandler;

Expand Down Expand Up @@ -128,7 +132,7 @@ public UinStatusUpdateReponseDto updateUinStatus(UinEntity uinAck, RoutingContex
@Transactional(transactionManager = "transactionManager")
@Override
public void transferUin() {
List<UinEntity> uinEntities=uinRepository.findByStatus(UinGeneratorConstant.ASSIGNED);
List<UinEntity> uinEntities=uinRepository.findByStatus(UinGeneratorConstant.ISSUED,pageSize);
List<UinEntityAssigned> uinEntitiesAssined = modelMapper.map(uinEntities, new TypeToken<List<UinEntityAssigned>>() {}.getType());
uinRepositoryAssigned.saveAll(uinEntitiesAssined);
uinRepository.deleteAll(uinEntities);
Expand Down
4 changes: 2 additions & 2 deletions kernel/kernel-notification-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
It will be required only when running the below command
mvn clean verify -Dgpg.skip -DskipTests -Dmaven.javadoc.skip -P openapi-doc-generate-profile
Note:- It is not required to have the latest version of auth adapter.-->
<version>v1.2.1.0-SNAPSHOT</version> <!-- Updating to last released version to remove circular dependency in release -->
<version>1.2.0.1</version> <!-- Updating to last released version to remove circular dependency in release -->
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
Expand All @@ -485,7 +485,7 @@
mvn clean verify -Dgpg.skip -DskipTests -Dmaven.javadoc.skip -P openapi-doc-generate-profile
Note:- It is not required to have the latest version of kernel-smsserviceprovider-msg91.-->
<artifactId>kernel-smsserviceprovider-msg91</artifactId>
<version>1.2.1.0-SNAPSHOT</version>
<version>1.2.0.1</version>
</dependency>
</dependencies>
<build>
Expand Down
2 changes: 1 addition & 1 deletion kernel/kernel-pdfgenerator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<aspectjweaver.version>1.8.12</aspectjweaver.version>
<micrometer.core.version>1.4.2</micrometer.core.version>
<micrometer.registry.prometheus.version>1.4.2</micrometer.registry.prometheus.version>
<kernel.core.version>1.2.0.1</kernel.core.version>
<kernel.core.version>1.2.1.0-SNAPSHOT</kernel.core.version>
<pdfbox.version>2.0.29</pdfbox.version>
<jacoco.maven.plugin.version>0.8.5</jacoco.maven.plugin.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion kernel/kernel-ridgenerator-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
It will be required only when running the below command
mvn clean verify -Dgpg.skip -DskipTests -Dmaven.javadoc.skip -P openapi-doc-generate-profile
Note:- It is not required to have the latest version of auth adapter.-->
<version>v1.2.1.0-SNAPSHOT-B2</version> <!-- Updating to last released version to remove circular dependency in release -->
<version>1.2.0.1</version> <!-- Updating to last released version to remove circular dependency in release -->
</dependency>
</dependencies>
<build>
Expand Down