我想使用spring-messaging v.4.2控制Spring应用程序中的stomp订阅。 这是我的stomp的Spring应用程序配置:
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "com.myapp")
@EnableWebSocketMessageBroker
@EnableAsync
@EnableScheduling
public class Config extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/queue", "/topic");
config.setApplicationDestinationPrefixes("/app");
config.setUserDestinationPrefix("/user");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/pv").setAllowedOrigins("*");
}
@Bean
public Executor taskExecutor() {
return new SimpleAsyncTaskExecutor();
}
@Bean
public MultipartResolver multipartResolver(){
return new CommonsMultipartResolver();
}
}
如何使用path和stompId作为参数编写为每个订阅调用的方法? 感谢