Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Can't grok event driven consumer

$
0
0
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

Viewing all articles
Browse latest Browse all 5648

Trending Articles