Thanks for your help.

I found exactly what I wanted to (by reading those links on the bottom of
the page) with Spring Remoting using Camel's extensions.  For some reason,
I thought that @Produce and @Consume would do something similar.


On Wed, Jul 2, 2014 at 10:12 AM, Claus Ibsen-2 [via Camel] <
[email protected]> wrote:

> 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 <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=5753221&i=0>> 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: [hidden email]
> <http://user/SendEmail.jtp?type=node&node=5753221&i=1>
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/How-do-I-pair-Consume-with-Produce-on-an-interface-tp5753215p5753221.html
>  To unsubscribe from How do I pair @Consume with @Produce on an
> interface?, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5753215&code=YXBhcmFAc3RhbmRhcmRzZXQuY29tfDU3NTMyMTV8LTU0MjY3MDkwOQ==>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/How-do-I-pair-Consume-with-Produce-on-an-interface-tp5753215p5753235.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to