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.

gmazza (30) [Avatar] Offline
#1
The Multiple Routes section (p. 40) is not clear on a certain point --

For this route:
<route>
<from uri="file:src/data?noop=true"/>
<process ref="downloadLogger"/>
<to uri="jms:incomingOrders"/>
</route>

It says:
"What if we wanted to print this message [i.e., call downloadLogger] after consuming it from the incomingOrders queue? To do this, we -->need<-- to create another route."

and then gives this solution:

<route>
<from uri="file:src/data?noop=true"/>
<to uri="jms:incomingOrders"/>
</route>
<route>
<from uri="jms:incomingOrders"/>
<process ref="downloadLogger"/>
</route>

But what the book *doesn't* explain is why we just can't go ahead and do this instead:

<route>
<from uri="file:src/data?noop=true"/>
<to uri="jms:incomingOrders"/>
<process ref="downloadLogger"/>
</route>

It would be good to elaborate why we *need* to create another route and can't just use the solution I just gave immediately above. Or, if we don't really need to create another route (and you're just giving us an alternative implementation), to rephrase the "To do this, we need to create another route." sentence to something like "downloadLogger can be added to the end of the route, or alternatively, a second route created as shown next."

[Also, in Chapter 2, make sure the numbering gets fixed, see page 26:

6. Polling the FTP server and downloading new orders
7. Converting the order files to JMS Messages
8. Sending the messages to the JMS incomingOrders queue

The numbers should be 1, 2, 3 instead. This misnumbering is happening in other lists in the chapter as well]
davsclaus (413) [Avatar] Offline
#2
Re: Clarification needed on Ch. 2 - pg. 40 (need for multiple routes)
Don't worry about the numbering, as they will be fixed when Manning typeset the book.

The book is correct that you need a 2nd route because the message on the JMS queue is not consumed, but only published to the queue. This is because the MEP is InOnly (Event Message EIP).

And you want the downloadLogger to be invoked after the message has been consumed.

Explaining request-reply over JMS in chapter 2 is a bit to early and its explained in chapter 7.
gmazza (30) [Avatar] Offline
#3
Re: Clarification needed on Ch. 2 - pg. 40 (need for multiple routes)
Also, on page 42, you explain how the endpoint element allows you to factor out uri's from the routing elements:

<camelContext xmlns="http://camel.apache.org/schema/spring">
<endpoint id="ridersFtp" >
uri="ftp://riderautoparts.com/orders?username=rider&password=secret"/>
<route>
<from ref="ridersFtp"/>
<to uri="jms:incomingOrders"/>
</route>
</camelContext>

Such functionality would probably be more useful if the endpoint element was *outside* the camelContext (so it could be reused for other camelContexts). You may wish to display it that way.

Glen
gmazza (30) [Avatar] Offline
#4
Re: Clarification needed on Ch. 2 - pg. 40 (need for multiple routes)
Also, in listing 2.4 in the book "received" is misspelled "recieved" in two places. (I don't know if the Manning editors also fix the Java code listings.)