com.alibaba.spring.boot.rsocket.broker.services.ServiceQueryController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alibaba-broker-spring-boot-starter Show documentation
Show all versions of alibaba-broker-spring-boot-starter Show documentation
Alibaba RSocket Broker Spring Boot Starter for extension
package com.alibaba.spring.boot.rsocket.broker.services;
import com.alibaba.rsocket.ServiceLocator;
import com.alibaba.rsocket.metadata.GSVRoutingMetadata;
import com.alibaba.rsocket.metadata.MessageMimeTypeMetadata;
import com.alibaba.rsocket.metadata.RSocketCompositeMetadata;
import com.alibaba.rsocket.metadata.RSocketMimeType;
import com.alibaba.rsocket.observability.RsocketErrorCode;
import com.alibaba.rsocket.rpc.ReactiveServiceDiscovery;
import com.alibaba.spring.boot.rsocket.broker.responder.RSocketBrokerHandlerRegistry;
import com.alibaba.spring.boot.rsocket.broker.responder.RSocketBrokerResponderHandler;
import com.alibaba.spring.boot.rsocket.broker.route.ServiceRoutingSelector;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.rsocket.Payload;
import io.rsocket.util.ByteBufPayload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
/**
* service query controller
*
* @author leijuan
*/
@RestController
@RequestMapping("/service")
public class ServiceQueryController {
private static MessageMimeTypeMetadata jsonMetaEncoding = new MessageMimeTypeMetadata(RSocketMimeType.Json);
@Autowired
private ServiceRoutingSelector routingSelector;
@Autowired
private RSocketBrokerHandlerRegistry brokerHandlerRegistry;
@GetMapping("/{serviceName}")
public Flux
© 2015 - 2025 Weber Informatics LLC | Privacy Policy