我通过扩展MessageProducerSupport创建了MessageAdapter。我通过调用MessageProducerSupport.sendMessage
生成消息到输出通道。然后,我定义了IntegrationFlow以使用来自消息适配器的消息,并将其发送到通道。但是我没有在频道上收到任何消息。
这是我的配置
@Bean
public MyAdapter myAdapter() {
MyAdapter myAdapter = new MyAdapter();
myAdapter.setOutputChannel(new QueueChannel());
return myAdapter;
}
@Bean
public IntegrationFlow integrationFlow() {
return IntegrationFlows
.from(myAdapter())
.channel("myChannel")
.get();
}
和“ myChannel”的消息端点:
@MessageEndpoint
public class MyConsumer {
@ServiceActivator(inputChannel = "myChannel")
public void parseMessage(Message message) {
System.out.println(message.getPayload().toString());
}
}
我缺少配置的东西吗?
谢谢