v2 brings a reworked SDK
Pre-releaseTarget initial release of 2.0.0 is about 2 weeks away (end of March, 2020). This is a preview release.
The main goal of the Go SDK v2 is to give more control to the integrators. This is very true for middleware, where you might want to have more control over the underlying transport lib and need less fancy features from this SDK. The second goal is to reduce the complexity of the SDK by not plumbing so many features through the client interface for overrides. This control should happen in your code if it is needed. So the client interface is geared towards event producers and consumers. The protocol layer is targeted towards the middleware writers.
There are many changes to Preview,
- New Send/Request interface in Client.
- A few client features have been dropped with an aim for reducing the complexity of the SDK by encouraging direct management of the underlying protocol and using a Protocol object that helps encode/decode Events
- New shape for building Event.
- Drop event.Data
- Add event.SetData(contentType, object), forcing a content type to be set.
- transport.Codec has been dropped in favor of Bindings and the ToEvent, WriteXX methods.
- New object called Protocol, used to do the 3rd party interactions to message conversions and back.
- Protocol ends up implementing transport.Sender, transport.Receiver, transport.Responder, and transport.Requester, as applicable.
- ... and many more changes that will be details in the final docs. Some of these are API breaking changes.
All the samples have been updated to use the new interfaces.
To be done:
- Final docs for new shapes.
- More samples to show integration at a more basic level. (like just json, or just Protocol)
- Rework client<->transport interactions.
- Reworking the transport.Transport interface. This is not yet final. It will be reworked.
- Add/confirm trace extension work is not lost in the migration.
- Re-Add Pub/Sub support. (needs to be reworked in the new bindings format)