Search in sources :

Example 1 with HessianEncoder

use of com.alibaba.spring.boot.rsocket.hessian.HessianEncoder in project alibaba-broker-example-parent by linux-china.

the class ServiceConsumeConfiguration method rsocketRequester.

@Bean
public RSocketRequester rsocketRequester(UpstreamManager upstreamManager) {
    LoadBalancedRSocket loadBalancedRSocket = upstreamManager.findBroker().getLoadBalancedRSocket();
    RSocketStrategies rSocketStrategies = RSocketStrategies.builder().encoder(new HessianEncoder()).decoder(new HessianDecoder()).build();
    return RSocketRequester.wrap(loadBalancedRSocket, MimeType.valueOf("application/x-hessian"), MimeType.valueOf("message/x.rsocket.composite-metadata.v0"), rSocketStrategies);
}
Also used : HessianEncoder(com.alibaba.spring.boot.rsocket.hessian.HessianEncoder) HessianDecoder(com.alibaba.spring.boot.rsocket.hessian.HessianDecoder) RSocketStrategies(org.springframework.messaging.rsocket.RSocketStrategies) LoadBalancedRSocket(com.alibaba.rsocket.loadbalance.LoadBalancedRSocket) Bean(org.springframework.context.annotation.Bean)

Example 2 with HessianEncoder

use of com.alibaba.spring.boot.rsocket.hessian.HessianEncoder in project alibaba-broker-kotlin-example by alibaba-rsocket-broker.

the class ServiceConsumeConfiguration method rsocketRequester.

@Bean
public RSocketRequester rsocketRequester(UpstreamManager upstreamManager) {
    LoadBalancedRSocket loadBalancedRSocket = upstreamManager.findBroker().getLoadBalancedRSocket();
    RSocketStrategies rSocketStrategies = RSocketStrategies.builder().encoder(new HessianEncoder()).decoder(new HessianDecoder()).build();
    return RSocketRequester.wrap(loadBalancedRSocket, MimeType.valueOf("application/x-hessian"), MimeType.valueOf("message/x.rsocket.composite-metadata.v0"), rSocketStrategies);
}
Also used : HessianEncoder(com.alibaba.spring.boot.rsocket.hessian.HessianEncoder) HessianDecoder(com.alibaba.spring.boot.rsocket.hessian.HessianDecoder) RSocketStrategies(org.springframework.messaging.rsocket.RSocketStrategies) LoadBalancedRSocket(com.alibaba.rsocket.loadbalance.LoadBalancedRSocket) Bean(org.springframework.context.annotation.Bean)

Example 3 with HessianEncoder

use of com.alibaba.spring.boot.rsocket.hessian.HessianEncoder in project alibaba-rsocket-broker by alibaba.

the class ServiceConsumeConfiguration method rsocketRequester.

@Bean
public RSocketRequester rsocketRequester(UpstreamManager upstreamManager) {
    LoadBalancedRSocket loadBalancedRSocket = upstreamManager.findBroker().getLoadBalancedRSocket();
    RSocketStrategies rSocketStrategies = RSocketStrategies.builder().encoder(new HessianEncoder()).decoder(new HessianDecoder()).build();
    return RSocketRequester.wrap(loadBalancedRSocket, MimeType.valueOf("application/x-hessian"), MimeType.valueOf("message/x.rsocket.composite-metadata.v0"), rSocketStrategies);
}
Also used : HessianEncoder(com.alibaba.spring.boot.rsocket.hessian.HessianEncoder) HessianDecoder(com.alibaba.spring.boot.rsocket.hessian.HessianDecoder) RSocketStrategies(org.springframework.messaging.rsocket.RSocketStrategies) LoadBalancedRSocket(com.alibaba.rsocket.loadbalance.LoadBalancedRSocket) Bean(org.springframework.context.annotation.Bean)

Aggregations

LoadBalancedRSocket (com.alibaba.rsocket.loadbalance.LoadBalancedRSocket)3 HessianDecoder (com.alibaba.spring.boot.rsocket.hessian.HessianDecoder)3 HessianEncoder (com.alibaba.spring.boot.rsocket.hessian.HessianEncoder)3 Bean (org.springframework.context.annotation.Bean)3 RSocketStrategies (org.springframework.messaging.rsocket.RSocketStrategies)3