Hi

See how the direct producer is implemented if you want a behavior like that.

On Wed, Sep 24, 2014 at 11:16 PM, Tim Dudgeon <[email protected]> wrote:
> I'm wanting to create a Component that acts as a simple from: endpoint, just
> like, for instance, direct: does.
> I want to be able to send an Exchange to it, handle it in some way, and send
> the outcomes (plural) to the downstream processor.
> Most of it makes sense, but I just can't work out how to receive the
> incoming Exchange using DefaultConsumer. I see stuff on polling, but not how
> to handle the simple case of just receiving an event and handling it.
> DefaultConsumer [1] seems to give me nothing to override.
>
> Something like:
>
> from("mycoolcomponent:test?param=foo")
>     .log("processing ${body}");
>
> // then later
>
> ProducerTemplate t = camelContext.createProducerTemplate();
> t.sendBody("mycoolcomponent:test", "Hello World!");
>
>
>
>
> [1] http://camel.apache.org/maven/current/camel-core/apidocs/index.html
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to