Skip to content

Commit

Permalink
Merge pull request #110 from sunbird-cb/dup_records_fixes
Browse files Browse the repository at this point in the history
Dup records fixes
  • Loading branch information
pkranga authored Jul 20, 2022
2 parents f839b84 + 6f7ad89 commit 66ae2f5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
14 changes: 7 additions & 7 deletions src/main/java/org/sunbird/common/util/CbExtServerProperties.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.sunbird.common.util;

import java.util.Arrays;
import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Component
public class CbExtServerProperties {

Expand Down Expand Up @@ -308,16 +308,16 @@ public class CbExtServerProperties {

@Value("${user.registration.custodian.orgName}")
private String custodianOrgName;

@Value("${user.position.master.list.file}")
private String masterPositionListFileName;

@Value("${user.registration.welcome.email.template}")
private String welcomeEmailTemplate;

@Value("${user.registration.welcome.email.subject}")
private String welcomeEmailSubject;

@Value("${sb.org.create.path}")
private String lmsOrgCreatePath;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public class UserRegistrationConsumer {
UserRegistrationNotificationService userRegNotificationService;

@SuppressWarnings("unchecked")
@KafkaListener(topicPartitions = {
@TopicPartition(topic = "${kafka.topics.user.registration.register.event}", partitions = { "0", "1", "2",
"3" }) })
@KafkaListener(topics = "${kafka.topics.user.registration.register.event}",groupId = "${kafka.topics.user.registration.register.event.consumer.group}" )
public void processMessage(ConsumerRecord<String, String> data) {
UserRegistration userRegistration = gson.fromJson(data.value(), UserRegistration.class);
/*
Expand Down Expand Up @@ -98,9 +96,7 @@ public void processMessage(ConsumerRecord<String, String> data) {
userRegNotificationService.sendNotification(userRegistration);
}

@KafkaListener(topicPartitions = {
@TopicPartition(topic = "${kafka.topics.user.registration.createUser}", partitions = { "0", "1", "2",
"3" }) })
@KafkaListener(topics = "${kafka.topics.user.registration.createUser}",groupId = "${kafka.topics.user.registration.createUser.consumer.group}")
public void processCreateUserMessage(ConsumerRecord<String, String> data) {
try {
WfRequest wfRequest = gson.fromJson(data.value(), WfRequest.class);
Expand All @@ -112,9 +108,7 @@ public void processCreateUserMessage(ConsumerRecord<String, String> data) {
}
}

@KafkaListener(topicPartitions = {
@TopicPartition(topic = "${kafka.topics.user.registration.auto.createUser}", partitions = { "0", "1", "2",
"3" }) })
@KafkaListener(topics = "${kafka.topics.user.registration.auto.createUser}",groupId = "${kafka.topics.user.registration.auto.createUser.consumer.group}")
public void processAutoCreateUserEvent(ConsumerRecord<String, String> data) {
try {
UserRegistration userRegistration = gson.fromJson(data.value(), UserRegistration.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public class WATConsumer {
private static final String[] ignorableFieldsForPublishedState = { "userName", "userEmail", "submittedFromName",
"submittedFromEmail", "submittedToName", "submittedToEmail", "createdByName", "updatedByName" };

@KafkaListener(id = "id2", groupId = "watTelemetryTopic-consumer", topicPartitions = {
@TopicPartition(topic = "${kafka.topics.wat.telemetry.event}", partitions = { "0", "1", "2", "3" }) })
@KafkaListener(id = "id2", topics = "${kafka.topics.wat.telemetry.event}", groupId = "${kafka.topics.wat.telemetry.event.topic.consumer}")
public void processMessage(ConsumerRecord<String, String> data) {
try {
logger.info("Consuming the audit records for WAT .....");
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ kafka.topics.wat.telemetry.event=watTelemetryTopic
kafka.topics.parent.telemetry.event=dev.telemetry.raw
kafka.topics.parent.rating.event = dev.rating.event
kafka.topics.userutility.telemetry.event=userLastLoginTopic
kafka.topics.wat.telemetry.event.topic.consumer=watTelemetryTopic-consumer

userutility.telemetry.event.pdata.id=dev.sunbird.cb.ext.service
userutility.telemetry.event.pdata.pid=sunbird-cb-ext-service
Expand Down Expand Up @@ -187,6 +188,9 @@ es.user.registration.index=user_registration
kafka.topics.user.registration.register.event=user.register.event
kafka.topics.user.registration.createUser=workflow.user.registration.createUser
kafka.topics.user.registration.auto.createUser=user.register.createUser.event
kafka.topics.user.registration.auto.createUser.consumer.group = userAutoRegistrationTopic-consumer
kafka.topics.user.registration.createUser.consumer.group = userRegistrationTopic-consumer
kafka.topics.user.registration.register.event.consumer.group = userRegistrationRegisterEventTopic-consumer
#Provide Dept Id as comma separated values here to exclude the details
user.registration.dept.exclude.list=0133334975707217922
user.registration.workflow.service.name=user_registration
Expand Down

0 comments on commit 66ae2f5

Please sign in to comment.