React and rSocket REQUEST_CHANNEL error with Spring Boot

1

We have a working demo between React and Spring Boot Data Geode using rSocket for fire & forget, request response and request stream but when we try and use request channel we get error:

org.springframework.messaging.MessageDeliveryException: Destination 'quotes' does not support REQUEST_CHANNEL. Supported interaction(s): [REQUEST_STREAM]

So far on web it looks like this ought to be possible from RSocket Git

It's a simple spring boot app with @Controller endpoints that run over rSocket like this:

@Controller
public class RSocketController {
    private static final Logger log = LogManager.getLogger(RSocketController.class);

    @Autowired
    PriceService priceService;

    @MessageMapping(value = "quotes")
    public Flux<Quote> getQuotes() {
        log.info("In getQuotes");

        return priceService.generatePrices();
    }  
}

The generatePrices returns a Flux of prices which works fine in request stream but we would prefer to use request channel for bi-directional comms.

Client versions

"rsocket-core": "0.0.19"
"rsocket-flowable": "0.0.14"
"rsocket-tcp-client": "0.0.19"
"rsocket-websocket-client": "0.0.19"

Client code

const transport = new RSocketWebSocketClient(transportOptions);
const rSocketClient = new RSocketClient({serializers, setup, transport});
​
rSocketClient.connect().subscribe({
    onComplete: socket => {
        console.log('Client connected to the RSocket Server');
​
        socket.requestChannel(Flowable.just({
            data: 'foyss',
            metadata: String.fromCharCode(6) + 'quotes'
        })).subscribe({
            onComplete: function() {
                console.log(`Channel received end of server stream`);
            },
            onError: function(err) {
                console.log("err", err);
            },
            onNext: payload => {
                console.log(payload);
            },                
            onSubscribe: function(subscription) {
                console.log("got subscription");
                subscription.request(0x7fffffff);
            },
            onError: error => {
                console.log(error);
            },
            onSubscribe: cancel => {
                console.log('onSubscribe cancel');
            }})
        },
        onError: error => {
            console.log(error);
        },
        onSubscribe: cancel => {
            // console.log(cancel);
            console.log('onSubscribe cancel');
        }
})
spring
spring-boot
spring-data-gemfire
rsocket
asked on Stack Overflow Feb 19, 2020 by rupweb • edited Feb 25, 2020 by rupweb

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0