Route is able to listen on the from queue correctly.  

I tried keeping exception listener, however it is not listening the
exception. Below is the configuration.

package com.aaa.bbb.ccc;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;

public class JMSExceptionListener implements ExceptionListener {
    public JMSExceptionListener() {
        super();
        System.out.println("started exception listener");
    }

    @Override
    public void onException(JMSException ex) {
        System.out.println("EXCEPTION CAUGHT:::" + ex.getMessage());
    }
}
 <bean id="jmsExceptionListener"
class="com.aaa.bbb.ccc.JMSExceptionListener" />

 <bean id="jmsDestResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver"
/>

 <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate" />

 <bean id="mqConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="jndiName" value="java:comp/env/jms/xyz/xyzQCF" />
    <property name="resourceRef" value="true" />
  </bean>

 <bean id="jmsTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
    <property name="connectionFactory" ref="mqConnectionFactory" />
  </bean>
 
 <bean id="mqConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="mqConnectionFactory" />
    <property name="transactionManager" ref="jmsTransactionManager" />
    <property name="transacted" value="true" />
    <property name="destinationResolver" ref="jmsDestResolver" />
        <property name="exceptionListener" ref="jmsExceptionListener" />
  </bean>

 <bean id="mqjms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="configuration" ref="mqConfig" />
  </bean>

I could see the initialization of exception listener, but it is not getting
invoked on the exception.

Is this missing something?

Thanks
Praveen




--
View this message in context: 
http://camel.465427.n5.nabble.com/org-springframework-jms-InvalidDestinationException-while-trying-to-place-a-message-on-queue-tp5730697p5730796.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to