spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.01k stars 40.65k forks source link

springboot rsocket 2.2.0.RELEASE bug #18703

Closed huangshayang closed 5 years ago

huangshayang commented 5 years ago
@Controller
public class ServerController {

    @MessageMapping(value = "market")
    public MarketResponse getMarket(Market market) {
        return new MarketResponse(market.getName());
    }
}
@RestController
public class ConsumerController {

    private final RSocketRequester rSocketRequester;

    public ConsumerController(RSocketRequester rSocketRequester) {
        this.rSocketRequester = rSocketRequester;
    }

    @GetMapping(path = "/market/{name}")
    public Publisher<MarketResponse> getMarket(@PathVariable String name) {
        return rSocketRequester.route("market").data(new Market(name)).retrieveMono(MarketResponse.class);
    }
}
java.lang.IllegalArgumentException: No decoder for com.example.rsocketclient.MarketResponse
    at org.springframework.messaging.rsocket.RSocketStrategies.decoder(RSocketStrategies.java:92) ~[spring-messaging-5.2.0.RELEASE.jar:5.2.0.RELEASE]
    Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
    |_ checkpoint ⇢ HTTP GET "/market/test" [ExceptionHandlingWebHandler]
huangshayang commented 5 years ago
@Data
public class MarketResponse {
    private String res;

    public MarketResponse(String res) {
        this.marketResponse("Hello" + res + Instant.now());
    }

    private MarketResponse marketResponse(String res) {
        this.res = res;
        return this;
    }
}
snicoll commented 5 years ago

@huangshayang I see you’ve also raised the same issue on the Spring Framework issue tracker. Please do not cross-post bug reports as it means two different team members can end up duplicating effort

kasra-haghpanah commented 2 years ago

I use the Spring rsocket 2.6.3 and the mongo gridfs for backend and the rsocket.js in browser .

At first The spring works properly in requestchannel mode , but after version 2.5 of the spring boot not works properly .

for uploading first media has been broken to many chunks . per chunk has 8kb size then i send per chunk by Flowable . the first chunk has been sent by the javascript and backend receive it , but the second chunk has not been received by the spring . this problem has been created after version 2.5 of the spring

bclozel commented 2 years ago

See https://github.com/spring-projects/spring-framework/issues/28462