2

In the configuration below I have a message-driven-channel-adapter with a message-converter so the service-activator is invoked with the converted payload.

<int-jms:message-driven-channel-adapter id="myConsumerChannelAdapter" connection-factory="connectionFactory"
                                        destination="input_queue" channel="input_channel" error-channel="errorChannel"
                                        message-converter="messageConverter" header-mapper="jmsHeaderMapper" acknowledge="client" max-concurrent-consumers="10"/>

<int:service-activator input-channel="input_channel" output-channel="output_enricher_channel" ref="MyConsumer"/>

If an exception is thrown by MyConsumer it will be send to the errorChannel. So far it works as intended. But when the message converter throws an exception like MessageConversionException it is not send to the errorChannel. If I log exceptions caused by message-converter I get:

AbstractMessageListenerContainer.invokeErrorHandler(875) | Execution of JMS message listener failed, and no ErrorHandler has been set.

But how can I assign an ErrorHandler to my Channel Adapter or send those exceptions to my errorChannel?

Dewiop
  • 55
  • 1
  • 5

1 Answers1

0

This will be available in the upcoming 4.2 release.

https://jira.spring.io/browse/INT-3670

Commit here.

The stackoverflow question for which I raised the JIRA has a (sort-of) work-around, but it's a bit kludgy.

You can try 4.2.0.BUILD-SNAPSHOT for testing; there will be a milestone in the next few weeks, but the final release is not planned until towards the end of the summer.

Community
  • 1
  • 1
Gary Russell
  • 166,535
  • 14
  • 146
  • 179