Search in sources :

Example 6 with UpstreamClusterChangedEvent

use of com.alibaba.rsocket.upstream.UpstreamClusterChangedEvent in project alibaba-rsocket-broker by alibaba.

the class UpstreamForwardRSocket method handleUpstreamClusterChangedEvent.

public void handleUpstreamClusterChangedEvent(CloudEventImpl<?> cloudEvent) {
    UpstreamClusterChangedEvent clusterChangedEvent = CloudEventSupport.unwrapData(cloudEvent, UpstreamClusterChangedEvent.class);
    if (clusterChangedEvent != null) {
        upstreamBrokerCluster.setUris(clusterChangedEvent.getUris());
        log.info(RsocketErrorCode.message("RST-300202", "UpstreamBroker", String.join(",", clusterChangedEvent.getUris())));
    }
}
Also used : UpstreamClusterChangedEvent(com.alibaba.rsocket.upstream.UpstreamClusterChangedEvent)

Aggregations

UpstreamClusterChangedEvent (com.alibaba.rsocket.upstream.UpstreamClusterChangedEvent)6 URI (java.net.URI)3 PostMapping (org.springframework.web.bind.annotation.PostMapping)2 ServiceLocator (com.alibaba.rsocket.ServiceLocator)1 CloudEventImpl (com.alibaba.rsocket.cloudevents.CloudEventImpl)1 RSocketCloudEventBuilder (com.alibaba.rsocket.cloudevents.RSocketCloudEventBuilder)1 AppStatusEvent (com.alibaba.rsocket.events.AppStatusEvent)1 AppMetadata (com.alibaba.rsocket.metadata.AppMetadata)1 BearerTokenMetadata (com.alibaba.rsocket.metadata.BearerTokenMetadata)1 RSocketCompositeMetadata (com.alibaba.rsocket.metadata.RSocketCompositeMetadata)1 RSocketMimeType (com.alibaba.rsocket.metadata.RSocketMimeType)1 RsocketErrorCode (com.alibaba.rsocket.observability.RsocketErrorCode)1 RSocketFilterChain (com.alibaba.rsocket.route.RSocketFilterChain)1 LocalReactiveServiceCaller (com.alibaba.rsocket.rpc.LocalReactiveServiceCaller)1 ServiceInstancesChangedEvent (com.alibaba.rsocket.upstream.ServiceInstancesChangedEvent)1 MurmurHash3 (com.alibaba.rsocket.utils.MurmurHash3)1 BrokerAppContext (com.alibaba.spring.boot.rsocket.broker.BrokerAppContext)1 RSocketBroker (com.alibaba.spring.boot.rsocket.broker.cluster.RSocketBroker)1 RSocketBrokerManager (com.alibaba.spring.boot.rsocket.broker.cluster.RSocketBrokerManager)1 ServiceMeshInspector (com.alibaba.spring.boot.rsocket.broker.route.ServiceMeshInspector)1