1 Reply Latest reply on Aug 7, 2014 2:05 PM by Keith Babo

    pollEnrich and switchyard JPA binding

    AYMAN a Newbie


      The following cause the switchyard to wait indefinitely and doesn't return anything, on the other hand if i used the camel jpa within switchyard i am able to get back my object. Basically, i would like to enrich the data that was triggered by some other mechanism. I am using 1.1.0 Final.


      Camel within Switchyard:


      from("switchyard://Test").log("Received message for 'Test' : ${body}").pollEnrich("jpa://com.thebrick.corp.Products?consumeDelete=false&persistenceUnit=org.hibernate.tutorial.jpa&consumer.query=select c from com.thebrick.corp.Products c where c.productCode like '556%'").multicast().to("switchyard://Wrekj","switchyard://Kjdks");




      from("switchyard://Test").log("Received message for 'Test' : ${body}").pollEnrich("switchyard://JPAReference").multicast().to("switchyard://Wrekj","switchyard://Kjdks");


      where JPAReference is a reference with a binding of JPA and i have configured the properties of consume Delete and the consumer.query inside the switchyard.xml



        • 1. Re: pollEnrich and switchyard JPA binding
          Keith Babo Master

          I assume this has something to do with switchyard endpoints not being compatible with pollEnrich, but it will take a bit of debugging to see what the actual disconnect is here.  A quick guess is that a consumer is being created for the switchyard endpoint and the underlying jpa endpoint (specified via reference binding) is never being triggered.  My suggestion would be to code up a basic example with pollEnrich using a file binding for the switchyard endpoint and share it.  Setting a timeout for the pollEnrich will eliminate the hang and should return null if no message is received (which should be the case based on what you reported).