I am not sure why I am getting the exception
Caused by: org.springframework.messaging.core.DestinationResolutionException: no output-channel or replyChannel header available
Its just a simple IntegrationFlow but not sure what am I missing here in the code below.
@Bean
Exchange messageExchange() {
return ExchangeBuilder
.directExchange("attr")
.durable(true)
.build();
}
@Bean
Queue queue() {
return QueueBuilder
.durable("attr_queue")
.build();
}
@Bean
Binding binding() {
return BindingBuilder
.bind(queue())
.to(messageExchange())
.with("attr_queue")
.noargs();
}
@Bean
IntegrationFlow deltaFlow(ConnectionFactory connectionFactory) {
return IntegrationFlows.from(Amqp
.inboundAdapter(connectionFactory, queue()))
.handle(String.class, (payload, headers) -> {
if (payload.isEmpty()) {
log.info("Payload empty");
} else {
log.info("Payload : " + payload);
}
return payload;
})
.get();
}
I was trying to get my hands on Spring Integration and was not sure why I am getting this exception. All I'm trying to do is to read from a queue using an inboundAdapter
and just log it to the console. The code runs fine, but when I publish a message to the queue, I get this exception. Do I have to specify a replyChannel
or output-channel
always when using Amqp
adapters?