Hi There is a pojo example at http://camel.apache.org/pojo-messaging-example.html
And see the links in the bottom of that page too. On Wed, Jul 2, 2014 at 5:04 PM, apara <[email protected]> wrote: > Using Camel 2.13.1 > > So, I have defined a @Produce on an interface, which appears to be producing > messages correctly (verified via logging): > > public interface Producer extends CriteriaServiceObserver { > @InOnly > void created(CriteriaDocument criteria, Map state); > > @InOnly > void updated(CriteriaDocument criteria, Map state); > > @InOnly > void beforeDelete(CriteriaDocument criteria, Map state); > > @InOnly > void afterDelete(CriteriaDocument criteria, Map state); > } > > @Produce(uri = "direct://criteria.event") > private Producer > jmsEventProducer; > > > Elsewhere, I am trying to consume these messages: > > @Component > public class SampleGroupWatcherServiceImpl implements > CriteriaServiceObserver { > > ... > > @Override > @Consume(uri = "direct://criteria.event") > public void created(final CriteriaDocument criteria, final Map state) { > LOG.debug(" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Criteria created"); > } > > @Override > @Consume(uri = "direct://criteria.event") > public void updated(final CriteriaDocument criteria, final Map state) { > LOG.debug(" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Criteria updated"); > } > > @Override > @Consume(uri = "direct://criteria.event") > public void beforeDelete(final CriteriaDocument criteria, final Map > state) { > LOG.debug(" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Criteria before delete"); > } > > @Override > @Consume(uri = "direct://criteria.event") > public void afterDelete(final CriteriaDocument criteria, final Map > state) { > LOG.debug(" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Criteria after delete"); > } > > ... > > However, the exception I get from Camel is: > > java.lang.IllegalArgumentException: Cannot add a 2nd consumer to the same > endpoint. Endpoint Endpoint[direct://criteria.event] only allows one > consumer. > > > > I am trying to "remote" and interface via Camel/ActiveMQ. So, my intent is > to have one box make the API call, message queued onto the Queue, and > another box de-queue and process the message. > > I am sure I am doing something wrong as the @Produce part seems to be > working correctly. I am just stuck at the @Consume. > > Thanks. > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-do-I-pair-Consume-with-Produce-on-an-interface-tp5753215.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- 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/
