-
Notifications
You must be signed in to change notification settings - Fork 695
Pubsub stream binder via synchronous pull #1419
Conversation
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.
...es/spring-cloud-gcp-pubsub-polling-binder-sample/src/main/java/com/example/PollableSink.java
Outdated
Show resolved
Hide resolved
...les/spring-cloud-gcp-pubsub-polling-binder-sample/src/main/java/com/example/SinkExample.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/cloud/gcp/stream/binder/pubsub/PubSubMessageChannelBinder.java
Show resolved
Hide resolved
Other changes: * Modified sample Pub/Sub Sender app to accept the number of times to send the message and append sequential message number to each copy. * Split sample Pub/Sub Receiver app into StreamingPull (original behavior) and SyncPull (new implementation) configuration subclasses.
Co-Authored-By: elefeint <41136058+elefeint@users.noreply.github.com>
46ebad3
to
2ad3c3d
Compare
I am going to fix that commit history. I've created the branch off of |
Codecov Report
@@ Coverage Diff @@
## master #1419 +/- ##
============================================
+ Coverage 68.57% 69.03% +0.46%
- Complexity 1475 1488 +13
============================================
Files 209 205 -4
Lines 5826 5846 +20
Branches 585 593 +8
============================================
+ Hits 3995 4036 +41
+ Misses 1595 1571 -24
- Partials 236 239 +3
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.
Only one concern, plus the Copyright in the PubSubMessageChannelBinder
has to be updated.
|
||
this.restTemplate.postForObject("/newMessage", map, String.class); | ||
|
||
Callable<Boolean> logCheck = () -> baos.toString().contains("New message received from testUserName via polling: " + message + " at "); |
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.
Is this message not finished or am I missing something?
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.
" at " would be followed by a timestamp, which is not verifiable without mocking the clock. I am removing " at " from the verification string, since it looks confusing without adding value.
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 need some refdoc updates, at least to say we support this for the binder and link to the sample?
The sample app prompts a user for a message and their user name. | ||
That data is added to a `UserMessage` object, together with the time of message creation, and is sent through Google Cloud Pub/Sub to a sink which simply logs the message. | ||
|
||
If the topic and subscription for the sink and source don't exist, the binder will automatically create them in Google Cloud Pub/Sub based on the values in link:src/main/resources/application.properties[application.properties]. |
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.
Maybe point out the key pieces of code here in the description?
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.
Great!
Add
PubSubMessageSource
integration toPubSubMessageChannelBinder
.Fixes #1365.