Closed minogin closed 1 month ago
com.google.cloud:spring-cloud-gcp-pubsub:5.0.4
When using com.google.cloud.spring.pubsub.core.subscriber.PubSubSubscriberTemplate#pullAndConvertAsync and an exception happens during message conversion the future just never completes and you never get neither exception nor the message.
com.google.cloud.spring.pubsub.core.subscriber.PubSubSubscriberTemplate#pullAndConvertAsync
@Override public <T> CompletableFuture<List<ConvertedAcknowledgeablePubsubMessage<T>>> pullAndConvertAsync( String subscription, Integer maxMessages, Boolean returnImmediately, Class<T> payloadType) { final CompletableFuture<List<ConvertedAcknowledgeablePubsubMessage<T>>> completableFuture = new CompletableFuture<>(); this.pullAsync(subscription, maxMessages, returnImmediately) .whenComplete( (ackableMessages, exception) -> { if (exception != null) { completableFuture.completeExceptionally(exception); return; } completableFuture.complete( this.toConvertedAcknowledgeablePubsubMessages(payloadType, ackableMessages)); }); return completableFuture; }
The problem is here:
completableFuture.complete( this.toConvertedAcknowledgeablePubsubMessages(payloadType, ackableMessages));
when toConvertedAcknowledgeablePubsubMessages throws an exception.
toConvertedAcknowledgeablePubsubMessages
Fixed in release 5.5.1
com.google.cloud:spring-cloud-gcp-pubsub:5.0.4
When using
com.google.cloud.spring.pubsub.core.subscriber.PubSubSubscriberTemplate#pullAndConvertAsync
and an exception happens during message conversion the future just never completes and you never get neither exception nor the message.The problem is here:
when
toConvertedAcknowledgeablePubsubMessages
throws an exception.