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

Allow specifying a custom subscription as a consumer endpoint #262

Merged
merged 2 commits into from
Feb 19, 2021

Conversation

ttomsu
Copy link

@ttomsu ttomsu commented Feb 5, 2021

Fixes #181

Copy link
Member

@meltsufin meltsufin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refdoc also needs to be updated accordingly.

Copy link
Contributor

@elefeint elefeint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I am just not sure about what fully qualified subscription behavior will be in a different project. Did you try it?

@meltsufin
Copy link
Member

@elefeint I think we were reviewing in parallel :)

@elefeint
Copy link
Contributor

elefeint commented Feb 5, 2021

Yup. I went through my mailbox in reverse chronological order, and you moved in chronological order, and @ttomsu PR is where the two workflows intersected.

@ttomsu ttomsu added the pubsub label Feb 14, 2021
Copy link
Member

@meltsufin meltsufin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some clarifications in the doc

docs/src/main/asciidoc/spring-stream.adoc Outdated Show resolved Hide resolved
@@ -75,13 +75,24 @@ spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.ack-mode=AUTO_A
If automatic resource creation is turned ON and the subscription and/or the topic do not exist for a consumer, a subscription and potentially a topic will be created.
The topic name will be the same as the destination name, and the subscription name will be the destination name followed by the consumer group name.

Regardless of the `auto-create-resources` setting, if the consumer group is not specified, an anonymous one will be created with the name `anonymous.<destinationName>.<randomUUID>`.
Regardless of the `auto-create-resources` setting, you can control the subscriber with the following options (in order of precedence):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Regardless of the `auto-create-resources` setting, you can control the subscriber with the following options (in order of precedence):
Regardless of the `auto-create-resources` setting, the subscription name will be determined as follows (in order of precedence):

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up removing this text block

Regardless of the `auto-create-resources` setting, if the consumer group is not specified, an anonymous one will be created with the name `anonymous.<destinationName>.<randomUUID>`.
Regardless of the `auto-create-resources` setting, you can control the subscriber with the following options (in order of precedence):

* A pre-existing subscription (use `spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.subscriptionName`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* A pre-existing subscription (use `spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.subscriptionName`)
* If specified, `spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.subscriptionName` property

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the "in order of precedence" above, I don't think it's necessary to have to say "if specified"

Regardless of the `auto-create-resources` setting, you can control the subscriber with the following options (in order of precedence):

* A pre-existing subscription (use `spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.subscriptionName`)
* A consumer group that uses the topic name (use `spring.cloud.stream.bindings.events.group` to create a subscription named `<topicName>.<group>`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* A consumer group that uses the topic name (use `spring.cloud.stream.bindings.events.group` to create a subscription named `<topicName>.<group>`)
* If specified, `spring.cloud.stream.bindings.events.group` property that results in a subscription named `<topicName>.<group>`

@@ -75,13 +75,24 @@ spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.ack-mode=AUTO_A
If automatic resource creation is turned ON and the subscription and/or the topic do not exist for a consumer, a subscription and potentially a topic will be created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a note here that, only anonymous subscriptions will be cleaned up.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's mentioned twice below this.

@sonarcloud
Copy link

sonarcloud bot commented Feb 19, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

85.7% 85.7% Coverage
0.0% 0.0% Duplication

@ttomsu ttomsu dismissed elefeint’s stale review February 19, 2021 18:40

Elena is on vacation

@ttomsu ttomsu merged commit fcfa64e into main Feb 19, 2021
@ttomsu ttomsu deleted the custom-subscription branch February 19, 2021 18:40
kateryna216 added a commit to kateryna216/spring-cloud-gcp that referenced this pull request Oct 20, 2022
…CloudPlatform#262)

* Allow specifying a custom subscription as a consumer endpoint
prash-mi pushed a commit that referenced this pull request Jun 20, 2023
Introduce a parallel implementation of the driver based on the client library, with the goal of providing consistent behavior for JDBC and R2DBC Cloud Spanner drivers.

For now, gRPC implementation remains primary; switching to the client library implementation requires providing .option(Option.valueOf("client-implementation"), "client-library") when creating a connection factory.

Query with parameter binding
DML with transactions
DDL temporarily falls back on gRPC implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't create ConsumerDestination with group value only (Spring Cloud GCP PubSub Stream Binder)
3 participants