Как получить путь к конечной точке в ChannelInterceptor с помощью весенней загрузки? - PullRequest
0 голосов
/ 08 июля 2019

Я новичок в использовании stomp с пружинной загрузкой 2.1.2. У меня есть мультиконечная точка и я настрою ChannelInterceptor, чтобы получить некоторую информацию.

@Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {

        registry.addEndpoint("/endpoint1")
                .addInterceptors(new IpHandshakeInterceptor())
                .setAllowedOrigins(origin)
                .withSockJS();

        registry.addEndpoint("/endpoint2")
                .addInterceptors(new IpHandshakeInterceptor())
                .setAllowedOrigins(origin)
                .withSockJS();
        // other andpoint
    }

    @Override
    public void configureClientInboundChannel(ChannelRegistration registration) {
        registration.interceptors(myChannelInterceptor());
    }

Все конечные точки используют myChannelInterceptor (на самом деле, я хочу, чтобы конечная точка использовала свой собственный ChannelInterceptor), я хочу сделать что-то в ChannelInterceptor по пути к конечной точке.

@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
  if (endpoint.equals("endpoint1")) {
  } else if (endpoint.equals("endpoint2")) {
  }
}

Как я могу получить endpoint информацию в ChannelInterceptor?

...