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

feat(pubsublite): Message type and message routers #3077

Merged
merged 7 commits into from Oct 28, 2020
Merged

Conversation

@tmdiep
Copy link
Contributor

@tmdiep tmdiep commented Oct 23, 2020

Message is similar to pubsub.Message, with the following differences:

  • Attributes can have multiple values for the same key.
  • Pub/Sub Lite uses []byte for data, attribute values and ordering keys.

Message routers select a partition to route a published message to, based on whether it has an ordering key specified.

@tmdiep tmdiep requested a review from googleapis/yoshi-go-admins as a code owner Oct 23, 2020
@google-cla google-cla bot added the cla: yes label Oct 23, 2020
@tmdiep
Copy link
Contributor Author

@tmdiep tmdiep commented Oct 23, 2020

Any opinions on the use of []byte everywhere in the Message struct are welcome.

IMO, strings are much easier to work with. However, Lite uses bytestrings for everything. The Java client libraries for CPS and Lite also have different Message types, so perhaps this deviation is acceptable for Go too.

Copy link
Member

@codyoss codyoss left a comment

LGTM, but I'll defer to Alex

@tmdiep
Copy link
Contributor Author

@tmdiep tmdiep commented Oct 26, 2020

WANT_LGTM=@hongalex, @manuelmenzella-google

Do either of you have concerns about differing from pubsub.Message? It differs in the Java client libraries too, so I think it should be fine.

I prefer strings over []byte, but had some concerns about actual bytes being written to the message in another client library and looking strange converted to a string when read from the Go client lib.

@hongalex
Copy link
Member

@hongalex hongalex commented Oct 27, 2020

I agree strings are easier to work with, but yeah considering people can use pub/sub lite across languages, this should be standardized across client libraries. I say stick with []byte.

tmdiep added 2 commits Oct 27, 2020
@tmdiep tmdiep force-pushed the tmdiep:message branch from b1d9e5a to b182d35 Oct 27, 2020
tmdiep added 2 commits Oct 27, 2020
@tmdiep
Copy link
Contributor Author

@tmdiep tmdiep commented Oct 28, 2020

Thanks everyone, []bytes it is! Merging...

@tmdiep tmdiep merged commit 179fc55 into googleapis:master Oct 28, 2020
3 checks passed
3 checks passed
@google-cla
cla/google All necessary CLAs are signed
@conventional-commit-lint-gcf
conventionalcommits.org
Details
@kokoro-team
kokoro Kokoro CI build successful
Details
@tmdiep tmdiep deleted the tmdiep:message branch Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants