You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by ra...@wipro.com on 2008/03/23 10:41:29 UTC

Camel JPA inserts null values

Hi All,
 
Camel etl example with the following Route works fine
 
from("file:inbox/data1?noop=true").convertBodyTo(PersonDocument.class)
        //  .intercept(transactionInterceptor())
            .to("jpa:org.apache.camel.example.etl.CustomerEntity");

When I change this use smx filepoller with the following route, this inserts null vaues in the customer table. Actually I am using a passthrough bean su.
 
  from("jbi:endpoint:http://camel.apache.org/example/etl/persist/person")
      .convertBodyTo(PersonDocument.class)
        //  .intercept(transactionInterceptor())
            .to("jpa:org.apache.camel.example.etl.CustomerEntity");
 
fillePoller su config..
-------------------------
<beans xmlns:file="http://servicemix.apache.org/file/1.0"
       xmlns:ls="http://servicemix.apache.org/samples/logging-sample">
<file:poller service="ls:filePoller"
                      endpoint="poller"
                      targetService="ls:beanRouter"
                      targetEndpoint="router"
                      file="inbox/data1">
</file:poller>
</beans>
 
Bean su
----------------
 
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0" 
      xmlns:ls="http://servicemix.apache.org/samples/logging-sample">
  <bean:endpoint service="ls:beanRouter" endpoint="router">
      <bean:bean>
          <bean class="org.apache.servicemix.samples.logging.BeanRouter" />
      </bean:bean>
  </bean:endpoint>
  
</beans>

Bean su code..
----------------------
 public void onMessageExchange(MessageExchange exchange) throws MessagingException {
 
    InOnly in = (InOnly) exchange;
        if (in.getStatus() == ExchangeStatus.DONE) {
            return;
        } else if (in.getStatus() == ExchangeStatus.ERROR) {
            return;
        }
        System.err.println(in.getService().getLocalPart() + " requested");
  try {
    NormalizedMessage message = exchange.getMessage("in");
    Source content = message.getContent();
    QName targetService = new QName("http://camel.apache.org/example/etl","persist");
    MessageExchangeFactory exchangeFact = channel.createExchangeFactoryForService(targetService);
    InOnly response = exchangeFact.createInOnlyExchange();
    NormalizedMessage jpaMessage = response.createMessage();
    jpaMessage.setContent(content);
    response.setInMessage(jpaMessage);
    channel.sendSync(response);
    exchange.setStatus(ExchangeStatus.DONE);
    channel.send(exchange);
    } catch (Exception e) {
            in.setError(e);
            channel.sendSync(in);
        }

    }
 
Has  somone encountered this problem earlier..
 
Regards, 
Rabi Mishra 
Wipro Technologies 
Hinjewadi, Pune 
Cell: +91(0)9765391877 
http://rabisblog.blogspot.com/ 

________________________________

From: mjustin [mailto:michael.justin@gmx.net]
Sent: Fri 3/21/2008 11:25 PM
To: users@servicemix.apache.org
Subject: Starting point for JBI in the examples, query component WSDL




Dear all,

I managed to get the basic example to work and I am very happy that it works
really smooth now in the 3.2.2 snapshot.

Now I would like to climb to the next level, and if I understand it
correctly, everything in JBI is build around service providers and service
consumers. In the "JBI-Components-Theory" PDF article, I read that the
service providers provide a service description using WSDL. Is this also
true in the basic example, meaning that a WSDL description is available for
the client, using a special URL, which specifies the details of the
components of the basic example?

My hope is that it is possible to interact with ServiceMix using non-Java
(Delphi) clients so access to WSDL would be the perfect starting point for
the next steps.

Best Regards
Michael Justin
--
betasoft - Software for Delphi(tm) and for the Java(tm) platform
http://www.mikejustin.com/
http://www.betabeans.de/
--
View this message in context: http://www.nabble.com/Starting-point-for-JBI-in-the-examples%2C-query-component-WSDL-tp16203266s12049p16203266.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.




The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


RE: Camel JPA inserts null values

Posted by ra...@wipro.com.
Forgot to mention, I am using 3.3SNAPSHOT.

 
________________________________

From: rabi.mishra@wipro.com [mailto:rabi.mishra@wipro.com]
Sent: Sun 3/23/2008 3:11 PM
To: users@servicemix.apache.org
Subject: Camel JPA inserts null values



Hi All,

Camel etl example with the following Route works fine

from("file:inbox/data1?noop=true").convertBodyTo(PersonDocument.class)
        //  .intercept(transactionInterceptor())
            .to("jpa:org.apache.camel.example.etl.CustomerEntity");

When I change this use smx filepoller with the following route, this inserts null vaues in the customer table. Actually I am using a passthrough bean su.

  from("jbi:endpoint:http://camel.apache.org/example/etl/persist/person")
      .convertBodyTo(PersonDocument.class)
        //  .intercept(transactionInterceptor())
            .to("jpa:org.apache.camel.example.etl.CustomerEntity");

fillePoller su config..
-------------------------
<beans xmlns:file="http://servicemix.apache.org/file/1.0"
       xmlns:ls="http://servicemix.apache.org/samples/logging-sample">
<file:poller service="ls:filePoller"
                      endpoint="poller"
                      targetService="ls:beanRouter"
                      targetEndpoint="router"
                      file="inbox/data1">
</file:poller>
</beans>

Bean su
----------------

<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
      xmlns:ls="http://servicemix.apache.org/samples/logging-sample">
  <bean:endpoint service="ls:beanRouter" endpoint="router">
      <bean:bean>
          <bean class="org.apache.servicemix.samples.logging.BeanRouter" />
      </bean:bean>
  </bean:endpoint>
 
</beans>

Bean su code..
----------------------
 public void onMessageExchange(MessageExchange exchange) throws MessagingException {

    InOnly in = (InOnly) exchange;
        if (in.getStatus() == ExchangeStatus.DONE) {
            return;
        } else if (in.getStatus() == ExchangeStatus.ERROR) {
            return;
        }
        System.err.println(in.getService().getLocalPart() + " requested");
  try {
    NormalizedMessage message = exchange.getMessage("in");
    Source content = message.getContent();
    QName targetService = new QName("http://camel.apache.org/example/etl","persist");
    MessageExchangeFactory exchangeFact = channel.createExchangeFactoryForService(targetService);
    InOnly response = exchangeFact.createInOnlyExchange();
    NormalizedMessage jpaMessage = response.createMessage();
    jpaMessage.setContent(content);
    response.setInMessage(jpaMessage);
    channel.sendSync(response);
    exchange.setStatus(ExchangeStatus.DONE);
    channel.send(exchange);
    } catch (Exception e) {
            in.setError(e);
            channel.sendSync(in);
        }

    }

Has  somone encountered this problem earlier..

Regards,
Rabi Mishra



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com