concept Consumer in category camel

appears as: Consumer
Camel in Action

This is an excerpt from Manning's book Camel in Action.

Figure 11.7. A Component creates an Endpoint, which then creates Producers and Consumers.

The first thing you’ll notice is that you’re deriving from another default implementation class from camel-core . In this case, you’re extending the DefaultEndpoint class. It’s very common when creating a new Camel component to have the Component, Endpoint, Consumer, and Producer all derive from default implementations in camel-core. This isn’t necessary, but it makes new component development much easier, and you always benefit from the latest improvements to the default implementations without having to code them yourself.

Listing E.1. Actor as consumer receiving messages from a SEDA endpoint
import akka.actor.Actor import akka.camel.{Consumer, Message} class SedaConsumer extends Actor with Consumer { def endpointUri = "seda:example" protected def receive = { case Message("stop", headers) => self.stop case Message(body, headers) => println("message = %s" format body) } }