- No changes yet.
-
Moved the
yarpc/internal/crossdock/
andyarpc/internal/examples
folders toyarpc/crossdock/
andyarpc/examples
respectively. -
Breaking: Relocated the
go.uber.org/yarpc/transport
package togo.uber.org/yarpc/api/transport
. In the process themiddleware
logic from transport has been moved togo.uber.org/yarpc/api/middleware
and the concrete implementation of the Registry has been moved fromtransport.MapRegistry
toyarpc.MapRegistry
. This did not move the concrete implementations of http/tchannel from theyarpc/transport/
directory. -
Breaking: Relocated the
go.uber.org/yarpc/peer
package togo.uber.org/yarpc/api/peer
. This does not include the concrete implementations still in the/yarpc/peer/
directory. -
Breaking: This version overhauls the code required for constructing inbounds and outbounds.
Inbounds and Outbounds now share an underlying Transport, of which there should be one for each transport protocol, so one HTTP Transport for all HTTP inbounds and outbounds, and a TChannel transport for all TChannel inbounds and outbounds.
Before:
ch, err := tchannelProper.NewChannel("example-service", nil) if err != nil { log.Fatalln(err) } yarpc.NewDispatcher(yarpc.Config{ Name: "example-service", yarpc.Inbounds{ http.NewInbound(":80"), tchannel.NewInbound(ch, tchannel.ListenAddr(":4040")), }, yarpc.Outbounds{ http.NewOutbound("http://example-service/rpc/v1"), tchannel.NewOutbound(ch, tchannel.HostPort("127.0.0.1:4040")), }, })
After:
httpTransport := http.NewTransport() tchannelTransport := tchannel.NewChannelTransport( tchannel.ServiceName("example-service"), tchannel.ListenAddr(":4040"), ) yarpc.NewDispatcher(yarpc.Config{ Name: "example-service", yarpc.Inbounds{ httpTransport.NewInbound(":80"), tchannelTransport.NewInbound(), }, yarpc.Outbounds{ httpTransport.NewSingleOutbound("http://example-service/rpc/v1"), tchannelTransport.NewSingleOutbound("127.0.0.1:4040"), }, })
The dispatcher now collects all of the unique transport instances from inbounds and outbounds and manages their lifecycle independently.
This version repurposed the name
NewOutbound
for outbounds with a peer chooser, whereasNewSingleOutbound
is a convenience for creating an outbound addressing a specific single peer. You may need to rename existing usage. The compiler will complain that strings are notpeer.Chooser
instances.This version introduces support for peer choosers, peer lists, and peer providers for HTTP outbounds. This is made possible by the above change that introduces a concrete instance of a Transport for each protocol, which deduplicates peer instances across all inbounds and outbounds, making connection sharing and load balancing possible, eventually for all transport protocols.
Note that we use
NewChannelTransport
, as opposed toNewTransport
. We reserve this name for a future minor release that will provide parity with HTTP for outbounds with peer choosers.The new ChannelTransport constructor can still use a shared TChannel Channel instance, if that is required.
ch, err := tchannelProper.NewChannel("example-service", nil) if err != nil { log.Fatalln(err) } tchannelTransport := tchannel.NewChannelTransport( tchannel.WithChannel(ch), tchannel.ServiceName("example-service"), tchannel.ListenAddr(":4040"), ) yarpc.NewDispatcher(yarpc.Config{ Name: "example-service", yarpc.Inbounds{ tchannelTransport.NewInbound(), }, })
-
Breaking: the
transport.Inbound
andtransport.Outbound
interfaces now implementStart()
without any arguments.The dispatcher no longer threads a dependencies object through the start method of every configured transport. The only existing dependency was an opentracing Tracer, which you can now thread through Transport constructor options instead.
Before:
yarpc.NewDispatcher(yarpc.Config{ yarpc.Inbounds{ http.NewInbound(...), }, yarpc.Outbounds{ "callee": http.NewOutbound(...) }, Tracer: opentracing.GlobalTracer(), })
Now:
tracer := opentracing.GlobalTracer() httpTransport := http.NewTransport( http.Tracer(tracer), ) tchannelTransport := tchannel.NewChannelTransport( tchannel.Tracer(tracer), ) yarpc.NewDispatcher(yarpc.Config{ Name: "example-service", yarpc.Inbounds{ httpTransport.NewInbound(":80"), tchannelTransport.NewInbound(), }, yarpc.Outbounds{ httpTransport.NewSingleOutbound("http://example-service/rpc/v1"), tchannelTransport.NewSingleOutbound("127.0.0.1:4040"), }, })
The
yarpc.Config
Tracer
property is still accepted, but unused and deprecated.The dispatcher no longer provides a
transport.ServiceDetail
as an argument toStart
on inbound transports. Thetransport.ServiceDetail
no longer exists. You no longer need to provide the service name to start an inbound, only a registry. Instead of passing the service detail to start, the dispatcher now callsinbound.SetRegistry(transport.Registry)
before callingStart()
.Custom transport protocols must change their interface accordingly to satisfy the
transport.Inbound
interface. Uses that construct inbounds manually must either callSetRegistry
or use theWithRegistry
chained configuration method before callingStart
without aServiceDetail
.Before:
inbound := tchannel.NewInbound(...) err := inbound.Start( transport.ServiceDetail{ Name: "service", Registry: registry, }, transport.NoDeps, )
Now:
transport := tchannel.NewTransport() inbound := transport.NewInbound() inbound.SetRegistry(registry) err := inbound.Start()
The
transport.Deps
struct andtransport.NoDeps
instance no longer exist. -
Breaking: TChannel inbound and outbound constructors now return pointers to Inbound and Outbound structs with private state satisfying the
transport.Inbound
andtransport.Outbound
interfaces. These were previously transport specific Inbound and Outbound interfaces. This eliminates unnecessary polymorphism in some cases. -
Introduced OpenTracing helpers for transport authors.
-
Created the
yarpc.Serialize
package for marshalling RPC messages at rest. Useful for transports that persist RPC messages. -
Tranports have access to
DispatchOnewayHandler
andDispatchUnaryHandler
. These should be called by alltransport.Inbounds
instead of directly calling handlers.
- Breaking Renamed
Agent
toTransport
. - Breaking Renamed
hostport.Peer
'sAddSubscriber/RemoveSubscriber
toSubscribe/Unsubscribe
. - Breaking Updated
Peer.StartRequest
to take adontNotify
peer.Subscriber
to exempt from updates. Also addedPeer.EndRequest
function to replace thefinish
callback fromPeer.StartRequest
. - Breaking Renamed
peer.List
topeer.Chooser
,peer.ChangeListener
topeer.List
andpeer.Chooser.ChoosePeer
topeer.Chooser.Choose
. - Reduced complexity of
single
peer.Chooser
to retain the passed in peer immediately. - Breaking Moved
/peer/list/single.go
to/peer/single/list.go
. - Breaking Moved
/peer/x/list/roundrobin.go
to/peer/x/roundrobin/list.go
. - HTTP Oneway requests will now process http status codes and returns appropriate errors.
- Breaking Update
roundrobin.New
function to stop accepting an initial peer list. Uselist.Update
to initialize the peers in the list instead. - Breaking: Rename
Channel
toClientConfig
for both the dispatcher method and the interface.mydispatcher.Channel("myservice")
becomesmydispatcher.ClientConfig("myservice")
. TheClientConfig
object can then used to build a new Client as before:NewMyThriftClient(mydispatcher.ClientConfig("myservice"))
. - A comment is added atop YAML files generated by the recorder to help understanding where they come from.
-
Breaking: Rename the
Interceptor
andFilter
types toUnaryInboundMiddleware
andUnaryOutboundMiddleware
respectively. -
Breaking:
yarpc.Config
now accepts middleware using theInboundMiddleware
andOutboundMiddleware
fields.Before:
yarpc.Config{Interceptor: myInterceptor, Filter: myFilter}
Now:
yarpc.Config{ InboundMiddleware: yarpc.InboundMiddleware{Unary: myInterceptor}, OutboundMiddleware: yarpc.OutboundMiddleware{Unary: myFilter}, }
-
Add support for Oneway middleware via the
OnewayInboundMiddleware
andOnewayOutboundMiddleware
interfaces.
- Breaking: A detail of inbound transports has changed.
Starting an inbound transport accepts a ServiceDetail, including
the service name and a Registry. The Registry now must
implement
Choose(context.Context, transport.Request) (HandlerSpec, error)
instead ofGetHandler(service, procedure string) (HandlerSpec, error)
. Note that in the prior release,Handler
becameHandleSpec
to accommodate oneway handlers. - Upgrade to ThriftRW 1.0.
- TChannel:
NewInbound
andNewOutbound
now accept any object satisfying theChannel
interface. This should work with existing*tchannel.Channel
objects without any changes. - Introduced
yarpc.Inbounds
to be used instead of[]transport.Inbound
when configuring a Dispatcher. - Add support for peer lists in HTTP outbounds.
This release requires regeneration of ThriftRW code.
-
Breaking: Procedure registration must now always be done directly against the
Dispatcher
. Encoding-specific functionsjson.Register
,raw.Register
, andthrift.Register
have been deprecated in favor of theDispatcher.Register
method. Existing code may be migrated by running the following commands on your go files.gofmt -w -r 'raw.Register(d, h) -> d.Register(h)' $file.go gofmt -w -r 'json.Register(d, h) -> d.Register(h)' $file.go gofmt -w -r 'thrift.Register(d, h) -> d.Register(h)' $file.go
-
Add
yarpc.InjectClients
to automatically instantiate and inject clients into structs that need them. -
Thrift: Add a
Protocol
option to change the Thrift protocol used by clients and servers. -
Breaking: Remove the ability to set Baggage Headers through yarpc, use opentracing baggage instead
-
Breaking: Transport options have been removed completely. Encoding values differently based on the transport is no longer supported.
-
Breaking: Thrift requests and responses are no longer enveloped by default. The
thrift.Enveloped
option may be used to turn enveloping on when instantiating Thrift clients or registering handlers. -
Breaking: Use of
golang.org/x/net/context
has been dropped in favor of the standard library'scontext
package. -
Add support for providing peer lists to dynamically choose downstream peers in HTTP Outbounds
-
Rename
Handler
interface toUnaryHandler
and separateOutbound
interface intoOutbound
andUnaryOutbound
. -
Add
OnewayHandler
andHandlerSpec
to support oneway handlers. Transport inbounds can choose which RPC types to accept -
The package
yarpctest.recorder
can be used to record/replay requests during testing. A command line flag (--recorder=replay|append|overwrite
) is used to control the mode during the execution of the test.
- Fix missing canonical import path to
go.uber.org/yarpc
.
- Breaking: Rename project to
go.uber.org/yarpc
. - Breaking: Switch to
go.uber.org/thriftrw ~0.3
fromgithub.com/thriftrw/thriftrw-go ~0.2
. - Update opentracing-go to
>= 1, < 2
.
- Loosen constraint on
opentracing-go
to>= 0.9, < 2
.
- Update thriftrw-go to
>= 0.2, < 0.3
. - Implemented a ThriftRW plugin. This should now be used instead of the
ThriftRW
--yarpc
flag. Check the documentation of the thrift package for instructions on how to use it. - Adds support for opentracing. Pass an opentracing instance as a
Tracer
property of the YARPC config struct and both TChannel and HTTP transports will submit spans and propagate baggage. - This also modifies the public interface for transport inbounds and outbounds, which must now accept a transport.Deps struct. The deps struct carries the tracer and may eventually carry other dependencies.
- Panics from user handlers are recovered. The panic is logged (stderr), and an unexpected error is returned to the client about it.
- Thrift clients can now make requests to multiplexed Apache Thrift servers
using the
thrift.Multiplexed
client option.
- Use
github.com/yarpc/yarpc-go
as the import path; revert use ofgo.uber.org/yarpc
vanity path. There is an issue in Glide0.11
which causes installing these packages to fail, and thriftrw~0.1
's yarpc template is still usinggithub.com/yarpc/yarpc-go
.
- Initial release.