Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

The Any type

When building event-driven systems, a common pattern is to define a top-level message that acts as an envelope for different event payloads. Since new event types may be added (or removed) at any point in time, using a union is simply not going to suffice. Furthermore, the following are from the standpoint of event consumers:

  • Consumers might ship with older .proto versions than the event producers do. It is quite possible for them to encounter an event payload that they don't really know how to decode.
  • Some consumers may only be interested in processing a subset of the events. In such a scenario, consumers should only decode the messages they care about and skip over all other messages.

To cater for such cases, we can use the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content