Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
PFM-4871: added the changes to persist sms in a table in mgramseva
Browse files Browse the repository at this point in the history
  • Loading branch information
debasishchakraborty-egovt committed Oct 6, 2023
1 parent 1ccdb4e commit f9818bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public class SMSProperties {
@Value("${save.sms.entity.topic}")
private String saveSmsTopic;

@Value("${save.sms.entity.enabled}")
private boolean isSaveSmsEnable;

@Setter(AccessLevel.PROTECTED) private List<Pattern> whitelistPatterns;
@Setter(AccessLevel.PROTECTED) private List<Pattern> blacklistPatterns;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ public void sendSMS(Sms sms) {
return;
}
log.info("calling submitToExternalSmsService() method");
SmsSaveRequest smsSaveRequest = SmsSaveRequest.builder().mobileNumber(sms.getMobileNumber()).message(sms.getMessage())
.category(sms.getCategory()).templateId(sms.getTemplateId()).tenantId(sms.getTenantId()).createdtime(System.currentTimeMillis()).build();
log.info("SMS request to save sms topic" +smsSaveRequest );
producer.push(smsProperties.getSaveSmsTopic(), smsSaveRequest);
if(smsProperties.isSaveSmsEnable()) {
SmsSaveRequest smsSaveRequest = SmsSaveRequest.builder().mobileNumber(sms.getMobileNumber()).message(sms.getMessage())
.category(sms.getCategory()).templateId(sms.getTemplateId()).tenantId(sms.getTenantId()).createdtime(System.currentTimeMillis()).build();
log.info("SMS request to save sms topic" + smsSaveRequest);
producer.push(smsProperties.getSaveSmsTopic(), smsSaveRequest);
}
submitToExternalSmsService(sms);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ spring.kafka.consumer.properties.spring.json.type.mapping=smsRequest:org.egov.we
spring.kafka.listener.missing-topics-fatal=false

#persister topic of sms
save.sms.entity.topic = save-sms-entity-application
save.sms.entity.topic = save-sms-entity-application
save.sms.entity.enabled = true

0 comments on commit f9818bc

Please sign in to comment.