Skip to content

Fix RSocketRequester API for requests without payload #23649

@sdeleuze

Description

@sdeleuze

Current RSocketRequester makes it mandatory to use RequestSpec#data methods in order to reach ResponseSpec methods that allow to perform the exchange. This RequestSpec / ResponseSpec split seems unnecessary since all ResponseSpec methods can be invoked directly for request without payload, which seems to be a perfectly valid use case.

This leads to code like req.route("find.radar.{iata}", iata).data(Mono.empty()).retrieveMono(AirportLocation.class)), and the issue is even more impacting in Coroutines world since data() does not accept null.

After discussion with @bclozel, our proposal is to merge RequestSpec and ResponseSpec in order to avoid this issue. Another hint that they should probably be merged is that ResponseSpec methods have side effects on the request itself.

About the name, maybe we could just use RequestSpec, move ResponseSpec methods in it and remove ResponseSpec.

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: enhancementA general enhancement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions