Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Deprecated Calls #9

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static datawave.microservice.query.messaging.AcknowledgementCallback.Status.NACK;
import static datawave.microservice.query.messaging.kafka.KafkaQueryResultsManager.TOPIC_PREFIX;

import java.time.Duration;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -154,7 +155,7 @@ public void onMessage(ConsumerRecord<String,String> data, final Acknowledgment a
latch.countDown();
});
} catch (JsonProcessingException e) {
acknowledgment.nack(0);
acknowledgment.nack(Duration.ofNanos(0));
if (log.isTraceEnabled()) {
log.trace("Query {} Nacking record from topic {} and partition {} at offset {} because the result could not be deserialized", queryId,
data.topic(), data.partition(), data.offset());
Expand All @@ -181,21 +182,21 @@ public void onMessage(ConsumerRecord<String,String> data, final Acknowledgment a
data.offset());
}
} else if (ackStatus.get() == NACK) {
acknowledgment.nack(0);
acknowledgment.nack(Duration.ofNanos(0));
if (log.isTraceEnabled()) {
log.trace("Query {} Nacking record {} from topic {} and partition {} at offset {} because the record was rejected", queryId, resultId,
data.topic(), data.partition(), data.offset());
}
}
} catch (InterruptedException ie) {
acknowledgment.nack(0);
acknowledgment.nack(Duration.ofNanos(0));
if (log.isTraceEnabled()) {
log.trace("Query {} Nacking record {} from topic {} and partition {} at offset {} because the latch was interrupted", queryId, resultId,
data.topic(), data.partition(), data.offset());
}
}
} else {
acknowledgment.nack(0);
acknowledgment.nack(Duration.ofNanos(0));
if (log.isTraceEnabled()) {
log.trace("Query {} Nacking record from topic {} and partition {} at offset {} because the container was stopped", queryId, data.topic(),
data.partition(), data.offset());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private TopicDescription describeTopic(String topic) {
// @formatter:off
topicDesc = adminClient
.describeTopics(Collections.singleton(topic))
.values()
.topicNameValues()
.get(topic)
.get();
// @formatter:on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public CachingConnectionFactory createCachingConnectionFactory(MessagingProperti
finalConnectionFactory.setPublisherConfirmType(rabbitMqProperties.getPublisherConfirmType());
}

finalConnectionFactory.setPublisherConfirms(CachingConnectionFactory.ConfirmType.SIMPLE != rabbitMqProperties.getPublisherConfirmType()
ivakegg marked this conversation as resolved.
Show resolved Hide resolved
&& rabbitMqProperties.isPublisherConfirms());
finalConnectionFactory.setPublisherReturns(rabbitMqProperties.isPublisherReturns());
}
return finalConnectionFactory;
Expand Down
Loading