Environment details
- OS type and version: Windows 10
- java version: 11
- spring boot version: 2.6.7
- google-cloud-pubsub library version: 1.115.1
Steps to reproduce
- Create pubsub subscription on gcp with the following configurations:
- Delivery type: Pull
- Acknowledgment deadline: 600 secs
- Exactly once delivery: True
- Retry policy: retry immediately
- Create spring boot application and add
- 'com.google.cloud:spring-cloud-gcp-starter-pubsub' as a dependency . This dependency contains google-cloud-pubsub library
1.115.1
- mavenBom "com.google.cloud:spring-cloud-gcp-dependencies:3.1.0"
- Configure PubSubConfiguration class to receive messages from specified subscription
Code
PubSubConfiguration class
@Bean
public PubSubInboundChannelAdapter messageChannelAdapter(
@Qualifier("inputChannel") MessageChannel inputChannel,
PubSubTemplate pubSubTemplate
) {
PubSubInboundChannelAdapter adapter =
new PubSubInboundChannelAdapter(pubSubTemplate, subscriptionName);
adapter.setOutputChannel(inputChannel);
adapter.setAckMode(AckMode.MANUAL);
adapter.setPayloadType(WorkflowEventMessage.class);
adapter.setErrorChannelName(ERROR_CHANNEL_NAME);
return adapter;
}
@Bean
@Qualifier("inputChannel")
public MessageChannel inputChannel() {
return new DirectChannel();
}
@Bean
@ServiceActivator(inputChannel = "inputChannel")
public MessageHandler messageReceiver() {
// do the logic
originalMessage.ack();
}
application.yaml
spring:
cloud:
gcp:
pubsub:
subscriber:
max-ack-extension-period: 600
Actual behavior
Periodically I see in the logs warning
com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Some acknowledgement ids in the request were invalid. This could be because the acknowledgement ids have expired or the acknowledgement ids were malformed
After investigation I found that this exception appears after modifyAckDeadline call during acknowledgement pubsub message.
Expected behavior
No warnings in the logs.
Additional information
Pubsub messages are processed successfully without redeliveries but with this warning in the logs.
I updated google-cloud-pubsub library to 1.120.12 and tested it, but I still saw this warning in the logs.
If Exactly once delivery is disabled on subscription than there are no warnings in the logs.
Why this warning is displayed and and what issues it can potentially cause?
Environment details
Steps to reproduce
1.115.1
Code
PubSubConfiguration class
application.yaml
Actual behavior
Periodically I see in the logs warning
After investigation I found that this exception appears after modifyAckDeadline call during acknowledgement pubsub message.
Expected behavior
No warnings in the logs.
Additional information
Pubsub messages are processed successfully without redeliveries but with this warning in the logs.
I updated google-cloud-pubsub library to 1.120.12 and tested it, but I still saw this warning in the logs.
If Exactly once delivery is disabled on subscription than there are no warnings in the logs.
Why this warning is displayed and and what issues it can potentially cause?