- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下类(class):
@Configuration
public class SpringIntegrationTest {
@Bean
public SimpleWebServiceInboundGateway testInboundGateWay (){
SimpleWebServiceInboundGateway simpleWebServiceInboundGateway = new SimpleWebServiceInboundGateway();
simpleWebServiceInboundGateway.setRequestChannelName("testChannel");
simpleWebServiceInboundGateway.setReplyChannelName("testChannel2");
return simpleWebServiceInboundGateway;
}
@Bean
public MessageChannel testChannel() {
return new DirectChannel();
}
@Bean
public MessageChannel testChannel2() {
return new DirectChannel();
}
@ServiceActivator(inputChannel = "testChannel", outputChannel = "testChannel2")
public DOMSource foo(DOMSource request) {
System.out.println("asd");
return request;
}
@Bean
public EndpointMapping soapActionEndpointMapping(SimpleWebServiceInboundGateway testInboundGateWay ) {
UriEndpointMapping uriEndpointMapping = new UriEndpointMapping();
uriEndpointMapping.setUsePath(true);
uriEndpointMapping.setEndpointMap(createEndpointMapping(testInboundGateWay ));
return uriEndpointMapping;
}
private Map<String, Object> createEndpointMapping(SimpleWebServiceInboundGateway testInboundGateWay ) {
Map<String, Object> endpointMap = new HashMap<>();
endpointMap.put("/ws/test", testInboundGateWay );
return endpointMap;
}
}
即使服务激活器订阅了“testChannel”,我也会收到以下消息:
o.s.i.w.SimpleWebServiceInboundGateway - failure occurred in gateway sendAndReceive: Dispatcher has no subscribers for channel 'org.springframework.web.context.WebApplicationContext:/MyProject restful API.testChannel'.; nested exception is org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers
我做错了什么?
最佳答案
您需要将 @EnableIntegration
添加到您的配置类之一。
关于java - Spring 集成 : @ServiceActivator is not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38397185/
谁能告诉我这个错误? system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found. 我正在尝
当你添加 @ServiceActivator方法上的注释,该方法可以有不同的返回类型,这似乎对服务有不同的影响: @ServiceActivator(inputChannel = "..", outp
我已经实现了Spring(启动)集成,我有一个InboundChannelAdapter,这个方法通过RestTemplate发送Web请求,并将结果传递给Splitter、Filter,最后到一个S
我有以下类(class): @Configuration public class SpringIntegrationTest { @Bean public SimpleWebServ
我有一个用 @ServiceActivator("CH1") 注释的方法,其中“CH1”定义是: @Bean(name = "CH1") MessageChannel ch1() {
我有一个远程服务,当特定事件发生时,我调用该服务来加载产品的定价数据。加载后,产品定价就会被广播,以供其他消费者在其他地方进行处理。 调用代码并不关心响应 - 它是“即发即忘”,响应应用程序事件并触发
我有一个带有 ServiceActivator 方法的组件类: @Component("payloadService") public class PayloadService { @Tran
我想将 Kafka 与 Spring Boot 和 Avro 模式一起使用。 但我被困在“这三个听众之间有什么区别?”。 创建监听器有 3 种可能性: 使用 - @KafkaListener 注释
在使用@StreamListener 监听 kafka 主题后,在 RuntimeException、全局 erroChannel 或主题特定的 errorChannel (topic.group.e
我使用简单的代码来处理来自 Google PubSub 订阅的消息并将结果返回到主题中。但由于某种原因,添加到输入消息的所有 header 也会出现在输出消息 header 上。 有办法消除这种行为吗
我正在使用 spring-cloud-starter-stream-kafka 使用 spring cloud stream。我在 application.properties 中将我的 channe
我想用 Transactional 注释我的 ServiceActivator,如下所示: @ServiceActivator @Transactional(rollbackFor = Excepti
我有这些版本的遗留代码(Spring 版本:3.2.1.RELEASE 和 Spring Integration 版本 2.2.3.RELEASE)。我想将spring集成的所有xml配置迁移到jav
我想在 Java 8 默认接口(interface)方法上使用 @ServiceActivator 注释。此默认方法将根据业务规则委托(delegate)给此接口(interface)的另一个方法。
我在 TCP 网关上构建的 Spring Integration 应用程序运行良好。它接收到达 TCP 网关的请求消息,并将消息转发给 serviceActivator 以准备响应,并将响应发送给客户
我目前正在 integration-context.xml 文件中指定服务激活器和相关的发布订阅 channel 。像这样的东西(删节版): 现在我需要指定一个自定义执行程序类(用于 MDC
当使用 StructureMap 在 WebAPI 中实现 DI 时,我们使用了 中的 ServiceActivator Configuring Dependency Injection with A
我是一名优秀的程序员,十分优秀!