-
Notifications
You must be signed in to change notification settings - Fork 693
PubsubTemplate subscribe in other projects #1880
Conversation
This change to the DefaultSubscriberFactory allows the project id of the subscription to be overwitten directly from the subscription specification in the subscription name string. This allows use-cases like pubSubTemplate.subscribe("projects/other-project/subscriptions/the-subscription", messageReceiver). This change is applied across the board to allow subscribing to, creating, and deleting subscriptions using fully-qualified subscription names. Fixes #1877. Related to #1678.
Codecov Report
@@ Coverage Diff @@
## master #1880 +/- ##
============================================
+ Coverage 70.2% 71.57% +1.36%
- Complexity 1780 1817 +37
============================================
Files 236 236
Lines 6794 6706 -88
Branches 695 689 -6
============================================
+ Hits 4770 4800 +30
+ Misses 1705 1589 -116
+ Partials 319 317 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple nit-picks.
Everything else LGTM
* @param subscriptionName the name of the new subscription | ||
* @param topicName the name of the topic being subscribed to | ||
* @param subscriptionName canonical subscription name, e.g., "subscriptionName", or the fully-qualified | ||
* subscription name in the "projects/<project_name>/subscriptions/<subscription_name>" format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use {@code}
instead?
} | ||
|
||
/** | ||
* Creates a {@link ProjectSubscriptionName} based on a subscription name within a project or the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method JavaDocs must be imperative - Create
: https://github.com/spring-projects/spring-framework/wiki/Code-Style#javadoc-formatting
@@ -48,7 +48,8 @@ | |||
* | |||
* @deprecated as of 1.1, use {@link #subscribe(String, Consumer)} instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @deprecated
tag must be last one:
<module name="AtclauseOrder">
<property name="target" value="METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="tagOrder" value="@param, @return, @throws, @since, @deprecated, @see"/>
</module>
I'm not sure hot this passes a Checkstyle...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, missed it
@@ -98,7 +98,7 @@ public PubSubAdmin(GcpProjectIdProvider projectIdProvider, TopicAdminClient topi | |||
* Create a new topic on Google Cloud Pub/Sub. | |||
* | |||
* @param topicName the name for the new topic within the current project, or the | |||
* fully-qualified topic name in the projects/<project_name>/topics/<topic_name> format | |||
* fully-qualified topic name in the {@code "projects/<project_name>/topics/<topic_name>"} format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to that wrapped into double quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -48,7 +48,8 @@ | |||
* | |||
* @deprecated as of 1.1, use {@link #subscribe(String, Consumer)} instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this?
This change to the DefaultSubscriberFactory allows the project id of the
subscription to be overwitten directly from the subscription specification in the
subscription name string.
This allows use-cases like
pubSubTemplate.subscribe("projects/other-project/subscriptions/the-subscription",
messageReceiver).
This change is applied across the board to allow subscribing to,
creating, and deleting subscriptions using fully-qualified subscription names.
Fixes #1877.
Related to #1678.