You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jon Mithe <jo...@gmail.com> on 2014/09/03 17:18:41 UTC
pollEnrich using the incomming message excahnge
Hello,
I'm a bit confused / stuck with an enrichment problem.
I have a message that I want to enrich using by making a request to an
external service using part of the information the original message has.
As I unserstand Content Enricher is the EIP I want to use and for camel, the
"enrich" implementation as I want to invoke an external service and use its
reply as a source.
But where I am stuck is when enriching I can't specify what message I want
to send as the enrich request, it seemingly has to be the existing message.
Is there some way of doing a request-reply and formulate a new message /
exhcange for the request part using some information from the old message?
The aggregation would then be the same the old / original message to be
enriched and the reply, the request would be lost.
Thanks,
Jon
--
View this message in context: http://camel.465427.n5.nabble.com/pollEnrich-using-the-incomming-message-excahnge-tp5756014.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: pollEnrich using the incomming message excahnge
Posted by Matt Sicker <bo...@gmail.com>.
The names of things in Camel sometimes don't match up perfectly with EIP. A
processor would be your best bet here (or a bean for non-Camel API usage).
On 3 September 2014 11:10, Elvio Caruana (ecaruana) <ec...@cisco.com>
wrote:
> I think what you require is a content filter within the enrich step.
>
> enrich("direct:enrichRoute", fooAggregator);
>
> from("direct:enrichRoute")
> .process("bodyFilter") // transforms the current body to what is required
> for the request
> .to("http://some-api-somewhere");
>
>
>
>
> -----Original Message-----
> From: Jon Mithe [mailto:jon.mithe@gmail.com]
> Sent: 03 September 2014 16:19
> To: users@camel.apache.org
> Subject: pollEnrich using the incomming message excahnge
>
> Hello,
>
> I'm a bit confused / stuck with an enrichment problem.
>
> I have a message that I want to enrich using by making a request to an
> external service using part of the information the original message has.
>
> As I unserstand Content Enricher is the EIP I want to use and for camel,
> the "enrich" implementation as I want to invoke an external service and use
> its reply as a source.
>
> But where I am stuck is when enriching I can't specify what message I want
> to send as the enrich request, it seemingly has to be the existing message.
>
> Is there some way of doing a request-reply and formulate a new message /
> exhcange for the request part using some information from the old message?
> The aggregation would then be the same the old / original message to be
> enriched and the reply, the request would be lost.
>
>
> Thanks,
> Jon
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/pollEnrich-using-the-incomming-message-excahnge-tp5756014.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Matt Sicker <bo...@gmail.com>
RE: pollEnrich using the incomming message excahnge
Posted by "Elvio Caruana (ecaruana)" <ec...@cisco.com>.
I think what you require is a content filter within the enrich step.
enrich("direct:enrichRoute", fooAggregator);
from("direct:enrichRoute")
.process("bodyFilter") // transforms the current body to what is required for the request
.to("http://some-api-somewhere");
-----Original Message-----
From: Jon Mithe [mailto:jon.mithe@gmail.com]
Sent: 03 September 2014 16:19
To: users@camel.apache.org
Subject: pollEnrich using the incomming message excahnge
Hello,
I'm a bit confused / stuck with an enrichment problem.
I have a message that I want to enrich using by making a request to an external service using part of the information the original message has.
As I unserstand Content Enricher is the EIP I want to use and for camel, the "enrich" implementation as I want to invoke an external service and use its reply as a source.
But where I am stuck is when enriching I can't specify what message I want to send as the enrich request, it seemingly has to be the existing message.
Is there some way of doing a request-reply and formulate a new message / exhcange for the request part using some information from the old message?
The aggregation would then be the same the old / original message to be enriched and the reply, the request would be lost.
Thanks,
Jon
--
View this message in context: http://camel.465427.n5.nabble.com/pollEnrich-using-the-incomming-message-excahnge-tp5756014.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: pollEnrich using the incomming message excahnge
Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Sep 3, 2014 at 5:18 PM, Jon Mithe <jo...@gmail.com> wrote:
> Hello,
>
> I'm a bit confused / stuck with an enrichment problem.
>
> I have a message that I want to enrich using by making a request to an
> external service using part of the information the original message has.
>
> As I unserstand Content Enricher is the EIP I want to use and for camel, the
> "enrich" implementation as I want to invoke an external service and use its
> reply as a source.
>
> But where I am stuck is when enriching I can't specify what message I want
> to send as the enrich request, it seemingly has to be the existing message.
>
Yeah that is currently not supported, eg as also documented on
http://camel.apache.org/content-enricher.html
There is a JIRA ticket about supporting this in the future.
Though often you can use "dynamic to" - and more rarely need to use
"dynamic from" (consumer) - though the latter you may need for picking
up files/ftp files etc.
> Is there some way of doing a request-reply and formulate a new message /
> exhcange for the request part using some information from the old message?
> The aggregation would then be the same the old / original message to be
> enriched and the reply, the request would be lost.
>
Yeah content enricher / or write some java code where you can use
producer template / consumer template etc to read some external data,
and then do the merge in the java code.
>
> Thanks,
> Jon
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/pollEnrich-using-the-incomming-message-excahnge-tp5756014.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/