camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-1749) Message body lost when message moved by exception clause
Date Wed, 24 Jun 2009 08:27:35 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-1749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52428#action_52428
] 

Claus Ibsen commented on CAMEL-1749:
------------------------------------

As you use JMS queues and you want to store the JAXB object there you need to let your object
be Serializable.

*To fix*:
Your class TPForholdHendelse should implement Serializable

What happens is that Camel detects the body class type when you send it to a JMS queue. And
if it cannot determine a type that matches the javax.jms.XXX object it will fallback to a
generic type.
And this generic type is *not* a javax.jms.ObjectMessage, that is the type you need to use.



> Message body lost when message moved by exception clause
> --------------------------------------------------------
>
>                 Key: CAMEL-1749
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1749
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 1.6.0, 1.6.1
>         Environment: WIn XP,  JSE1.5, ActiveMQ 5.1.0
>            Reporter: Rune Berg
>            Assignee: Claus Ibsen
>         Attachments: ruting-bodyloss.zip
>
>
> (See: http://www.nabble.com/Message-body-lost-when-message-moved-by-exception-clause-td24088536.html)
> After upgrading from 1.5.0 to 1.6.1, we find that an exception clause such as this one

> <onException>
> 	<exception>no.spk.ruting.feil.PersonIkkeFunnetNavException</exception>
> 	<redeliveryPolicy maximumRedeliveries="0" />
> 	<handled>
> 		<constant>true</constant>
> 	</handled>
> 	<to ref="tpforholdArbeidskoe" />
> </onException>
> cause the message body to be *empty* after the message has been moved to tpforholdArbeidskoe.
The message was jaxb-unmarshalled in the process that led up to the exception.
> ----------
> The attached application (which is a cut-down version of our real one) demonstrates the
problem. To reproduce:
> 1. Post a message with a text body like  this to queue "tpforholdHoved":
> <?xml version="1.0" encoding="UTF-8"?>
> <TPForholdHendelse>
> 	<type>Opprett</type>
> 	<ordning>1015</ordning>
> 	<datKundeFoedtNum>11223344</datKundeFoedtNum>
> 	<ideKundePrsnr>12345</ideKundePrsnr>
> </TPForholdHendelse>
> When this message gets consumed by TPForholdWSKlientImpl.opprettTPForholdNAV(), an exception
is deliberately thrown, and the message gets moved to queue "tpforholdArbeidskoe".
> When, in turn, the message gets consumed by HendelseKlientWSKlientImpl.lagArbeidskoeHendelsePersonIkkeFunnet(),
the message's body has been lost. At least, the param to HendelseKlientWSKlientImpl.lagArbeidskoeHendelsePersonIkkeFunnet()
is null. 
> 2. Now, change pom.xml som that the app uses Camel 1.5.0 instead. Rerun step 1. The problem
does not occur now.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message