You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sap <pa...@gmail.com> on 2017/06/07 14:30:54 UTC

Camel PollEnricher removing the headers

Camel is losing headers in pollEnrich Route.

See below logs.  if you search for VALUE_FROM_SOURCE in particular, you will
see it disappears in pollEnrich route. I am not doing any specific
processing before this route.



INFO | 07 Jun 2017 10:10:09,022 | [qtp1034736950-75]
org.apache.camel.processor.interceptor.Tracer - 
ID-D666TE0498-51163-1496844519634-0-1 >>> (route1) Processor@0x587a82d7 -->
direct://aggregator <<<
, Pattern:InOut
, Headers:{CamelAcceptContentType=application/json, CamelFileAbsolute=true,
CamelFileAbsolutePath=\tmp\value.csv, CamelFileLastModified=1496842179537,
CamelFileLength=30, CamelFileName=value.csv,
CamelFileNameConsumed=value.csv, CamelFileNameOnly=value.csv,
CamelFileParent=\tmp, CamelFilePath=\tmp\value.csv,
CamelFileRelativePath=value.csv, CamelHttpResponseCode=200,
CamelHttpResponseText=OK, CamelSqlRowCount=1,
CamelToEndpoint=file://%5C%5Ctmp%5CVALUE?fileName=value.csv,
Connection=Keep-Alive, Content-Length=476,
Content-Type=text/plain;charset=ISO-8859-1,
VALUE_FROM_SOURCE=VALUE,USD,ON,04/01/2017,,244.524,
VALUE_IN_DB=VALUE,USD,ON,04/01/2017,,244.524,
VALUE_IN_FILE=VALUE,USD,ON,03/01/2017,,200.524, Date=Wed, 07 Jun 2017
14:10:08 GMT, Proxy-Connection=Keep-Alive,
Set-Cookie=JSESSIONID=3ED3009D0262F86784E80B0C85FF71E9; Version=1;
Path="/publicAPI/"; Secure; HttpOnly,
Strict-Transport-Security=max-age=31536000; includeSubdomains;, year=2017}
, BodyType:com.test.VALUE
, Body:VALUE,USD,ON,04/01/2017,,244.524
 | (CamelLogger.java:159)
 INFO | 07 Jun 2017 10:10:09,022 | [qtp1034736950-75]
org.apache.camel.processor.interceptor.Tracer - 
ID-D666TE0498-51163-1496844519634-0-1 >>> (route4) direct://aggregator -->
pollEnrich[constant{file:\tmp?fileName=valueDateUpdatedNotified.log}] <<<
, Pattern:InOut
, Headers:{CamelAcceptContentType=application/json, CamelFileAbsolute=true,
CamelFileAbsolutePath=\tmp\value.csv, CamelFileLastModified=1496842179537,
CamelFileLength=30, CamelFileName=value.csv,
CamelFileNameConsumed=value.csv, CamelFileNameOnly=value.csv,
CamelFileParent=\tmp, CamelFilePath=\tmp\value.csv,
CamelFileRelativePath=value.csv, CamelHttpResponseCode=200,
CamelHttpResponseText=OK, CamelSqlRowCount=1,
CamelToEndpoint=file://%5C%5Ctmp%5CVALUE?fileName=value.csv,
Connection=Keep-Alive, Content-Length=476,
Content-Type=text/plain;charset=ISO-8859-1,
VALUE_FROM_SOURCE=VALUE,USD,ON,04/01/2017,,244.524,
VALUE_IN_DB=VALUE,USD,ON,04/01/2017,,244.524,
VALUE_IN_FILE=VALUE,USD,ON,03/01/2017,,200.524, Date=Wed, 07 Jun 2017
14:10:08 GMT, Proxy-Connection=Keep-Alive,
Set-Cookie=JSESSIONID=3ED3009D0262F86784E80B0C85FF71E9; Version=1;
Path="/publicAPI/"; Secure; HttpOnly,
Strict-Transport-Security=max-age=31536000; includeSubdomains;, year=2017}
, BodyType:com.test.VALUE
, Body:VALUE,USD,ON,04/01/2017,,244.524
 | (CamelLogger.java:159)
 WARN | 07 Jun 2017 10:10:10,055 | [Camel (midas) thread #55 -
file://%5C%5Ctmp%5CVALUE]
org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy
- Deleting orphaned lock file: \tmp\value.csv.camelLock |
(MarkerFileExclusiveReadLockStrategy.java:176)
 INFO | 07 Jun 2017 10:10:10,106 | [qtp1034736950-75]
org.apache.camel.processor.interceptor.Tracer - 
ID-D666TE0498-51163-1496844519634-0-1 >>> (route4)
pollEnrich[constant{file:\tmp?fileName=valueDateUpdatedNotified.log}] -->
setHeader[LAST_VALUE_DATE_NOTIFIED, Simple: ${body}] <<<
, Pattern:InOut
, Headers:{CamelFileAbsolute=true,
CamelFileAbsolutePath=\tmp\valueDateUpdatedNotified.log,
CamelFileLastModified=1492606819373, CamelFileLength=10,
CamelFileName=valueDateUpdatedNotified.log,
CamelFileNameConsumed=valueDateUpdatedNotified.log,
CamelFileNameOnly=valueDateUpdatedNotified.log, CamelFileParent=\tmp,
CamelFilePath=\tmp\valueDateUpdatedNotified.log,
CamelFileRelativePath=valueDateUpdatedNotified.log,
CamelToEndpoint=file://%5C%5Ctmp%5CVALUE?fileName=valueDateUpdatedNotified.log}
, BodyType:org.apache.camel.component.file.GenericFile
, Body:[Body is file based: GenericFile[\tmp\valueDateUpdatedNotified.log]]
 | (CamelLogger.java:159)
 INFO | 07 Jun 2017 10:10:10,106 | [qtp1034736950-75]
org.apache.camel.processor.interceptor.Tracer - 
ID-D666TE0498-51163-1496844519634-0-1 >>> (route4)
setHeader[LAST_VALUE_DATE_NOTIFIED, Simple: ${body}] -->
Processor@0x454131b2 <<<
, Pattern:InOut
, Headers:{CamelFileAbsolute=true,
CamelFileAbsolutePath=\tmp\valueDateUpdatedNotified.log,
CamelFileLastModified=1492606819373, CamelFileLength=10,
CamelFileName=valueDateUpdatedNotified.log,
CamelFileNameConsumed=valueDateUpdatedNotified.log,
CamelFileNameOnly=valueDateUpdatedNotified.log, CamelFileParent=\tmp,
CamelFilePath=\tmp\valueDateUpdatedNotified.log,
CamelFileRelativePath=valueDateUpdatedNotified.log,
CamelToEndpoint=file://%5C%5Ctmp%5CVALUE?fileName=valueDateUpdatedNotified.log,
LAST_VALUE_DATE_NOTIFIED=GenericFile[\tmp\valueDateUpdatedNotified.log]}
, BodyType:org.apache.camel.component.file.GenericFile
, Body:[Body is file based: GenericFile[\tmp\valueDateUpdatedNotified.log]]
 | (CamelLogger.java:159)






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

Re: Camel PollEnricher removing the headers

Posted by sap <pa...@gmail.com>.
Thank you, worked!



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

Re: Camel PollEnricher removing the headers

Posted by Claus Ibsen <cl...@gmail.com>.
Yes you need that, just pass in the agg strategy as a 2nd parameter to
poll enrich

Check the docs
http://camel.apache.org/content-enricher.html

Or search the unit tests of camel, where you can find some examples.


On Wed, Jun 7, 2017 at 5:09 PM, sap <pa...@gmail.com> wrote:
> I think I need something called AggregationStrategy. But not sure how to use
> it with pollEnrich route.
>
> If anyone knows any example link, that would help.
>
> Thanks,
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-PollEnricher-removing-the-headers-tp5802272p5802275.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel PollEnricher removing the headers

Posted by sap <pa...@gmail.com>.
I think I need something called AggregationStrategy. But not sure how to use
it with pollEnrich route.

If anyone knows any example link, that would help.

Thanks,



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