177.20. 대상에 JMS 공급자 옵션 설정
IBM의 WebSphere MQ와 같은 일부 JMS 공급자는 JMS 대상에 옵션을 설정해야 합니다. 예를 들어 targetClient 옵션을 지정해야 할 수 있습니다. targetClient 는 Camel URI 옵션이 아닌 WebSphere MQ 옵션이므로 다음과 같이 JMS 대상 이름에 이를 설정해야 합니다.
// ...
.setHeader("CamelJmsDestinationName", constant("queue:///MY_QUEUE?targetClient=1"))
.to("wmq:queue:MY_QUEUE?useMessageIDAsCorrelationID=true");
// ...
.setHeader("CamelJmsDestinationName", constant("queue:///MY_QUEUE?targetClient=1"))
.to("wmq:queue:MY_QUEUE?useMessageIDAsCorrelationID=true");
일부 WMQ 버전은 대상 이름에 이 옵션을 허용하지 않으며 다음과 같은 예외를 얻을 수 있습니다.
com.ibm.msg.client.jms.DetailedJMSException: JMSCC0005: The specified value 'MY_QUEUE?targetClient=1' is not allowed for 'XMSC_DESTINATION_NAME'
com.ibm.msg.client.jms.DetailedJMSException: JMSCC0005: The specified
value 'MY_QUEUE?targetClient=1' is not allowed for
'XMSC_DESTINATION_NAME'
해결방법은 사용자 지정 DestinationResolver를 사용하는 것입니다.