You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Calle Andersson <ca...@hotmail.com> on 2021/07/02 14:19:08 UTC
Exchange headers disappears when using JPA component
Hi,
In Camel 3.4, the exchange headers disappears when using the JPA component (example using Endpoint DSL):
.to(jpa(DummyEntity.class.getName()).persistenceUnit("dummyPU").query("SELECT c FROM " + DummyEntity.class.getName() + " c"))
I believe the headers dissappears since the exchange pattern is InOut (I use the JPA component in a route which implements a REST service using REST DSL) according to the following code found inside JPAProducer:
Message target = exchange.getPattern().isOutCapable() ? exchange.getOut() : exchange.getIn();
target.setBody(answer);
(for further details, see https://github.com/apache/camel/blob/camel-3.4.x/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java#L188 )
The headers from the in message doesn’t seem to be copied to the out message.
Is this by design or a bug or have I been looking at the wrong place and drawn wrong conclusions?
Thanks in advance,
Calle
Re: Exchange headers disappears when using JPA component
Posted by Claus Ibsen <cl...@gmail.com>.
I created a JIRA
https://issues.apache.org/jira/browse/CAMEL-16824
On Mon, Jul 26, 2021 at 7:10 PM Claus Ibsen <cl...@gmail.com> wrote:
>
> Hi
>
> Yeah lets ensure those headers are not lost. You are welcome to create
> a JIRA ticket.
> Also if you want to provide a fix, then you can for example see how
> camel-mybatis preservers the headers.
>
> On Fri, Jul 2, 2021 at 7:36 PM Calle Andersson
> <ca...@hotmail.com> wrote:
> >
> > Hi,
> >
> >
> >
> > In Camel 3.4, the exchange headers disappears when using the JPA component (example using Endpoint DSL):
> >
> > .to(jpa(DummyEntity.class.getName()).persistenceUnit("dummyPU").query("SELECT c FROM " + DummyEntity.class.getName() + " c"))
> >
> >
> >
> > I believe the headers dissappears since the exchange pattern is InOut (I use the JPA component in a route which implements a REST service using REST DSL) according to the following code found inside JPAProducer:
> >
> > Message target = exchange.getPattern().isOutCapable() ? exchange.getOut() : exchange.getIn();
> >
> > target.setBody(answer);
> >
> > (for further details, see https://github.com/apache/camel/blob/camel-3.4.x/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java#L188 )
> >
> >
> >
> > The headers from the in message doesn’t seem to be copied to the out message.
> >
> >
> >
> > Is this by design or a bug or have I been looking at the wrong place and drawn wrong conclusions?
> >
> >
> >
> > Thanks in advance,
> >
> > Calle
> >
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Exchange headers disappears when using JPA component
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Yeah lets ensure those headers are not lost. You are welcome to create
a JIRA ticket.
Also if you want to provide a fix, then you can for example see how
camel-mybatis preservers the headers.
On Fri, Jul 2, 2021 at 7:36 PM Calle Andersson
<ca...@hotmail.com> wrote:
>
> Hi,
>
>
>
> In Camel 3.4, the exchange headers disappears when using the JPA component (example using Endpoint DSL):
>
> .to(jpa(DummyEntity.class.getName()).persistenceUnit("dummyPU").query("SELECT c FROM " + DummyEntity.class.getName() + " c"))
>
>
>
> I believe the headers dissappears since the exchange pattern is InOut (I use the JPA component in a route which implements a REST service using REST DSL) according to the following code found inside JPAProducer:
>
> Message target = exchange.getPattern().isOutCapable() ? exchange.getOut() : exchange.getIn();
>
> target.setBody(answer);
>
> (for further details, see https://github.com/apache/camel/blob/camel-3.4.x/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java#L188 )
>
>
>
> The headers from the in message doesn’t seem to be copied to the out message.
>
>
>
> Is this by design or a bug or have I been looking at the wrong place and drawn wrong conclusions?
>
>
>
> Thanks in advance,
>
> Calle
>
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Exchange headers disappears when using JPA component
Posted by Calle Andersson <ca...@hotmail.com>.
Hi again,
Is there anyone who can confirm if this behaviour is by design or a bug?
Thanks in advance,
Calle
________________________________
Från: Calle Andersson <ca...@hotmail.com>
Skickat: fredag 2 juli 2021 16:19
Till: users@camel.apache.org
Ämne: Exchange headers disappears when using JPA component
Hi,
In Camel 3.4, the exchange headers disappears when using the JPA component (example using Endpoint DSL):
.to(jpa(DummyEntity.class.getName()).persistenceUnit("dummyPU").query("SELECT c FROM " + DummyEntity.class.getName() + " c"))
I believe the headers dissappears since the exchange pattern is InOut (I use the JPA component in a route which implements a REST service using REST DSL) according to the following code found inside JPAProducer:
Message target = exchange.getPattern().isOutCapable() ? exchange.getOut() : exchange.getIn();
target.setBody(answer);
(for further details, see https://github.com/apache/camel/blob/camel-3.4.x/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaProducer.java#L188 )
The headers from the in message doesn’t seem to be copied to the out message.
Is this by design or a bug or have I been looking at the wrong place and drawn wrong conclusions?
Thanks in advance,
Calle