I have created a MessageAdapter by extending MessageProducerSupport. I produce message to output channel by calling MessageProducerSupport.sendMessage
. Then I defined an IntegrationFlow to consume messages from the message adapter, and send it to a channel. But I don't receive any messages on the channel.
This is my configuration
@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();
}
and message endpoint for "myChannel":
@MessageEndpoint
public class MyConsumer {
@ServiceActivator(inputChannel = "myChannel")
public void parseMessage(Message message) {
System.out.println(message.getPayload().toString());
}
}
Is there something I am missing to configure?
Thank you