Skip to content

Add method to apply Consumer<RequestSpec> in RSocketRequester #23513

@rwinch

Description

@rwinch

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.

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions