You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lsantos <le...@globo.com> on 2016/11/03 17:09:03 UTC

Enrich headers of message

Hi there, 

I will start off by describing what I am willing to accomplish.

I need to process a file line by line, pluck out a field from each file
record, make two rest api calls, the first one to get a json web token, the
second one use the token from the first api call in the header and return
information that I will replace in the file record. In the end I just stream
the modified file record to sftp transfer.

I was wondering if it would be possible to enrich the headers of the message
by using information from the rest api calls without modifying the body of
the message.



--
View this message in context: http://camel.465427.n5.nabble.com/Enrich-headers-of-message-tp5789717.html
Sent from the Camel - Users mailing list archive at Nabble.com.

AW: Enrich headers of message

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
Yes. 
A Message contains properties and IN and OUT parts consisting each of header
values and the body.

Jan

> -----Ursprüngliche Nachricht-----
> Von: lsantos [mailto:leandro.bueno@globo.com]
> Gesendet: Donnerstag, 3. November 2016 18:09
> An: users@camel.apache.org
> Betreff: Enrich headers of message
> 
> Hi there,
> 
> I will start off by describing what I am willing to accomplish.
> 
> I need to process a file line by line, pluck out a field from each file
> record, make two rest api calls, the first one to get a json web token,
> the second one use the token from the first api call in the header and
> return information that I will replace in the file record. In the end I
> just stream the modified file record to sftp transfer.
> 
> I was wondering if it would be possible to enrich the headers of the
> message by using information from the rest api calls without modifying
> the body of the message.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Enrich-
> headers-of-message-tp5789717.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Enrich headers of message

Posted by lsantos <le...@globo.com>.
 

Sweet, thanks for the input guys. 

I am exploring the headers alternative like you mentioned @owain. 
---
Leandro Bueno Santos 

On 03/11/2016 14:33, owain [via Camel] wrote: 

> I think all you are wanting to do is save the file record (body) to your own header called, say, filebody, then you can restore filebody header to the exchange body at the end for the out. In the meantime you can do the enrich with the setBody to some data from header.filebody 
> 
> In summary, your own headers are very useful to save intermediary values during routes. You should be aware that the propagate through to other routes that take the exchange as an input (e.g. a wire tap) so you might want to delete them before you send on the exchange. 
> 
> O. 
> 
> -------------------------
> 
> If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/Enrich-headers-of-message-tp5789717p5789721.html [1] 
> To unsubscribe from Enrich headers of message, click here [2].
> NAML [3]
 

Links:
------
[1]
http://camel.465427.n5.nabble.com/Enrich-headers-of-message-tp5789717p5789721.html
[2]
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=5789717&amp;code=bGVhbmRyby5idWVub0BnbG9iby5jb218NTc4OTcxN3w4MDMyMzU2MzQ=
[3]
http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml



--
View this message in context: http://camel.465427.n5.nabble.com/Enrich-headers-of-message-tp5789717p5789724.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Enrich headers of message

Posted by owain <ow...@integration.technology>.
I think all you are wanting to do is save the file record (body) to your own
header called, say, filebody, then you can restore filebody header to the
exchange body at the end for the out.  In the meantime you can do the enrich
with the setBody to some data from header.filebody

In summary, your own headers are very useful to save intermediary values
during routes.  You should be aware that the propagate through to other
routes that take the exchange as an input (e.g. a wire tap) so you might
want to delete them before you send on the exchange.

O.

 



--
View this message in context: http://camel.465427.n5.nabble.com/Enrich-headers-of-message-tp5789717p5789721.html
Sent from the Camel - Users mailing list archive at Nabble.com.