com.github.linyuzai.connection.loadbalance.sse.reactive.ReactiveSseLoadBalanceEndpoint Maven / Gradle / Ivy
The newest version!
package com.github.linyuzai.connection.loadbalance.sse.reactive;
import com.github.linyuzai.connection.loadbalance.core.concept.Connection;
import com.github.linyuzai.connection.loadbalance.sse.concept.DefaultSseIdGenerator;
import com.github.linyuzai.connection.loadbalance.sse.concept.SseIdGenerator;
import com.github.linyuzai.connection.loadbalance.sse.concept.SseLoadBalanceConcept;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.springframework.http.codec.ServerSentEvent;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.FluxSink;
import java.util.Map;
@Getter
@Setter
@RestController
@RequestMapping("${concept.sse.load-balance.observable-endpoint:concept-sse-subscriber}")
@RequiredArgsConstructor
public class ReactiveSseLoadBalanceEndpoint {
private SseIdGenerator sseIdGenerator = new DefaultSseIdGenerator();
private SseFluxFactory sseFluxFactory = new DefaultSseFluxFactory();
private final SseLoadBalanceConcept concept;
private final String endpoint;
@GetMapping
public Flux> loadBalanceEndpoint(@RequestParam Map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy