Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Pubsub stream binder via synchronous pull #1419

Merged
merged 36 commits into from
Feb 5, 2019
Merged

Conversation

elefeint
Copy link
Contributor

@elefeint elefeint commented Jan 30, 2019

Add PubSubMessageSource integration to PubSubMessageChannelBinder.

Fixes #1365.

Copy link
Contributor

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

So, far so good.

I don't see any obstacles to merge this just after #1321

Thanks

@elefeint elefeint changed the base branch from pubsub-pull to master February 1, 2019 16:43
@elefeint
Copy link
Contributor Author

elefeint commented Feb 1, 2019

I am going to fix that commit history. I've created the branch off of pubsub-pull, which caused commits to be duplicated after rebase.

@codecov-io
Copy link

codecov-io commented Feb 1, 2019

Codecov Report

Merging #1419 into master will increase coverage by 0.46%.
The diff coverage is 0%.

Impacted file tree graph

@@             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
Flag Coverage Δ Complexity Δ
#integration ? ?
#unittests 69.03% <0%> (+0.46%) 1488 <0> (+13) ⬆️
Impacted Files Coverage Δ Complexity Δ
...ream/binder/pubsub/PubSubMessageChannelBinder.java 72.22% <0%> (-9.03%) 5 <0> (ø)
...pringframework/cloud/gcp/core/util/MapBuilder.java 88.88% <0%> (-11.12%) 3% <0%> (ø)
...oud/gcp/data/datastore/core/DatastoreTemplate.java 91.98% <0%> (-0.15%) 102% <0%> (+13%)
...ta/datastore/core/DatastoreTransactionManager.java 74.24% <0%> (ø) 15% <0%> (ø) ⬇️
...-sample/src/main/java/com/example/UserMessage.java
...main/java/com/example/PubSubBinderApplication.java
...-sample/src/main/java/com/example/SinkExample.java
...ample/src/main/java/com/example/SourceExample.java

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c75505...3604135. Read the comment docs.

@elefeint elefeint changed the title [WIP] Pubsub stream binder via synchronous pull Pubsub stream binder via synchronous pull Feb 1, 2019
Copy link
Contributor

@artembilan artembilan left a 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 ");
Copy link
Contributor

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?

Copy link
Contributor Author

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.

artembilan
artembilan previously approved these changes Feb 4, 2019
Copy link
Contributor

@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.

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].
Copy link
Contributor

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?

Copy link
Contributor

@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.

Great!

@elefeint elefeint merged commit 6d8eda9 into master Feb 5, 2019
@elefeint elefeint deleted the pubsub-pull-stream-binder branch February 5, 2019 16:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants