Merge branch 'feature/SUPPORT-9528' into develop
This commit is contained in:
commit
1609e3137e
1 changed files with 10 additions and 1 deletions
|
|
@ -1,6 +1,10 @@
|
|||
package ru.micord.ervu.audit.service.impl;
|
||||
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
|
@ -26,7 +30,12 @@ public class BaseAuditKafkaPublisher implements AuditKafkaPublisher {
|
|||
|
||||
@Override
|
||||
public void publishEvent(String topic, String message) {
|
||||
kafkaTemplate.send(topic, message)
|
||||
String messageId = UUID.randomUUID().toString();
|
||||
ProducerRecord<String, String> record = new ProducerRecord<>(topic, message);
|
||||
record.headers()
|
||||
.add("messageId", messageId.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
kafkaTemplate.send(record)
|
||||
.addCallback(
|
||||
result -> {
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue