Didn't help.
Looking at the System.out from the Camel app when it tries to process the
message I'd say the problem is that the transaction gets committed before
the error processing happens. Here's a sample of the System.out where you
see the commit message then the errors start dumping.
INFO: Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans
[camelContext:beanPostProcessor,camelContext,mqseries,jmsConfig,transactionPolicy,transactionTemplate,jmsTransactionManager,myProxyConnectionFactory,mqConFactory,messageProcessor,testProcessor,msgConfig];
root of factory hierarchy
Feb 11, 2008 9:36:12 AM org.apache.camel.spring.spi.TransactionInterceptor
process
INFO: transaction begin
Process code here....
Message body: test
Feb 11, 2008 9:36:12 AM org.apache.camel.spring.spi.TransactionInterceptor
process
INFO: transaction commit
Feb 11, 2008 9:36:13 AM org.apache.camel.processor.Logger log
SEVERE: On delivery attempt: 0 caught: java.lang.Exception: Test exception.
java.lang.Exception: Test exception. at
mqprinter.TestProc.process(TestProc.java:14) at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:136)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:86)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:103)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:87)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:56)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:510)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:445)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:414)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:309)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:234)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:871)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:818)
at java.lang.Thread.run(Thread.java:803)
------
Here's how I have my camelContext configured
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring" >
<route>
<from uri="mqseries:test" />
<policy ref="transactionPolicy" />
<process ref="testProcessor" />
</route>
</camelContext>
------
Here's the testProcess code:
public void process(Exchange exch) throws Exception {
System.out.println("Process code here....");
System.out.println("Message body: " + exch.getIn().getBody());
throw new Exception("Test exception.");
}
------
James.Strachan wrote:
>
> i wonder if setting CACHE_NONE for the cacheLevelName helps with MQ?
>
> On 07/02/2008, Stephen J <[EMAIL PROTECTED]> wrote:
>>
>> Actually after further investigation, the mqseries transactions don't
>> work if
>> I use the RouteBuilder method of starting the app. It works fine if I
>> start
>> the app with all the spring plumbing code, but not if I just Subclass
>> RouteBuilder. Very weird. Both techniques work with ActiveMQ so I'm not
>> sure
>> what the difference is between ActiveMQ and the mqseries systems.
>>
>>
>> James.Strachan wrote:
>> >
>> > On 31/01/2008, Stephen J <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Yes!! It works. Thanks to all who have helped me solve this issue!
>> >
>> > Great stuff, thanks for letting us know.
>> >
>> > This was quite a long and complex thread; are you now happy now? Or
>> > were there still some gremlins in there trying to get transactions to
>> > work nicely with your routes?
>> >
>> > To get transactions to work nicely with any JMS it should just be a
>> > matter of creating the Spring transaction manager and registering it
>> > with the JMSComponent - is that your experience when using MQ?
>> >
>> > --
>> > James
>> > -------
>> > http://macstrac.blogspot.com/
>> >
>> > Open Source Integration
>> > http://open.iona.com
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/JMS-Transactions---How-To-tp15168958s22882p15341624.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
--
View this message in context:
http://www.nabble.com/JMS-Transactions---How-To-tp15168958s22882p15413139.html
Sent from the Camel - Users mailing list archive at Nabble.com.