-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
Currently to include a credential within RSocketRequester a user needs to pass in a value and MediaType. If there are multiple values, the user has double the work to do. If there is a rich type being provided, the RSocketStrategies likely needs to be customized as well. For example, providing a username/password might look something like this:
this.requester.route("secure.retrieve-mono")
.metadata(credentials.getUsername(), USERNAME)
.metadata(credentials.getPassword(), PASSWORD)
...It would be nice if a user could just do something like:
this.requester.route("secure.retrieve-mono")
// apply(Consumer<RequestSpec>)
.apply(credentials(credentials))
...Another point is that it appears that RSocket APIs typically integrate using a Flyweight pattern such that encoding has access to lower level APIs (i.e. ByteBuf metadata). However, RSocketRequester does not provide access to these APIs. This means that direct support for RSocket cannot be leveraged with RSocketRequester. It would be nice if this could be reused somehow.