Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
thjarvin committed Sep 27, 2024
1 parent fc9800c commit 24f60e7
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class StopCancellationPublisher {

Expand All @@ -28,7 +31,12 @@ public void sendStopCancellations(InternalMessages.StopCancellations message) th
}

private void sendStopCancellations(InternalMessages.StopCancellations message, long timestamp) throws PulsarClientException {
log.info("Sending {} stop cancellations with {} affected journey patterns", message.getStopCancellationsCount(), message.getAffectedJourneyPatternsCount());
List<String> stopIds = new ArrayList<>();
if (message.getStopCancellationsList() != null) {
stopIds = message.getStopCancellationsList().stream().map(x -> x.getStopId()).collect(Collectors.toList());
}
log.info("Sending {} stop cancellations with {} affected journey patterns. Stop ids: {}",
message.getStopCancellationsCount(), message.getAffectedJourneyPatternsCount(), stopIds);
try {
producer.newMessage().value(message.toByteArray())
.eventTime(timestamp)
Expand Down

0 comments on commit 24f60e7

Please sign in to comment.