You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by sgomezsaez <sg...@hotmail.com> on 2013/02/15 15:43:17 UTC

NMR api from OSGI bundle

Hi,

I've developed a custom OSGI Bundle which sends a message to a jbi endpoint
configured using camel-jbi. My route is the following:

Custom OSGI Bundle --> Camel JBI Endpoint --> Camel JDBC --> external
database

I'm able to receive the message in the camel jbi endpoint, but its body is
null. It seems that it is not marshaling the content. 

In the Camel MyRouteBuilder I have a processor which logs the message before
forwarding it. 

I'm getting the message in this way:

public void process(Exchange exchange) throws Exception {
  Message msg = exchange.getIn().copy();
  Object body = msg.getBody();
  ...
}

Then I cast the body to the type I've send from the OSGI bundle. But the
object got from the body is null. I though It could be because of object
serialization between the nmr and the servicemix-camel-mt, so I've tried
with plain XML format in the body, but I'm still receiving a null body.

Putting the object as an attachment works fine, but I need to send it in the
body. 

Thanks in advance.

Regards,

Santiago






--
View this message in context: http://servicemix.396122.n5.nabble.com/NMR-api-from-OSGI-bundle-tp5715834.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: NMR api from OSGI bundle

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,


Could you show us the code you're using to send the message to the NMR/JBI
layer?  Also, you might want to try enabling TRACE logging for the NMR,
that will log the message bodies as they travel through the NMR, so it
might help you figure out where things go wrong.


Regards,

Gert Vanthienen


On Fri, Feb 15, 2013 at 3:43 PM, sgomezsaez <sg...@hotmail.com> wrote:

> Hi,
>
> I've developed a custom OSGI Bundle which sends a message to a jbi endpoint
> configured using camel-jbi. My route is the following:
>
> Custom OSGI Bundle --> Camel JBI Endpoint --> Camel JDBC --> external
> database
>
> I'm able to receive the message in the camel jbi endpoint, but its body is
> null. It seems that it is not marshaling the content.
>
> In the Camel MyRouteBuilder I have a processor which logs the message
> before
> forwarding it.
>
> I'm getting the message in this way:
>
> public void process(Exchange exchange) throws Exception {
>   Message msg = exchange.getIn().copy();
>   Object body = msg.getBody();
>   ...
> }
>
> Then I cast the body to the type I've send from the OSGI bundle. But the
> object got from the body is null. I though It could be because of object
> serialization between the nmr and the servicemix-camel-mt, so I've tried
> with plain XML format in the body, but I'm still receiving a null body.
>
> Putting the object as an attachment works fine, but I need to send it in
> the
> body.
>
> Thanks in advance.
>
> Regards,
>
> Santiago
>
>
>
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/NMR-api-from-OSGI-bundle-tp5715834.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>