You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "nishant.rupani" <ni...@morganstanley.com> on 2012/07/25 08:53:37 UTC

Not writing to Error queue

I am usign a router to consume messages from MQ. On exception, I want write
the incoming message to the error queue. However, it is not writing message
to error queue.

For testing, I called a method of a bean on exception and that worked fine.
but it is not publishing the message to error queue.

We are using camel 2.9.0



--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by James Carman <ja...@carmanconsulting.com>.
Are you using (perhaps JTA-based) transactions?  Is your transaction
rolling back?

On Mon, Jul 30, 2012 at 2:02 AM, nishant.rupani
<ni...@morganstanley.com> wrote:
> No, source MQ queue and error MQ queue are different.
>
> First I tried with single JMS "wmq" only. It didn't work so I thought of creating two - one for regular consumer and another for error queue. However, that didn't work either.
>
> Unfortunately due to restriction put here, I cannot send whole XML.
>
> Snippet of my context is -
>
>
> 1)     Using onException -
>
>             <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>
>                         <onException useOriginalMessage="true">
>                                     <exception>java.sql.SQLException</exception>
>                                     <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
>                                                 retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
>                                     <handled>
>                                                 <constant>true</constant>
>                                     </handled>
>                                     <bean ref="exceptionHandler" method="exceptionPrint" />
>                                     <to uri="wmq:${error.queue}" />
>                         </onException>
>
>                         <route id="main-router">
>                                     <from uri="wmq:${source.queue}" />
>                                     <camel:bean ref="xmlToBeanProcessor" />
>                                     <recipientList>
>                                                 <header>recipients</header>
>                                     </recipientList>
>
>                         </route>
>                         <route id="listHierarchy ">
>                                     <from uri="direct: listHierarchy " />
>                                     <camel:bean ref="ListHierarchyProcessor" method="processSequence" />
>                         </route>
>             </camel:camelContext>
>
> <!-- JMS Setup -->
>             <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>                         <property name="configuration">
>                                     <bean class="org.apache.camel.component.jms.JmsConfiguration">
>                                                 <property name="connectionFactory" ref="connectionFactory" />
>                                                 <property name="concurrentConsumers" value="5" />
>                                     </bean>
>                         </property>
>             </bean>
>
>             <bean id="connectionFactory" class="MQConnectionFactory">
>                         <property name="queueManagerName" value="${mq.queue.manager}" />
>                         <property name="throwOnInvalidMessageProperty" value="false" />
>             </bean>
>
>
> 2)     Using dead letter queue
> <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>
>                 <route id="main-router" errorHandlerRef="myDeadLetterErrorHandler">
>                                     <from uri="wmq:${source.queue}" />
>                                     <camel:bean ref="xmlToBeanProcessor" />
>                                     <recipientList>
>                                                 <header>recipients</header>
>                                     </recipientList>
>                         </route>
> <route id="listHierarchy ">
>                         <from uri="direct: listHierarchy " />
>                         <camel:bean ref="ListHierarchyProcessor" method="processSequence" />
> </route>
>
> </camel:camelContext>
>
>             <bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
>                         <property name="deadLetterUri" value="wmq:${error.queue}" />
>                         <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
>             </bean>
>
>             <bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
>                         <property name="maximumRedeliveries" value="1" />
>                         <property name="redeliveryDelay" value="1" />
>                         <property name="logHandled" value="true" />
>                         <property name="logExhausted" value="true" />
>                         <property name="logContinued" value="true" />
>                         <property name="logRetryAttempted" value="true" />
>                         <property name="logRetryStackTrace" value="true" />
>                         <property name="logStackTrace" value="true" />
>             </bean>
>
> <bean id="errorHandler" class="com.proj.testtoremove.ErrorHandler" />
>
> <!-- JMS Setup -->
>             <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>                         <property name="configuration">
>                                     <bean class="org.apache.camel.component.jms.JmsConfiguration">
>                                                 <property name="connectionFactory" ref="connectionFactory" />
>                                                 <property name="concurrentConsumers" value="5" />
>                                     </bean>
>                         </property>
>             </bean>
>
>             <bean id="connectionFactory" class="MQConnectionFactory">
>                         <property name="queueManagerName" value="${mq.queue.manager}" />
>                         <property name="throwOnInvalidMessageProperty" value="false" />
>             </bean>
>
>
> Regards,
> Nishant
>
>
> From: Christian Mueller [via Camel] [mailto:ml-node+s465427n5716562h9@n5.nabble.com]
> Sent: Friday, July 27, 2012 11:14 PM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> You use the same WebShere MQ queue manager for receiving the messages and
> writing the failed messages, correct?
>
> Could you please share the entire Spring XML configuration (including the
> JMS component configuration). I'm a bit confused because you use 'wmq' and
> 'wmqError' as schema name. Did you also configured two JMS components? If
> yes, why? If no, it cannot work...
>
> Best,
> Christian
>
> On Fri, Jul 27, 2012 at 10:10 AM, nishant.rupani <
> [hidden email]</user/SendEmail.jtp?type=node&node=5716562&i=0>> wrote:
>
>> Nope it doesn't. It just has print. I've removed it too but still same
>> issues.
>>
>> Regards,
>> Nishant
>>
>>
>> From: Christian Mueller [via Camel] [mailto:
>> [hidden email]</user/SendEmail.jtp?type=node&node=5716562&i=1>]
>> Sent: Friday, July 27, 2012 1:32 PM
>> To: Rupani, Nishant (ISGT)
>> Subject: Re: Not writing to Error queue
>>
>> May be the exceptionPrint method of exceptionHandler throws an exception?
>>
>> Christian
>>
>> On Fri, Jul 27, 2012 at 7:25 AM, nishant.rupani <
>> [hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=0>> wrote:
>>
>> > Hi,
>> >
>> > Yes, I've setup JMS. I checked the setup by putting "<to
>> > uri="wmqError:${error.queue}" />" directly into the router and it worked
>> > well.
>> >
>> > Few more things I noticed,
>> >
>> > -       if I call a method directly from main route that throws test
>> > exception then it gets written to error queue fine. But if any of the
>> > recipient throws exception then it is not getting written to error queue.
>> >
>> > -       It is not that onException is not being executed at all.
>> > exceptionPrint method of exceptionHandler is being called fine always.
>> >
>> > Regards,
>> > Nishant
>> >
>> > From: Willem.Jiang [via Camel] [mailto:
>> > [hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=1>]
>> > Sent: Friday, July 27, 2012 10:48 AM
>> > To: Rupani, Nishant (ISGT)
>> > Subject: Re: Not writing to Error queue
>> >
>> > Hi,
>> >
>> > Why are you using the scheme of wmqError?
>> > Did you setup up jms component with id of wmqError rightly?
>> >
>> >
>> > On 7/25/12 5:50 PM, nishant.rupani wrote:
>> >
>> > > I don't see any reference of retry or error queue write in logs. Method
>> > exceptionPrint is being called fine.
>> > >
>> > > Snippet of my context is -
>> > >
>> > > 1)
>> > >              <camel:camelContext id="mainroute" xmlns="
>> > http://camel.apache.org/schema/spring" trace="true">
>> > >
>> > >                          <onException useOriginalMessage="true">
>> > >
>> >  <exception>java.sql.SQLException</exception>
>> > >                                      <redeliveryPolicy
>> > logRetryAttempted="true" logRetryStackTrace="true"
>> maximumRedeliveries="3"
>> > >
>> >  retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
>> > >                                      <handled>
>> > >
>> >  <constant>true</constant>
>> > >                                      </handled>
>> > >                                      <bean ref="exceptionHandler"
>> > method="exceptionPrint" />
>> > >                                      <to uri="wmqError:${error.queue}"
>> />
>> > >                          </onException>
>> > >
>> > >                          <route id="main-router">
>> > >                                      <from uri="wmq:${source.queue}" />
>> > >                                      <camel:bean
>> > ref="xmlToBeanProcessor" />
>> > >                                      <recipientList>
>> > >
>> >  <header>recipients</header>
>> > >                                      </recipientList>
>> > >
>> > >                          </route>
>> > >              </camel:camelContext>
>> > >
>> > > 2)
>> > > <camel:camelContext id="mainroute" xmlns="
>> > http://camel.apache.org/schema/spring" trace="true">
>> > >
>> > >                          <route id="main-router"
>> > errorHandlerRef="myDeadLetterErrorHandler">
>> > >                                      <from uri="wmq:${source.queue}" />
>> > >                                      <camel:bean
>> > ref="xmlToBeanProcessor" />
>> > >                                      <recipientList>
>> > >
>> >  <header>recipients</header>
>> > >                                      </recipientList>
>> > >                          </route>
>> > >
>> > >              <bean id="myDeadLetterErrorHandler"
>> > class="org.apache.camel.builder.DeadLetterChannelBuilder">
>> > >                          <property name="deadLetterUri"
>> > value="wmq:${error.queue}" />
>> > >                          <property name="redeliveryPolicy"
>> > ref="myRedeliveryPolicyConfig" />
>> > >              </bean>
>> > >
>> > >              <bean id="myRedeliveryPolicyConfig"
>> > class="org.apache.camel.processor.RedeliveryPolicy">
>> > >                          <property name="maximumRedeliveries" value="1"
>> > />
>> > >                          <property name="redeliveryDelay" value="1" />
>> > >                          <property name="logHandled" value="true" />
>> > >                          <property name="logExhausted" value="true" />
>> > >                          <property name="logContinued" value="true" />
>> > >                          <property name="logRetryAttempted"
>> value="true"
>> > />
>> > >                          <property name="logRetryStackTrace"
>> > value="true" />
>> > >                          <property name="logStackTrace" value="true" />
>> > >              </bean>
>> > >              .
>> > >              .
>> > >              .
>> > > </camel:camelContext>
>> > >
>> > > From: iocanel [via Camel] [mailto:[hidden
>> > email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
>> > > Sent: Wednesday, July 25, 2012 2:46 PM
>> > > To: Rupani, Nishant (ISGT)
>> > > Subject: Re: Not writing to Error queue
>> > >
>> > > Can you please share your full camel context?
>> > > Also do you see anything in the logs?
>> > > --
>> > > *Ioannis Canellos*
>> > > *
>> > > FuseSource <http://fusesource.com>
>> > >
>> > > **
>> > > Blog: http://iocanel.blogspot.com
>> > > **
>> > > Twitter: iocanel
>> > > *
>> > > Ioannis Canellos http://iocanel.blogspot.com
>> > >
>> > > ________________________________
>> > > If you reply to this email, your message will be added to the
>> discussion
>> > below:
>> > >
>> > > NAML<
>> >
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> > >
>> > >
>> > >
>> >
>> --------------------------------------------------------------------------
>> > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
>> > opinions or views contained herein are not intended to be, and do not
>> > constitute, advice within the meaning of Section 975 of the Dodd-Frank
>> Wall
>> > Street Reform and Consumer Protection Act. If you have received this
>> > communication in error, please destroy all electronic and paper copies
>> and
>> > notify the sender immediately. Mistransmission is not intended to waive
>> > confidentiality or privilege. Morgan Stanley reserves the right, to the
>> > extent permitted under applicable law, to monitor electronic
>> > communications. This message is subject to terms available at the
>> following
>> > link: http://www.morganstanley.com/disclaimers. If you cannot access
>> > these links, please notify us by reply message and we will send the
>> > contents to you. By messaging with Morgan Stanley you consent to the
>> > foregoing.
>> > >
>> > >
>> > >
>> > >
>> > > --
>> > > View this message in context:
>> >
>> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>> > >
>> >
>> >
>> > --
>> > Willem
>> > ----------------------------------
>> > FuseSource
>> > Web: http://www.fusesource.com
>> > Blog:    http://willemjiang.blogspot.com (English)
>> >           http://jnn.javaeye.com (Chinese)
>> > Twitter: willemjiang
>> > Weibo: willemjiang
>> >
>> > ________________________________
>> > If you reply to this email, your message will be added to the discussion
>> > below:
>> >
>> >
>> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716539.html
>> > To unsubscribe from Not writing to Error queue, click here<
>> > >.
>> > NAML<
>> >
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> > >
>> >
>> >
>> --------------------------------------------------------------------------
>> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
>> > opinions or views contained herein are not intended to be, and do not
>> > constitute, advice within the meaning of Section 975 of the Dodd-Frank
>> Wall
>> > Street Reform and Consumer Protection Act. If you have received this
>> > communication in error, please destroy all electronic and paper copies
>> and
>> > notify the sender immediately. Mistransmission is not intended to waive
>> > confidentiality or privilege. Morgan Stanley reserves the right, to the
>> > extent permitted under applicable law, to monitor electronic
>> > communications. This message is subject to terms available at the
>> following
>> > link: http://www.morganstanley.com/disclaimers. If you cannot access
>> > these links, please notify us by reply message and we will send the
>> > contents to you. By messaging with Morgan Stanley you consent to the
>> > foregoing.
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716543.html
>> To unsubscribe from Not writing to Error queue, click here<
>> >.
>> NAML<
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>>
>> --------------------------------------------------------------------------
>> NOTICE: Morgan Stanley is not acting as a municipal advisor and the
>> opinions or views contained herein are not intended to be, and do not
>> constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall
>> Street Reform and Consumer Protection Act. If you have received this
>> communication in error, please destroy all electronic and paper copies and
>> notify the sender immediately. Mistransmission is not intended to waive
>> confidentiality or privilege. Morgan Stanley reserves the right, to the
>> extent permitted under applicable law, to monitor electronic
>> communications. This message is subject to terms available at the following
>> link: http://www.morganstanley.com/disclaimers. If you cannot access
>> these links, please notify us by reply message and we will send the
>> contents to you. By messaging with Morgan Stanley you consent to the
>> foregoing.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716544.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716562.html
> To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716599.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
No, source MQ queue and error MQ queue are different.

First I tried with single JMS "wmq" only. It didn't work so I thought of creating two - one for regular consumer and another for error queue. However, that didn't work either.

Unfortunately due to restriction put here, I cannot send whole XML.

Snippet of my context is -


1)     Using onException -

            <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">

                        <onException useOriginalMessage="true">
                                    <exception>java.sql.SQLException</exception>
                                    <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
                                                retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
                                    <handled>
                                                <constant>true</constant>
                                    </handled>
                                    <bean ref="exceptionHandler" method="exceptionPrint" />
                                    <to uri="wmq:${error.queue}" />
                        </onException>

                        <route id="main-router">
                                    <from uri="wmq:${source.queue}" />
                                    <camel:bean ref="xmlToBeanProcessor" />
                                    <recipientList>
                                                <header>recipients</header>
                                    </recipientList>

                        </route>
                        <route id="listHierarchy ">
                                    <from uri="direct: listHierarchy " />
                                    <camel:bean ref="ListHierarchyProcessor" method="processSequence" />
                        </route>
            </camel:camelContext>

<!-- JMS Setup -->
            <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
                        <property name="configuration">
                                    <bean class="org.apache.camel.component.jms.JmsConfiguration">
                                                <property name="connectionFactory" ref="connectionFactory" />
                                                <property name="concurrentConsumers" value="5" />
                                    </bean>
                        </property>
            </bean>

            <bean id="connectionFactory" class="MQConnectionFactory">
                        <property name="queueManagerName" value="${mq.queue.manager}" />
                        <property name="throwOnInvalidMessageProperty" value="false" />
            </bean>


2)     Using dead letter queue
<camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">

                <route id="main-router" errorHandlerRef="myDeadLetterErrorHandler">
                                    <from uri="wmq:${source.queue}" />
                                    <camel:bean ref="xmlToBeanProcessor" />
                                    <recipientList>
                                                <header>recipients</header>
                                    </recipientList>
                        </route>
<route id="listHierarchy ">
                        <from uri="direct: listHierarchy " />
                        <camel:bean ref="ListHierarchyProcessor" method="processSequence" />
</route>

</camel:camelContext>

            <bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
                        <property name="deadLetterUri" value="wmq:${error.queue}" />
                        <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
            </bean>

            <bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
                        <property name="maximumRedeliveries" value="1" />
                        <property name="redeliveryDelay" value="1" />
                        <property name="logHandled" value="true" />
                        <property name="logExhausted" value="true" />
                        <property name="logContinued" value="true" />
                        <property name="logRetryAttempted" value="true" />
                        <property name="logRetryStackTrace" value="true" />
                        <property name="logStackTrace" value="true" />
            </bean>

<bean id="errorHandler" class="com.proj.testtoremove.ErrorHandler" />

<!-- JMS Setup -->
            <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
                        <property name="configuration">
                                    <bean class="org.apache.camel.component.jms.JmsConfiguration">
                                                <property name="connectionFactory" ref="connectionFactory" />
                                                <property name="concurrentConsumers" value="5" />
                                    </bean>
                        </property>
            </bean>

            <bean id="connectionFactory" class="MQConnectionFactory">
                        <property name="queueManagerName" value="${mq.queue.manager}" />
                        <property name="throwOnInvalidMessageProperty" value="false" />
            </bean>


Regards,
Nishant


From: Christian Mueller [via Camel] [mailto:ml-node+s465427n5716562h9@n5.nabble.com]
Sent: Friday, July 27, 2012 11:14 PM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

You use the same WebShere MQ queue manager for receiving the messages and
writing the failed messages, correct?

Could you please share the entire Spring XML configuration (including the
JMS component configuration). I'm a bit confused because you use 'wmq' and
'wmqError' as schema name. Did you also configured two JMS components? If
yes, why? If no, it cannot work...

Best,
Christian

On Fri, Jul 27, 2012 at 10:10 AM, nishant.rupani <
[hidden email]</user/SendEmail.jtp?type=node&node=5716562&i=0>> wrote:

> Nope it doesn't. It just has print. I've removed it too but still same
> issues.
>
> Regards,
> Nishant
>
>
> From: Christian Mueller [via Camel] [mailto:
> [hidden email]</user/SendEmail.jtp?type=node&node=5716562&i=1>]
> Sent: Friday, July 27, 2012 1:32 PM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> May be the exceptionPrint method of exceptionHandler throws an exception?
>
> Christian
>
> On Fri, Jul 27, 2012 at 7:25 AM, nishant.rupani <
> [hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=0>> wrote:
>
> > Hi,
> >
> > Yes, I've setup JMS. I checked the setup by putting "<to
> > uri="wmqError:${error.queue}" />" directly into the router and it worked
> > well.
> >
> > Few more things I noticed,
> >
> > -       if I call a method directly from main route that throws test
> > exception then it gets written to error queue fine. But if any of the
> > recipient throws exception then it is not getting written to error queue.
> >
> > -       It is not that onException is not being executed at all.
> > exceptionPrint method of exceptionHandler is being called fine always.
> >
> > Regards,
> > Nishant
> >
> > From: Willem.Jiang [via Camel] [mailto:
> > [hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=1>]
> > Sent: Friday, July 27, 2012 10:48 AM
> > To: Rupani, Nishant (ISGT)
> > Subject: Re: Not writing to Error queue
> >
> > Hi,
> >
> > Why are you using the scheme of wmqError?
> > Did you setup up jms component with id of wmqError rightly?
> >
> >
> > On 7/25/12 5:50 PM, nishant.rupani wrote:
> >
> > > I don't see any reference of retry or error queue write in logs. Method
> > exceptionPrint is being called fine.
> > >
> > > Snippet of my context is -
> > >
> > > 1)
> > >              <camel:camelContext id="mainroute" xmlns="
> > http://camel.apache.org/schema/spring" trace="true">
> > >
> > >                          <onException useOriginalMessage="true">
> > >
> >  <exception>java.sql.SQLException</exception>
> > >                                      <redeliveryPolicy
> > logRetryAttempted="true" logRetryStackTrace="true"
> maximumRedeliveries="3"
> > >
> >  retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
> > >                                      <handled>
> > >
> >  <constant>true</constant>
> > >                                      </handled>
> > >                                      <bean ref="exceptionHandler"
> > method="exceptionPrint" />
> > >                                      <to uri="wmqError:${error.queue}"
> />
> > >                          </onException>
> > >
> > >                          <route id="main-router">
> > >                                      <from uri="wmq:${source.queue}" />
> > >                                      <camel:bean
> > ref="xmlToBeanProcessor" />
> > >                                      <recipientList>
> > >
> >  <header>recipients</header>
> > >                                      </recipientList>
> > >
> > >                          </route>
> > >              </camel:camelContext>
> > >
> > > 2)
> > > <camel:camelContext id="mainroute" xmlns="
> > http://camel.apache.org/schema/spring" trace="true">
> > >
> > >                          <route id="main-router"
> > errorHandlerRef="myDeadLetterErrorHandler">
> > >                                      <from uri="wmq:${source.queue}" />
> > >                                      <camel:bean
> > ref="xmlToBeanProcessor" />
> > >                                      <recipientList>
> > >
> >  <header>recipients</header>
> > >                                      </recipientList>
> > >                          </route>
> > >
> > >              <bean id="myDeadLetterErrorHandler"
> > class="org.apache.camel.builder.DeadLetterChannelBuilder">
> > >                          <property name="deadLetterUri"
> > value="wmq:${error.queue}" />
> > >                          <property name="redeliveryPolicy"
> > ref="myRedeliveryPolicyConfig" />
> > >              </bean>
> > >
> > >              <bean id="myRedeliveryPolicyConfig"
> > class="org.apache.camel.processor.RedeliveryPolicy">
> > >                          <property name="maximumRedeliveries" value="1"
> > />
> > >                          <property name="redeliveryDelay" value="1" />
> > >                          <property name="logHandled" value="true" />
> > >                          <property name="logExhausted" value="true" />
> > >                          <property name="logContinued" value="true" />
> > >                          <property name="logRetryAttempted"
> value="true"
> > />
> > >                          <property name="logRetryStackTrace"
> > value="true" />
> > >                          <property name="logStackTrace" value="true" />
> > >              </bean>
> > >              .
> > >              .
> > >              .
> > > </camel:camelContext>
> > >
> > > From: iocanel [via Camel] [mailto:[hidden
> > email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
> > > Sent: Wednesday, July 25, 2012 2:46 PM
> > > To: Rupani, Nishant (ISGT)
> > > Subject: Re: Not writing to Error queue
> > >
> > > Can you please share your full camel context?
> > > Also do you see anything in the logs?
> > > --
> > > *Ioannis Canellos*
> > > *
> > > FuseSource <http://fusesource.com>
> > >
> > > **
> > > Blog: http://iocanel.blogspot.com
> > > **
> > > Twitter: iocanel
> > > *
> > > Ioannis Canellos http://iocanel.blogspot.com
> > >
> > > ________________________________
> > > If you reply to this email, your message will be added to the
> discussion
> > below:
> > >
> > > NAML<
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> > >
> >
> --------------------------------------------------------------------------
> > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> > opinions or views contained herein are not intended to be, and do not
> > constitute, advice within the meaning of Section 975 of the Dodd-Frank
> Wall
> > Street Reform and Consumer Protection Act. If you have received this
> > communication in error, please destroy all electronic and paper copies
> and
> > notify the sender immediately. Mistransmission is not intended to waive
> > confidentiality or privilege. Morgan Stanley reserves the right, to the
> > extent permitted under applicable law, to monitor electronic
> > communications. This message is subject to terms available at the
> following
> > link: http://www.morganstanley.com/disclaimers. If you cannot access
> > these links, please notify us by reply message and we will send the
> > contents to you. By messaging with Morgan Stanley you consent to the
> > foregoing.
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> > --
> > Willem
> > ----------------------------------
> > FuseSource
> > Web: http://www.fusesource.com
> > Blog:    http://willemjiang.blogspot.com (English)
> >           http://jnn.javaeye.com (Chinese)
> > Twitter: willemjiang
> > Weibo: willemjiang
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716539.html
> > To unsubscribe from Not writing to Error queue, click here<
> > >.
> > NAML<
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> >
> >
> --------------------------------------------------------------------------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> > opinions or views contained herein are not intended to be, and do not
> > constitute, advice within the meaning of Section 975 of the Dodd-Frank
> Wall
> > Street Reform and Consumer Protection Act. If you have received this
> > communication in error, please destroy all electronic and paper copies
> and
> > notify the sender immediately. Mistransmission is not intended to waive
> > confidentiality or privilege. Morgan Stanley reserves the right, to the
> > extent permitted under applicable law, to monitor electronic
> > communications. This message is subject to terms available at the
> following
> > link: http://www.morganstanley.com/disclaimers. If you cannot access
> > these links, please notify us by reply message and we will send the
> > contents to you. By messaging with Morgan Stanley you consent to the
> > foregoing.
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716543.html
> To unsubscribe from Not writing to Error queue, click here<
> >.
> NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> opinions or views contained herein are not intended to be, and do not
> constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall
> Street Reform and Consumer Protection Act. If you have received this
> communication in error, please destroy all electronic and paper copies and
> notify the sender immediately. Mistransmission is not intended to waive
> confidentiality or privilege. Morgan Stanley reserves the right, to the
> extent permitted under applicable law, to monitor electronic
> communications. This message is subject to terms available at the following
> link: http://www.morganstanley.com/disclaimers. If you cannot access
> these links, please notify us by reply message and we will send the
> contents to you. By messaging with Morgan Stanley you consent to the
> foregoing.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716544.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716562.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716599.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by Christian Müller <ch...@gmail.com>.
You use the same WebShere MQ queue manager for receiving the messages and
writing the failed messages, correct?

Could you please share the entire Spring XML configuration (including the
JMS component configuration). I'm a bit confused because you use 'wmq' and
'wmqError' as schema name. Did you also configured two JMS components? If
yes, why? If no, it cannot work...

Best,
Christian

On Fri, Jul 27, 2012 at 10:10 AM, nishant.rupani <
nishant.rupani@morganstanley.com> wrote:

> Nope it doesn't. It just has print. I've removed it too but still same
> issues.
>
> Regards,
> Nishant
>
>
> From: Christian Mueller [via Camel] [mailto:
> ml-node+s465427n5716543h20@n5.nabble.com]
> Sent: Friday, July 27, 2012 1:32 PM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> May be the exceptionPrint method of exceptionHandler throws an exception?
>
> Christian
>
> On Fri, Jul 27, 2012 at 7:25 AM, nishant.rupani <
> [hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=0>> wrote:
>
> > Hi,
> >
> > Yes, I've setup JMS. I checked the setup by putting "<to
> > uri="wmqError:${error.queue}" />" directly into the router and it worked
> > well.
> >
> > Few more things I noticed,
> >
> > -       if I call a method directly from main route that throws test
> > exception then it gets written to error queue fine. But if any of the
> > recipient throws exception then it is not getting written to error queue.
> >
> > -       It is not that onException is not being executed at all.
> > exceptionPrint method of exceptionHandler is being called fine always.
> >
> > Regards,
> > Nishant
> >
> > From: Willem.Jiang [via Camel] [mailto:
> > [hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=1>]
> > Sent: Friday, July 27, 2012 10:48 AM
> > To: Rupani, Nishant (ISGT)
> > Subject: Re: Not writing to Error queue
> >
> > Hi,
> >
> > Why are you using the scheme of wmqError?
> > Did you setup up jms component with id of wmqError rightly?
> >
> >
> > On 7/25/12 5:50 PM, nishant.rupani wrote:
> >
> > > I don't see any reference of retry or error queue write in logs. Method
> > exceptionPrint is being called fine.
> > >
> > > Snippet of my context is -
> > >
> > > 1)
> > >              <camel:camelContext id="mainroute" xmlns="
> > http://camel.apache.org/schema/spring" trace="true">
> > >
> > >                          <onException useOriginalMessage="true">
> > >
> >  <exception>java.sql.SQLException</exception>
> > >                                      <redeliveryPolicy
> > logRetryAttempted="true" logRetryStackTrace="true"
> maximumRedeliveries="3"
> > >
> >  retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
> > >                                      <handled>
> > >
> >  <constant>true</constant>
> > >                                      </handled>
> > >                                      <bean ref="exceptionHandler"
> > method="exceptionPrint" />
> > >                                      <to uri="wmqError:${error.queue}"
> />
> > >                          </onException>
> > >
> > >                          <route id="main-router">
> > >                                      <from uri="wmq:${source.queue}" />
> > >                                      <camel:bean
> > ref="xmlToBeanProcessor" />
> > >                                      <recipientList>
> > >
> >  <header>recipients</header>
> > >                                      </recipientList>
> > >
> > >                          </route>
> > >              </camel:camelContext>
> > >
> > > 2)
> > > <camel:camelContext id="mainroute" xmlns="
> > http://camel.apache.org/schema/spring" trace="true">
> > >
> > >                          <route id="main-router"
> > errorHandlerRef="myDeadLetterErrorHandler">
> > >                                      <from uri="wmq:${source.queue}" />
> > >                                      <camel:bean
> > ref="xmlToBeanProcessor" />
> > >                                      <recipientList>
> > >
> >  <header>recipients</header>
> > >                                      </recipientList>
> > >                          </route>
> > >
> > >              <bean id="myDeadLetterErrorHandler"
> > class="org.apache.camel.builder.DeadLetterChannelBuilder">
> > >                          <property name="deadLetterUri"
> > value="wmq:${error.queue}" />
> > >                          <property name="redeliveryPolicy"
> > ref="myRedeliveryPolicyConfig" />
> > >              </bean>
> > >
> > >              <bean id="myRedeliveryPolicyConfig"
> > class="org.apache.camel.processor.RedeliveryPolicy">
> > >                          <property name="maximumRedeliveries" value="1"
> > />
> > >                          <property name="redeliveryDelay" value="1" />
> > >                          <property name="logHandled" value="true" />
> > >                          <property name="logExhausted" value="true" />
> > >                          <property name="logContinued" value="true" />
> > >                          <property name="logRetryAttempted"
> value="true"
> > />
> > >                          <property name="logRetryStackTrace"
> > value="true" />
> > >                          <property name="logStackTrace" value="true" />
> > >              </bean>
> > >              .
> > >              .
> > >              .
> > > </camel:camelContext>
> > >
> > > From: iocanel [via Camel] [mailto:[hidden
> > email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
> > > Sent: Wednesday, July 25, 2012 2:46 PM
> > > To: Rupani, Nishant (ISGT)
> > > Subject: Re: Not writing to Error queue
> > >
> > > Can you please share your full camel context?
> > > Also do you see anything in the logs?
> > > --
> > > *Ioannis Canellos*
> > > *
> > > FuseSource <http://fusesource.com>
> > >
> > > **
> > > Blog: http://iocanel.blogspot.com
> > > **
> > > Twitter: iocanel
> > > *
> > > Ioannis Canellos http://iocanel.blogspot.com
> > >
> > > ________________________________
> > > If you reply to this email, your message will be added to the
> discussion
> > below:
> > >
> > > NAML<
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> > >
> >
> --------------------------------------------------------------------------
> > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> > opinions or views contained herein are not intended to be, and do not
> > constitute, advice within the meaning of Section 975 of the Dodd-Frank
> Wall
> > Street Reform and Consumer Protection Act. If you have received this
> > communication in error, please destroy all electronic and paper copies
> and
> > notify the sender immediately. Mistransmission is not intended to waive
> > confidentiality or privilege. Morgan Stanley reserves the right, to the
> > extent permitted under applicable law, to monitor electronic
> > communications. This message is subject to terms available at the
> following
> > link: http://www.morganstanley.com/disclaimers. If you cannot access
> > these links, please notify us by reply message and we will send the
> > contents to you. By messaging with Morgan Stanley you consent to the
> > foregoing.
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> > --
> > Willem
> > ----------------------------------
> > FuseSource
> > Web: http://www.fusesource.com
> > Blog:    http://willemjiang.blogspot.com (English)
> >           http://jnn.javaeye.com (Chinese)
> > Twitter: willemjiang
> > Weibo: willemjiang
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716539.html
> > To unsubscribe from Not writing to Error queue, click here<
> > >.
> > NAML<
> >
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> >
> >
> --------------------------------------------------------------------------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> > opinions or views contained herein are not intended to be, and do not
> > constitute, advice within the meaning of Section 975 of the Dodd-Frank
> Wall
> > Street Reform and Consumer Protection Act. If you have received this
> > communication in error, please destroy all electronic and paper copies
> and
> > notify the sender immediately. Mistransmission is not intended to waive
> > confidentiality or privilege. Morgan Stanley reserves the right, to the
> > extent permitted under applicable law, to monitor electronic
> > communications. This message is subject to terms available at the
> following
> > link: http://www.morganstanley.com/disclaimers. If you cannot access
> > these links, please notify us by reply message and we will send the
> > contents to you. By messaging with Morgan Stanley you consent to the
> > foregoing.
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716543.html
> To unsubscribe from Not writing to Error queue, click here<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==
> >.
> NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> opinions or views contained herein are not intended to be, and do not
> constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall
> Street Reform and Consumer Protection Act. If you have received this
> communication in error, please destroy all electronic and paper copies and
> notify the sender immediately. Mistransmission is not intended to waive
> confidentiality or privilege. Morgan Stanley reserves the right, to the
> extent permitted under applicable law, to monitor electronic
> communications. This message is subject to terms available at the following
> link: http://www.morganstanley.com/disclaimers. If you cannot access
> these links, please notify us by reply message and we will send the
> contents to you. By messaging with Morgan Stanley you consent to the
> foregoing.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716544.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
Nope it doesn't. It just has print. I've removed it too but still same issues.

Regards,
Nishant


From: Christian Mueller [via Camel] [mailto:ml-node+s465427n5716543h20@n5.nabble.com]
Sent: Friday, July 27, 2012 1:32 PM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

May be the exceptionPrint method of exceptionHandler throws an exception?

Christian

On Fri, Jul 27, 2012 at 7:25 AM, nishant.rupani <
[hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=0>> wrote:

> Hi,
>
> Yes, I've setup JMS. I checked the setup by putting "<to
> uri="wmqError:${error.queue}" />" directly into the router and it worked
> well.
>
> Few more things I noticed,
>
> -       if I call a method directly from main route that throws test
> exception then it gets written to error queue fine. But if any of the
> recipient throws exception then it is not getting written to error queue.
>
> -       It is not that onException is not being executed at all.
> exceptionPrint method of exceptionHandler is being called fine always.
>
> Regards,
> Nishant
>
> From: Willem.Jiang [via Camel] [mailto:
> [hidden email]</user/SendEmail.jtp?type=node&node=5716543&i=1>]
> Sent: Friday, July 27, 2012 10:48 AM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> Hi,
>
> Why are you using the scheme of wmqError?
> Did you setup up jms component with id of wmqError rightly?
>
>
> On 7/25/12 5:50 PM, nishant.rupani wrote:
>
> > I don't see any reference of retry or error queue write in logs. Method
> exceptionPrint is being called fine.
> >
> > Snippet of my context is -
> >
> > 1)
> >              <camel:camelContext id="mainroute" xmlns="
> http://camel.apache.org/schema/spring" trace="true">
> >
> >                          <onException useOriginalMessage="true">
> >
>  <exception>java.sql.SQLException</exception>
> >                                      <redeliveryPolicy
> logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
> >
>  retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
> >                                      <handled>
> >
>  <constant>true</constant>
> >                                      </handled>
> >                                      <bean ref="exceptionHandler"
> method="exceptionPrint" />
> >                                      <to uri="wmqError:${error.queue}" />
> >                          </onException>
> >
> >                          <route id="main-router">
> >                                      <from uri="wmq:${source.queue}" />
> >                                      <camel:bean
> ref="xmlToBeanProcessor" />
> >                                      <recipientList>
> >
>  <header>recipients</header>
> >                                      </recipientList>
> >
> >                          </route>
> >              </camel:camelContext>
> >
> > 2)
> > <camel:camelContext id="mainroute" xmlns="
> http://camel.apache.org/schema/spring" trace="true">
> >
> >                          <route id="main-router"
> errorHandlerRef="myDeadLetterErrorHandler">
> >                                      <from uri="wmq:${source.queue}" />
> >                                      <camel:bean
> ref="xmlToBeanProcessor" />
> >                                      <recipientList>
> >
>  <header>recipients</header>
> >                                      </recipientList>
> >                          </route>
> >
> >              <bean id="myDeadLetterErrorHandler"
> class="org.apache.camel.builder.DeadLetterChannelBuilder">
> >                          <property name="deadLetterUri"
> value="wmq:${error.queue}" />
> >                          <property name="redeliveryPolicy"
> ref="myRedeliveryPolicyConfig" />
> >              </bean>
> >
> >              <bean id="myRedeliveryPolicyConfig"
> class="org.apache.camel.processor.RedeliveryPolicy">
> >                          <property name="maximumRedeliveries" value="1"
> />
> >                          <property name="redeliveryDelay" value="1" />
> >                          <property name="logHandled" value="true" />
> >                          <property name="logExhausted" value="true" />
> >                          <property name="logContinued" value="true" />
> >                          <property name="logRetryAttempted" value="true"
> />
> >                          <property name="logRetryStackTrace"
> value="true" />
> >                          <property name="logStackTrace" value="true" />
> >              </bean>
> >              .
> >              .
> >              .
> > </camel:camelContext>
> >
> > From: iocanel [via Camel] [mailto:[hidden
> email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
> > Sent: Wednesday, July 25, 2012 2:46 PM
> > To: Rupani, Nishant (ISGT)
> > Subject: Re: Not writing to Error queue
> >
> > Can you please share your full camel context?
> > Also do you see anything in the logs?
> > --
> > *Ioannis Canellos*
> > *
> > FuseSource <http://fusesource.com>
> >
> > **
> > Blog: http://iocanel.blogspot.com
> > **
> > Twitter: iocanel
> > *
> > Ioannis Canellos http://iocanel.blogspot.com
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion
> below:
> >
> > NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
> >
> --------------------------------------------------------------------------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> opinions or views contained herein are not intended to be, and do not
> constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall
> Street Reform and Consumer Protection Act. If you have received this
> communication in error, please destroy all electronic and paper copies and
> notify the sender immediately. Mistransmission is not intended to waive
> confidentiality or privilege. Morgan Stanley reserves the right, to the
> extent permitted under applicable law, to monitor electronic
> communications. This message is subject to terms available at the following
> link: http://www.morganstanley.com/disclaimers. If you cannot access
> these links, please notify us by reply message and we will send the
> contents to you. By messaging with Morgan Stanley you consent to the
> foregoing.
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>           http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716539.html
> To unsubscribe from Not writing to Error queue, click here<
> >.
> NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> opinions or views contained herein are not intended to be, and do not
> constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall
> Street Reform and Consumer Protection Act. If you have received this
> communication in error, please destroy all electronic and paper copies and
> notify the sender immediately. Mistransmission is not intended to waive
> confidentiality or privilege. Morgan Stanley reserves the right, to the
> extent permitted under applicable law, to monitor electronic
> communications. This message is subject to terms available at the following
> link: http://www.morganstanley.com/disclaimers. If you cannot access
> these links, please notify us by reply message and we will send the
> contents to you. By messaging with Morgan Stanley you consent to the
> foregoing.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716543.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716544.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by Christian Müller <ch...@gmail.com>.
May be the exceptionPrint method of exceptionHandler throws an exception?

Christian

On Fri, Jul 27, 2012 at 7:25 AM, nishant.rupani <
nishant.rupani@morganstanley.com> wrote:

> Hi,
>
> Yes, I've setup JMS. I checked the setup by putting "<to
> uri="wmqError:${error.queue}" />" directly into the router and it worked
> well.
>
> Few more things I noticed,
>
> -       if I call a method directly from main route that throws test
> exception then it gets written to error queue fine. But if any of the
> recipient throws exception then it is not getting written to error queue.
>
> -       It is not that onException is not being executed at all.
> exceptionPrint method of exceptionHandler is being called fine always.
>
> Regards,
> Nishant
>
> From: Willem.Jiang [via Camel] [mailto:
> ml-node+s465427n5716539h96@n5.nabble.com]
> Sent: Friday, July 27, 2012 10:48 AM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> Hi,
>
> Why are you using the scheme of wmqError?
> Did you setup up jms component with id of wmqError rightly?
>
>
> On 7/25/12 5:50 PM, nishant.rupani wrote:
>
> > I don't see any reference of retry or error queue write in logs. Method
> exceptionPrint is being called fine.
> >
> > Snippet of my context is -
> >
> > 1)
> >              <camel:camelContext id="mainroute" xmlns="
> http://camel.apache.org/schema/spring" trace="true">
> >
> >                          <onException useOriginalMessage="true">
> >
>  <exception>java.sql.SQLException</exception>
> >                                      <redeliveryPolicy
> logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
> >
>  retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
> >                                      <handled>
> >
>  <constant>true</constant>
> >                                      </handled>
> >                                      <bean ref="exceptionHandler"
> method="exceptionPrint" />
> >                                      <to uri="wmqError:${error.queue}" />
> >                          </onException>
> >
> >                          <route id="main-router">
> >                                      <from uri="wmq:${source.queue}" />
> >                                      <camel:bean
> ref="xmlToBeanProcessor" />
> >                                      <recipientList>
> >
>  <header>recipients</header>
> >                                      </recipientList>
> >
> >                          </route>
> >              </camel:camelContext>
> >
> > 2)
> > <camel:camelContext id="mainroute" xmlns="
> http://camel.apache.org/schema/spring" trace="true">
> >
> >                          <route id="main-router"
> errorHandlerRef="myDeadLetterErrorHandler">
> >                                      <from uri="wmq:${source.queue}" />
> >                                      <camel:bean
> ref="xmlToBeanProcessor" />
> >                                      <recipientList>
> >
>  <header>recipients</header>
> >                                      </recipientList>
> >                          </route>
> >
> >              <bean id="myDeadLetterErrorHandler"
> class="org.apache.camel.builder.DeadLetterChannelBuilder">
> >                          <property name="deadLetterUri"
> value="wmq:${error.queue}" />
> >                          <property name="redeliveryPolicy"
> ref="myRedeliveryPolicyConfig" />
> >              </bean>
> >
> >              <bean id="myRedeliveryPolicyConfig"
> class="org.apache.camel.processor.RedeliveryPolicy">
> >                          <property name="maximumRedeliveries" value="1"
> />
> >                          <property name="redeliveryDelay" value="1" />
> >                          <property name="logHandled" value="true" />
> >                          <property name="logExhausted" value="true" />
> >                          <property name="logContinued" value="true" />
> >                          <property name="logRetryAttempted" value="true"
> />
> >                          <property name="logRetryStackTrace"
> value="true" />
> >                          <property name="logStackTrace" value="true" />
> >              </bean>
> >              .
> >              .
> >              .
> > </camel:camelContext>
> >
> > From: iocanel [via Camel] [mailto:[hidden
> email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
> > Sent: Wednesday, July 25, 2012 2:46 PM
> > To: Rupani, Nishant (ISGT)
> > Subject: Re: Not writing to Error queue
> >
> > Can you please share your full camel context?
> > Also do you see anything in the logs?
> > --
> > *Ioannis Canellos*
> > *
> > FuseSource <http://fusesource.com>
> >
> > **
> > Blog: http://iocanel.blogspot.com
> > **
> > Twitter: iocanel
> > *
> > Ioannis Canellos http://iocanel.blogspot.com
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion
> below:
> >
> > NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
> >
> --------------------------------------------------------------------------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> opinions or views contained herein are not intended to be, and do not
> constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall
> Street Reform and Consumer Protection Act. If you have received this
> communication in error, please destroy all electronic and paper copies and
> notify the sender immediately. Mistransmission is not intended to waive
> confidentiality or privilege. Morgan Stanley reserves the right, to the
> extent permitted under applicable law, to monitor electronic
> communications. This message is subject to terms available at the following
> link: http://www.morganstanley.com/disclaimers. If you cannot access
> these links, please notify us by reply message and we will send the
> contents to you. By messaging with Morgan Stanley you consent to the
> foregoing.
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>           http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716539.html
> To unsubscribe from Not writing to Error queue, click here<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==
> >.
> NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the
> opinions or views contained herein are not intended to be, and do not
> constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall
> Street Reform and Consumer Protection Act. If you have received this
> communication in error, please destroy all electronic and paper copies and
> notify the sender immediately. Mistransmission is not intended to waive
> confidentiality or privilege. Morgan Stanley reserves the right, to the
> extent permitted under applicable law, to monitor electronic
> communications. This message is subject to terms available at the following
> link: http://www.morganstanley.com/disclaimers. If you cannot access
> these links, please notify us by reply message and we will send the
> contents to you. By messaging with Morgan Stanley you consent to the
> foregoing.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
Yes, onException is being called. As you see in the onException, exceptionPrint method is getting called fine. "<bean ref="exceptionHandler" method="exceptionPrint" />"

It is just not writing to the error queue.

Regards,
Nishant

From: Willem.Jiang [via Camel] [mailto:ml-node+s465427n5716571h88@n5.nabble.com]
Sent: Saturday, July 28, 2012 6:57 AM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

On 7/27/12 1:25 PM, nishant.rupani wrote:
> Hi,
>
> Yes, I've setup JMS. I checked the setup by putting "<to uri="wmqError:${error.queue}" />" directly into the router and it worked well.
>
> Few more things I noticed,
>
> -       if I call a method directly from main route that throws test exception then it gets written to error queue fine. But if any of the recipient throws exception then it is not getting written to error queue.
>

When the recipient throws exception, is your onException being executed?
If not, it could be easy for us to create a simple unit test to
reproduce the error.

> -       It is not that onException is not being executed at all. exceptionPrint method of exceptionHandler is being called fine always.
>
> Regards,
> Nishant
>
> From: Willem.Jiang [via Camel] [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=5716571&i=0>]
> Sent: Friday, July 27, 2012 10:48 AM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> Hi,
>
> Why are you using the scheme of wmqError?
> Did you setup up jms component with id of wmqError rightly?
>
>
> On 7/25/12 5:50 PM, nishant.rupani wrote:
>
>> I don't see any reference of retry or error queue write in logs. Method exceptionPrint is being called fine.
>>
>> Snippet of my context is -
>>
>> 1)
>>               <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>>
>>                           <onException useOriginalMessage="true">
>>                                       <exception>java.sql.SQLException</exception>
>>                                       <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
>>                                                   retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
>>                                       <handled>
>>                                                   <constant>true</constant>
>>                                       </handled>
>>                                       <bean ref="exceptionHandler" method="exceptionPrint" />
>>                                       <to uri="wmqError:${error.queue}" />
>>                           </onException>
>>
>>                           <route id="main-router">
>>                                       <from uri="wmq:${source.queue}" />
>>                                       <camel:bean ref="xmlToBeanProcessor" />
>>                                       <recipientList>
>>                                                   <header>recipients</header>
>>                                       </recipientList>
>>
>>                           </route>
>>               </camel:camelContext>
>>
>> 2)
>> <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>>
>>                           <route id="main-router" errorHandlerRef="myDeadLetterErrorHandler">
>>                                       <from uri="wmq:${source.queue}" />
>>                                       <camel:bean ref="xmlToBeanProcessor" />
>>                                       <recipientList>
>>                                                   <header>recipients</header>
>>                                       </recipientList>
>>                           </route>
>>
>>               <bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
>>                           <property name="deadLetterUri" value="wmq:${error.queue}" />
>>                           <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
>>               </bean>
>>
>>               <bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
>>                           <property name="maximumRedeliveries" value="1" />
>>                           <property name="redeliveryDelay" value="1" />
>>                           <property name="logHandled" value="true" />
>>                           <property name="logExhausted" value="true" />
>>                           <property name="logContinued" value="true" />
>>                           <property name="logRetryAttempted" value="true" />
>>                           <property name="logRetryStackTrace" value="true" />
>>                           <property name="logStackTrace" value="true" />
>>               </bean>
>>               .
>>               .
>>               .
>> </camel:camelContext>
>>
>> From: iocanel [via Camel] [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
>> Sent: Wednesday, July 25, 2012 2:46 PM
>> To: Rupani, Nishant (ISGT)
>> Subject: Re: Not writing to Error queue
>>
>> Can you please share your full camel context?
>> Also do you see anything in the logs?
>> --
>> *Ioannis Canellos*
>> *
>> FuseSource <http://fusesource.com>
>>
>> **
>> Blog: http://iocanel.blogspot.com
>> **
>> Twitter: iocanel
>> *
>> Ioannis Canellos http://iocanel.blogspot.com
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion below:
>>
>> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>> --------------------------------------------------------------------------
>> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>>
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>            http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
>
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716571.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716597.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by Willem Jiang <wi...@gmail.com>.
On 7/27/12 1:25 PM, nishant.rupani wrote:
> Hi,
>
> Yes, I've setup JMS. I checked the setup by putting "<to uri="wmqError:${error.queue}" />" directly into the router and it worked well.
>
> Few more things I noticed,
>
> -       if I call a method directly from main route that throws test exception then it gets written to error queue fine. But if any of the recipient throws exception then it is not getting written to error queue.
>

When the recipient throws exception, is your onException being executed?
If not, it could be easy for us to create a simple unit test to 
reproduce the error.

> -       It is not that onException is not being executed at all. exceptionPrint method of exceptionHandler is being called fine always.
>
> Regards,
> Nishant
>
> From: Willem.Jiang [via Camel] [mailto:ml-node+s465427n5716539h96@n5.nabble.com]
> Sent: Friday, July 27, 2012 10:48 AM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> Hi,
>
> Why are you using the scheme of wmqError?
> Did you setup up jms component with id of wmqError rightly?
>
>
> On 7/25/12 5:50 PM, nishant.rupani wrote:
>
>> I don't see any reference of retry or error queue write in logs. Method exceptionPrint is being called fine.
>>
>> Snippet of my context is -
>>
>> 1)
>>               <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>>
>>                           <onException useOriginalMessage="true">
>>                                       <exception>java.sql.SQLException</exception>
>>                                       <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
>>                                                   retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
>>                                       <handled>
>>                                                   <constant>true</constant>
>>                                       </handled>
>>                                       <bean ref="exceptionHandler" method="exceptionPrint" />
>>                                       <to uri="wmqError:${error.queue}" />
>>                           </onException>
>>
>>                           <route id="main-router">
>>                                       <from uri="wmq:${source.queue}" />
>>                                       <camel:bean ref="xmlToBeanProcessor" />
>>                                       <recipientList>
>>                                                   <header>recipients</header>
>>                                       </recipientList>
>>
>>                           </route>
>>               </camel:camelContext>
>>
>> 2)
>> <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>>
>>                           <route id="main-router" errorHandlerRef="myDeadLetterErrorHandler">
>>                                       <from uri="wmq:${source.queue}" />
>>                                       <camel:bean ref="xmlToBeanProcessor" />
>>                                       <recipientList>
>>                                                   <header>recipients</header>
>>                                       </recipientList>
>>                           </route>
>>
>>               <bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
>>                           <property name="deadLetterUri" value="wmq:${error.queue}" />
>>                           <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
>>               </bean>
>>
>>               <bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
>>                           <property name="maximumRedeliveries" value="1" />
>>                           <property name="redeliveryDelay" value="1" />
>>                           <property name="logHandled" value="true" />
>>                           <property name="logExhausted" value="true" />
>>                           <property name="logContinued" value="true" />
>>                           <property name="logRetryAttempted" value="true" />
>>                           <property name="logRetryStackTrace" value="true" />
>>                           <property name="logStackTrace" value="true" />
>>               </bean>
>>               .
>>               .
>>               .
>> </camel:camelContext>
>>
>> From: iocanel [via Camel] [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
>> Sent: Wednesday, July 25, 2012 2:46 PM
>> To: Rupani, Nishant (ISGT)
>> Subject: Re: Not writing to Error queue
>>
>> Can you please share your full camel context?
>> Also do you see anything in the logs?
>> --
>> *Ioannis Canellos*
>> *
>> FuseSource <http://fusesource.com>
>>
>> **
>> Blog: http://iocanel.blogspot.com
>> **
>> Twitter: iocanel
>> *
>> Ioannis Canellos http://iocanel.blogspot.com
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion below:
>>
>> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>> --------------------------------------------------------------------------
>> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>>
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>            http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716539.html
> To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
Hi,

Yes, I've setup JMS. I checked the setup by putting "<to uri="wmqError:${error.queue}" />" directly into the router and it worked well.

Few more things I noticed,

-       if I call a method directly from main route that throws test exception then it gets written to error queue fine. But if any of the recipient throws exception then it is not getting written to error queue.

-       It is not that onException is not being executed at all. exceptionPrint method of exceptionHandler is being called fine always.

Regards,
Nishant

From: Willem.Jiang [via Camel] [mailto:ml-node+s465427n5716539h96@n5.nabble.com]
Sent: Friday, July 27, 2012 10:48 AM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

Hi,

Why are you using the scheme of wmqError?
Did you setup up jms component with id of wmqError rightly?


On 7/25/12 5:50 PM, nishant.rupani wrote:

> I don't see any reference of retry or error queue write in logs. Method exceptionPrint is being called fine.
>
> Snippet of my context is -
>
> 1)
>              <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>
>                          <onException useOriginalMessage="true">
>                                      <exception>java.sql.SQLException</exception>
>                                      <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
>                                                  retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
>                                      <handled>
>                                                  <constant>true</constant>
>                                      </handled>
>                                      <bean ref="exceptionHandler" method="exceptionPrint" />
>                                      <to uri="wmqError:${error.queue}" />
>                          </onException>
>
>                          <route id="main-router">
>                                      <from uri="wmq:${source.queue}" />
>                                      <camel:bean ref="xmlToBeanProcessor" />
>                                      <recipientList>
>                                                  <header>recipients</header>
>                                      </recipientList>
>
>                          </route>
>              </camel:camelContext>
>
> 2)
> <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>
>                          <route id="main-router" errorHandlerRef="myDeadLetterErrorHandler">
>                                      <from uri="wmq:${source.queue}" />
>                                      <camel:bean ref="xmlToBeanProcessor" />
>                                      <recipientList>
>                                                  <header>recipients</header>
>                                      </recipientList>
>                          </route>
>
>              <bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
>                          <property name="deadLetterUri" value="wmq:${error.queue}" />
>                          <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
>              </bean>
>
>              <bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
>                          <property name="maximumRedeliveries" value="1" />
>                          <property name="redeliveryDelay" value="1" />
>                          <property name="logHandled" value="true" />
>                          <property name="logExhausted" value="true" />
>                          <property name="logContinued" value="true" />
>                          <property name="logRetryAttempted" value="true" />
>                          <property name="logRetryStackTrace" value="true" />
>                          <property name="logStackTrace" value="true" />
>              </bean>
>              .
>              .
>              .
> </camel:camelContext>
>
> From: iocanel [via Camel] [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=5716539&i=0>]
> Sent: Wednesday, July 25, 2012 2:46 PM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> Can you please share your full camel context?
> Also do you see anything in the logs?
> --
> *Ioannis Canellos*
> *
> FuseSource <http://fusesource.com>
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Twitter: iocanel
> *
> Ioannis Canellos http://iocanel.blogspot.com
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
>
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716539.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716541.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Why are you using the scheme of wmqError?
Did you setup up jms component with id of wmqError rightly?


On 7/25/12 5:50 PM, nishant.rupani wrote:
> I don't see any reference of retry or error queue write in logs. Method exceptionPrint is being called fine.
>
> Snippet of my context is -
>
> 1)
>              <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>
>                          <onException useOriginalMessage="true">
>                                      <exception>java.sql.SQLException</exception>
>                                      <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
>                                                  retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
>                                      <handled>
>                                                  <constant>true</constant>
>                                      </handled>
>                                      <bean ref="exceptionHandler" method="exceptionPrint" />
>                                      <to uri="wmqError:${error.queue}" />
>                          </onException>
>
>                          <route id="main-router">
>                                      <from uri="wmq:${source.queue}" />
>                                      <camel:bean ref="xmlToBeanProcessor" />
>                                      <recipientList>
>                                                  <header>recipients</header>
>                                      </recipientList>
>
>                          </route>
>              </camel:camelContext>
>
> 2)
> <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">
>
>                          <route id="main-router" errorHandlerRef="myDeadLetterErrorHandler">
>                                      <from uri="wmq:${source.queue}" />
>                                      <camel:bean ref="xmlToBeanProcessor" />
>                                      <recipientList>
>                                                  <header>recipients</header>
>                                      </recipientList>
>                          </route>
>
>              <bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
>                          <property name="deadLetterUri" value="wmq:${error.queue}" />
>                          <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
>              </bean>
>
>              <bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
>                          <property name="maximumRedeliveries" value="1" />
>                          <property name="redeliveryDelay" value="1" />
>                          <property name="logHandled" value="true" />
>                          <property name="logExhausted" value="true" />
>                          <property name="logContinued" value="true" />
>                          <property name="logRetryAttempted" value="true" />
>                          <property name="logRetryStackTrace" value="true" />
>                          <property name="logStackTrace" value="true" />
>              </bean>
>              .
>              .
>              .
> </camel:camelContext>
>
> From: iocanel [via Camel] [mailto:ml-node+s465427n5716444h51@n5.nabble.com]
> Sent: Wednesday, July 25, 2012 2:46 PM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> Can you please share your full camel context?
> Also do you see anything in the logs?
> --
> *Ioannis Canellos*
> *
> FuseSource <http://fusesource.com>
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Twitter: iocanel
> *
> Ioannis Canellos http://iocanel.blogspot.com
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716444.html
> To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
I don't see any reference of retry or error queue write in logs. Method exceptionPrint is being called fine.

Snippet of my context is -

1)
            <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">

                        <onException useOriginalMessage="true">
                                    <exception>java.sql.SQLException</exception>
                                    <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
                                                retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
                                    <handled>
                                                <constant>true</constant>
                                    </handled>
                                    <bean ref="exceptionHandler" method="exceptionPrint" />
                                    <to uri="wmqError:${error.queue}" />
                        </onException>

                        <route id="main-router">
                                    <from uri="wmq:${source.queue}" />
                                    <camel:bean ref="xmlToBeanProcessor" />
                                    <recipientList>
                                                <header>recipients</header>
                                    </recipientList>

                        </route>
            </camel:camelContext>

2)
<camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">

                        <route id="main-router" errorHandlerRef="myDeadLetterErrorHandler">
                                    <from uri="wmq:${source.queue}" />
                                    <camel:bean ref="xmlToBeanProcessor" />
                                    <recipientList>
                                                <header>recipients</header>
                                    </recipientList>
                        </route>

            <bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
                        <property name="deadLetterUri" value="wmq:${error.queue}" />
                        <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
            </bean>

            <bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
                        <property name="maximumRedeliveries" value="1" />
                        <property name="redeliveryDelay" value="1" />
                        <property name="logHandled" value="true" />
                        <property name="logExhausted" value="true" />
                        <property name="logContinued" value="true" />
                        <property name="logRetryAttempted" value="true" />
                        <property name="logRetryStackTrace" value="true" />
                        <property name="logStackTrace" value="true" />
            </bean>
            .
            .
            .
</camel:camelContext>

From: iocanel [via Camel] [mailto:ml-node+s465427n5716444h51@n5.nabble.com]
Sent: Wednesday, July 25, 2012 2:46 PM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

Can you please share your full camel context?
Also do you see anything in the logs?
--
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*
Ioannis Canellos http://iocanel.blogspot.com

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716444.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716446.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by Ioannis Canellos <io...@gmail.com>.
Can you please share your full camel context?
Also do you see anything in the logs?
-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
I tried couple of ways.

1)
<onException useOriginalMessage="true">
            <exception>java.sql.SQLException</exception>
            <handled>
                        <constant>true</constant>
            </handled>
            <bean ref="exceptionHandler" method="exceptionPrint" />
            <to uri="wmqError:${error.queue}" />
</onException>


2)
<route id="main" errorHandlerRef="myDeadLetterErrorHandler">
</route>

<bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
            <property name="deadLetterUri" value="wmqError:${error.queue}" />
            <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig" />
</bean>

<bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
            <property name="maximumRedeliveries" value="1" />
            <property name="redeliveryDelay" value="5" />
</bean>



From: Willem.Jiang [via Camel] [mailto:ml-node+s465427n5716436h3@n5.nabble.com]
Sent: Wednesday, July 25, 2012 1:34 PM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

How did you setup the DeadLetterQueue ?

On Wed, Jul 25, 2012 at 2:53 PM, nishant.rupani <
[hidden email]</user/SendEmail.jtp?type=node&node=5716436&i=0>> wrote:

> I am usign a router to consume messages from MQ. On exception, I want write
> the incoming message to the error queue. However, it is not writing message
> to error queue.
>
> For testing, I called a method of a bean on exception and that worked fine.
> but it is not publishing the message to error queue.
>
> We are using camel 2.9.0
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716436.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716441.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by Willem Jiang <wi...@gmail.com>.
How did you setup the DeadLetterQueue ?

On Wed, Jul 25, 2012 at 2:53 PM, nishant.rupani <
nishant.rupani@morganstanley.com> wrote:

> I am usign a router to consume messages from MQ. On exception, I want write
> the incoming message to the error queue. However, it is not writing message
> to error queue.
>
> For testing, I called a method of a bean on exception and that worked fine.
> but it is not publishing the message to error queue.
>
> We are using camel 2.9.0
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
Yes, I am marking the exception as handled.

Snippet of my context is -

            <camel:camelContext id="mainroute" xmlns="http://camel.apache.org/schema/spring" trace="true">

                        <onException useOriginalMessage="true">
                                    <exception>java.sql.SQLException</exception>
                                    <redeliveryPolicy logRetryAttempted="true" logRetryStackTrace="true" maximumRedeliveries="3"
                                                retryAttemptedLogLevel="DEBUG" retriesExhaustedLogLevel="ERROR" />
                                    <handled>
                                                <constant>true</constant>
                                    </handled>
                                    <bean ref="exceptionHandler" method="exceptionPrint" />
                                    <to uri="wmqError:${error.queue}" />
                        </onException>

                        <route id="main-router">
                                    <from uri="wmq:${source.queue}" />
                                    <camel:bean ref="xmlToBeanProcessor" />
                                    <recipientList>
                                                <header>recipients</header>
                                    </recipientList>

                        </route>
            </camel:camelContext>


From: James Carman [via Camel] [mailto:ml-node+s465427n5716517h14@n5.nabble.com]
Sent: Thursday, July 26, 2012 7:36 PM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

Are you using transactions?  If so, are you marking the exception as "handled"?

On Thu, Jul 26, 2012 at 12:54 AM, nishant.rupani
<[hidden email]</user/SendEmail.jtp?type=node&node=5716517&i=0>> wrote:

> Yes, it's WebSphere MQ. I have created ERROR queue as well. Please see my other reply wherein I have put the code snippet as well.
>
> Regards,
> Nishant
>
>
> From: Christian Mueller [via Camel] [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=5716517&i=1>]
> Sent: Thursday, July 26, 2012 3:03 AM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> With MQ, do you mean what? WebSphere MQ (I assume), ActiveMQ, RabittMQ, ...
> If you use WebSphere MQ, you have to create the ERROR queue upfront, did
> you?
>
> Best,
> Christian
>
> On Wed, Jul 25, 2012 at 8:53 AM, nishant.rupani <
> [hidden email]</user/SendEmail.jtp?type=node&node=5716485&i=0>> wrote:
>
>> I am usign a router to consume messages from MQ. On exception, I want write
>> the incoming message to the error queue. However, it is not writing message
>> to error queue.
>>
>> For testing, I called a method of a bean on exception and that worked fine.
>> but it is not publishing the message to error queue.
>>
>> We are using camel 2.9.0
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
>
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716500.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716517.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716519.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by James Carman <ja...@carmanconsulting.com>.
Are you using transactions?  If so, are you marking the exception as "handled"?

On Thu, Jul 26, 2012 at 12:54 AM, nishant.rupani
<ni...@morganstanley.com> wrote:
> Yes, it's WebSphere MQ. I have created ERROR queue as well. Please see my other reply wherein I have put the code snippet as well.
>
> Regards,
> Nishant
>
>
> From: Christian Mueller [via Camel] [mailto:ml-node+s465427n5716485h22@n5.nabble.com]
> Sent: Thursday, July 26, 2012 3:03 AM
> To: Rupani, Nishant (ISGT)
> Subject: Re: Not writing to Error queue
>
> With MQ, do you mean what? WebSphere MQ (I assume), ActiveMQ, RabittMQ, ...
> If you use WebSphere MQ, you have to create the ERROR queue upfront, did
> you?
>
> Best,
> Christian
>
> On Wed, Jul 25, 2012 at 8:53 AM, nishant.rupani <
> [hidden email]</user/SendEmail.jtp?type=node&node=5716485&i=0>> wrote:
>
>> I am usign a router to consume messages from MQ. On exception, I want write
>> the incoming message to the error queue. However, it is not writing message
>> to error queue.
>>
>> For testing, I called a method of a bean on exception and that worked fine.
>> but it is not publishing the message to error queue.
>>
>> We are using camel 2.9.0
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716485.html
> To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> --------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716500.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Not writing to Error queue

Posted by "nishant.rupani" <ni...@morganstanley.com>.
Yes, it's WebSphere MQ. I have created ERROR queue as well. Please see my other reply wherein I have put the code snippet as well.

Regards,
Nishant


From: Christian Mueller [via Camel] [mailto:ml-node+s465427n5716485h22@n5.nabble.com]
Sent: Thursday, July 26, 2012 3:03 AM
To: Rupani, Nishant (ISGT)
Subject: Re: Not writing to Error queue

With MQ, do you mean what? WebSphere MQ (I assume), ActiveMQ, RabittMQ, ...
If you use WebSphere MQ, you have to create the ERROR queue upfront, did
you?

Best,
Christian

On Wed, Jul 25, 2012 at 8:53 AM, nishant.rupani <
[hidden email]</user/SendEmail.jtp?type=node&node=5716485&i=0>> wrote:

> I am usign a router to consume messages from MQ. On exception, I want write
> the incoming message to the error queue. However, it is not writing message
> to error queue.
>
> For testing, I called a method of a bean on exception and that worked fine.
> but it is not publishing the message to error queue.
>
> We are using camel 2.9.0
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716485.html
To unsubscribe from Not writing to Error queue, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716435&code=bmlzaGFudC5ydXBhbmlAbW9yZ2Fuc3RhbmxleS5jb218NTcxNjQzNXwtMTA4NDIwMDI5OQ==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.




--
View this message in context: http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435p5716500.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not writing to Error queue

Posted by Christian Müller <ch...@gmail.com>.
With MQ, do you mean what? WebSphere MQ (I assume), ActiveMQ, RabittMQ, ...
If you use WebSphere MQ, you have to create the ERROR queue upfront, did
you?

Best,
Christian

On Wed, Jul 25, 2012 at 8:53 AM, nishant.rupani <
nishant.rupani@morganstanley.com> wrote:

> I am usign a router to consume messages from MQ. On exception, I want write
> the incoming message to the error queue. However, it is not writing message
> to error queue.
>
> For testing, I called a method of a bean on exception and that worked fine.
> but it is not publishing the message to error queue.
>
> We are using camel 2.9.0
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Not-writing-to-Error-queue-tp5716435.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>