The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

zeppelinux (1) [Avatar] Offline
#1
Hi,

I'm not sure (still in the process of grasping the Camel), but it looks like there is a mismatch in the grey box on page 71.

It says that HTTP component only works with enrich, but shouldn't it be the opposite (poolEnrich)?

Thanks,
Dmitry
davsclaus (413) [Avatar] Offline
#2
Re: poolEnrich vs enrich (page 71)
The grey box is correct, enrich uses a producer to fetch the external resource. And pollEnrich uses a consumer.

So when you use enrich its like doing, a route that starts from X

from X
...
store current message somewhere
to Y (enrich)
merge result from Y with "stored message"


And if you do poll enrich its like

from X
...
store current message somewhere
from Y (pollEnrich)
merge result from Y with "stored message"

Though you cannot do a from inside another route. But from is a consumer. And to is a producer.

Hope this helps a bit.

So with the http component it has a producer that allows you to call an external http service, and get the reply from that server. eg just as you type a web address in your web browser, then its a producer calling that url you typed, and what you get back as response is the message the enrich will receive.

Take a bit to get used to. The rule of thumb is that 95% of times you use enrich. But if you use files, then you use pollEnrich.