diff --git a/src/main/java/fi/hsl/transitdata/stop/cancellations/StopCancellationPublisher.java b/src/main/java/fi/hsl/transitdata/stop/cancellations/StopCancellationPublisher.java index de66cfa..bcaeaf8 100644 --- a/src/main/java/fi/hsl/transitdata/stop/cancellations/StopCancellationPublisher.java +++ b/src/main/java/fi/hsl/transitdata/stop/cancellations/StopCancellationPublisher.java @@ -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 { @@ -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 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)