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

Increase default Pub/Sub health indicator timeout to 2000 #420

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/pubsub.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ So, take care not to configure a subscription that has a business impact, or ins
| Name | Description | Required | Default value
| `management.health.pubsub.enabled` | Whether to enable the Pub/Sub health indicator | No | `true` with Spring Boot Actuator, `false` otherwise
| `spring.cloud.gcp.pubsub.health.subscription` | Subscription to health check against by pulling a message | No | Random non-existent
| `spring.cloud.gcp.pubsub.health.timeout-millis` | Milliseconds to wait for response from Pub/Sub before timing out | No | `1000`
| `spring.cloud.gcp.pubsub.health.timeout-millis` | Milliseconds to wait for response from Pub/Sub before timing out | No | `2000`
| `spring.cloud.gcp.pubsub.health.acknowledge-messages` | Whether to acknowledge messages pulled from the optionally specified subscription | No | `false`
|===

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class PubSubHealthIndicatorProperties {
/**
* Milliseconds to wait for response from Pub/Sub before timing out.
*/
private Long timeoutMillis = 1000L;
private Long timeoutMillis = 2000L;

/**
* Whether to acknowledge messages pulled from {@link #subscription}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void healthIndicatorPresent_defaults() throws Exception {
PubSubHealthIndicator healthIndicator = ctx.getBean(PubSubHealthIndicator.class);
assertThat(healthIndicator).isNotNull();
assertThat(healthIndicator.getSubscription()).matches(UUID_PATTERN);
assertThat(healthIndicator.getTimeoutMillis()).isEqualTo(1000);
assertThat(healthIndicator.getTimeoutMillis()).isEqualTo(2000);
assertThat(healthIndicator.isAcknowledgeMessages()).isFalse();
assertThat(healthIndicator.isSpecifiedSubscription()).isFalse();
verify(mockPubSubTemplate).pullAsync(healthIndicator.getSubscription(), 1, true);
Expand Down