|
1 | 1 | package org.folio.service.event; |
2 | 2 |
|
3 | 3 | import static org.apache.logging.log4j.LogManager.getLogger; |
4 | | -import static org.folio.service.event.EntityChangedEventPublisherFactory.requestEventPublisher; |
5 | 4 |
|
6 | 5 | import java.util.Map; |
7 | 6 |
|
|
11 | 10 | import org.folio.kafka.SimpleKafkaProducerManager; |
12 | 11 | import org.folio.kafka.services.KafkaEnvironmentProperties; |
13 | 12 | import org.folio.kafka.services.KafkaProducerRecordBuilder; |
14 | | -import org.folio.rest.jaxrs.model.Request; |
15 | 13 | import org.folio.rest.tools.utils.TenantTool; |
16 | 14 |
|
17 | 15 | import io.vertx.core.Context; |
@@ -49,26 +47,21 @@ public Future<Void> publish(K key, DomainEvent<T> event, Map<String, String> oka |
49 | 47 | .topic(kafkaTopic) |
50 | 48 | .propagateOkapiHeaders(okapiHeaders) |
51 | 49 | .build(); |
52 | | - log.info("publish:: kafkaRecord = [{}]", producerRecord); |
53 | | - |
54 | 50 | KafkaProducer<K, String> producer = null; |
55 | 51 | try { |
56 | 52 | producer = getOrCreateProducer(); |
57 | 53 | log.info("publish:: Producer created, sending the record..."); |
58 | 54 |
|
59 | 55 | producer.send(producerRecord) |
60 | | - .onSuccess(r -> log.info("publish:: Succeeded sending domain event with key [{}], " + |
61 | | - "kafka record [{}]", key, producerRecord)) |
| 56 | + .onSuccess(r -> log.info("publish:: Succeeded sending domain event with key [{}]", key)) |
62 | 57 | .onFailure(cause -> { |
63 | | - log.error("publish:: Unable to send domain event with key [{}], kafka record [{}]", |
64 | | - key, producerRecord, cause); |
| 58 | + log.error("publish:: Unable to send domain event with key [{}]", key, cause); |
65 | 59 | failureHandler.handle(cause, producerRecord); |
66 | 60 | }) |
67 | 61 | .eventually(producer::flush) |
68 | 62 | .eventually(producer::close); |
69 | 63 | } catch (Exception e) { |
70 | | - log.error("publish:: Failed to initiate send for domain event with key [{}], kafka record [{}]", |
71 | | - key, producerRecord, e); |
| 64 | + log.error("publish:: Failed to initiate send for domain event with key [{}]", key, e); |
72 | 65 | if (producer != null) { |
73 | 66 | log.info("publish:: Producer is not null, trying to close. Event key: {}.", key); |
74 | 67 | producer.close(); |
|
0 commit comments