Skip to content

Commit

Permalink
[MODAUD-195]. Fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BKadirkhodjaev committed Oct 31, 2024
1 parent a8f2c66 commit 87f4c37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public InvoiceEventsHandler(@Autowired Vertx vertx,
}

@Override
public Future<String> handle(KafkaConsumerRecord<String, String> record) {
public Future<String> handle(KafkaConsumerRecord<String, String> kafkaConsumerRecord) {
Promise<String> result = Promise.promise();
List<KafkaHeader> kafkaHeaders = record.headers();
List<KafkaHeader> kafkaHeaders = kafkaConsumerRecord.headers();
OkapiConnectionParams okapiConnectionParams = new OkapiConnectionParams(KafkaHeaderUtils.kafkaHeadersToMap(kafkaHeaders), vertx);
InvoiceAuditEvent event = new JsonObject(record.value()).mapTo(InvoiceAuditEvent.class);
InvoiceAuditEvent event = new JsonObject(kafkaConsumerRecord.value()).mapTo(InvoiceAuditEvent.class);
LOGGER.info("handle:: Starting processing of Invoice audit event with id: {} for invoice id: {}", event.getId(), event.getInvoiceId());

invoiceAuditEventsService.saveInvoiceAuditEvent(event, okapiConnectionParams.getTenantId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ void shouldNotProcessEvent() {
Assertions.assertTrue(save.failed());
}

private KafkaConsumerRecord<String, String> buildKafkaConsumerRecord(InvoiceAuditEvent record) {
String topic = KafkaTopicNameHelper.formatTopicName(KAFKA_ENV, getDefaultNameSpace(), TENANT_ID, record.getAction().toString());
ConsumerRecord<String, String> consumerRecord = buildConsumerRecord(topic, record);
private KafkaConsumerRecord<String, String> buildKafkaConsumerRecord(InvoiceAuditEvent kafkaConsumerRecord) {
String topic = KafkaTopicNameHelper.formatTopicName(KAFKA_ENV, getDefaultNameSpace(), TENANT_ID, kafkaConsumerRecord.getAction().toString());
ConsumerRecord<String, String> consumerRecord = buildConsumerRecord(topic, kafkaConsumerRecord);
return new KafkaConsumerRecordImpl<>(consumerRecord);
}

Expand Down

0 comments on commit 87f4c37

Please sign in to comment.