Yes, you are right, this is JMS issue and we need handle of calling thread and or Exception handling mechanish at the begining of the flow. This way we can handle exceptions and account for the messages.
If a downstream synchronous exception is thrown and an error channel is specified, we will put a Message on the error-channel, where the payload is a MessageHandlingException (containing the cause as well as the failed message).
If the endpoint is a gateway, the result of the error flow will be sent as a response. If the error flow itself fails, the JMS transaction will be rolled back.
We are also adding this functionality to other inbound endpoints, where it makes sense - ip endpoints, event:inbound-channel-adapter, etc.