camel-dev mailing list archives

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


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:
>             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:
> (See:
> 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.

View raw message