Я использую соединение Apache-Camel с IBM MQ.если соединение с очередью не установлено в журнале, я получаю
[INFO ] 2019-09-20 13:55:21.983 [Camel (camel-1) thread #6 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Successfully refreshed JMS Connection
[WARN ] 2019-09-20 13:55:27.178 [Camel (camel-1) thread #23 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Setup of JMS message listener invoker failed for destination 'QUEUE' - trying to recover. Cause: JMSWMQ2008: Failed to open MQ queue 'QUEUE'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
[INFO ] 2019-09-20 13:55:27.178 [Camel (camel-1) thread #23 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Successfully refreshed JMS Connection
[WARN ] 2019-09-20 13:55:32.286 [Camel (camel-1) thread #6 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Setup of JMS message listener invoker failed for destination 'QUEUE' - trying to recover. Cause: JMSWMQ2008: Failed to open MQ queue 'QUEUE'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
[INFO ] 2019-09-20 13:55:32.287 [Camel (camel-1) thread #6 - JmsConsumer[QUEUE]] DefaultJmsMessageListenerContainer - [, TID=, SID=, ] - Successfully refreshed JMS Connection
Я пытаюсь использовать
from(queue1).processor(exchange -> {"some code"}).to(queue2).
onException(Throwable.class).proccess(exchange -> {"some code"})
и
public class camelError implements ErrorHandler {
@Override
public void process(Exchange exchange) throws Exception {
}
}
это не работает
Как я могу перехватить и обработать исключение соединения com.ibm.mq.MQException и получить имя очереди?