You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by diwakar <di...@nsn.com> on 2011/09/30 20:19:08 UTC

Camel JBI Interaction

Hi, 

           I have a File sender endpoint (test:s) created that sends a file
to a folder. The SA containg this SU is deployed into Servicemix 4.3 deploy
folder. I am trying to send a file from Camel poller (file:input2) to the
JBI sender(test:s). This does not work. The code is below.

           Is this expected to work? Please let me know your comment. 

With Best Regards,
Diwakar

JBI File sender:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:file="http://servicemix.apache.org/file/1.0"
   xmlns:med="test"
   xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://servicemix.apache.org/file/1.0
   http://servicemix.apache.org/schema/servicemix-file-3.2.3.xsd
   http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
   <file:sender directory="Directory1" endpoint="endpoint" service="med:s">
   </file:sender>
</beans>

Camel File poller:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="file:input2"/>
<threads>
<log message="Copying ${file:name} to the output directory"/>
<to uri="jbi:service:test/s"/>
</threads> 
</route>
</camelContext>
</blueprint>

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4857978.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

             Thanks for the reply. 
             Servicemix 3.3.2 camel component pakages Camel 2.2 core. 
             How can I use latest Camel (2.8.2) in Servicemix 3.3.2. Please
let me know.

With Best Regards,
Diwakar


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4948975.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by Ioannis Canellos <io...@gmail.com>.
Yes you will be able to use camel inside ServiceMix 3.x.
-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

             Thanks for the comments.
             Since we are using a lot of JBI, can we continue with
Servicemix 3.3.2 for the existing code base and develop new functionality
with camel components and routes, also using existing custom JBI components
wherever necessary (I assume that camel components/patterns can interact
with JBI endpoints in Servicemix 3.3.2) inside servicemix 3.3.2 itself. Then
grdually migrate custom JBI components to Camel components and finally move
all Camel components/routes out of Servicemix 3.x container into Servicemix
5.x container.
               Please let me know your comment.

With Best Regards,
Diwakar

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4920922.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by Ioannis Canellos <io...@gmail.com>.
As you probably have already read, JBI is been considered deprecated (the
jbi spec is somewhat dead). In version 4.x users are discouraged of using
JBI, and its just there for those already using it.
In ServiceMix 5 there will be no option to use JBI at all.

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

             I was going thro
http://servicemix.396122.n5.nabble.com/DISCUSS-Rebooting-ServiceMix-5-td4528896.html. 
             Looks like NMR may not be included in Servicemix 5. 
             Will JBI/camel interaction stop working in Servicemix 5?
             Please let me know your comment.

With Best Regards,
Diwakar

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4917190.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

              Thanks. I will try that.
              In the previous example the file name of the output file was
random number. How to carry the name from Camel poller to the JBI sender.
Please let me know your comment.

With Best Regards,
Diwakar

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4903372.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by Ioannis Canellos <io...@gmail.com>.
Camel allows you to create a jbi service, which you can then use to route
messages to the actual camel endpoint.
So assuming that you want to send a message from a jbi consumer to camel
endpoint A, you will need to create a camel route from a "pivot" jbi service
(camel will create it for you) to endpoint A

Here how it would look like.

<from uri="jbi:service:http://foo.bar.org/PivotService">
<to uri="A"/>

The you can add jbi:service:http://foo.bar.org/PivotService as target to
your jbi consumer.

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

            Is it possible to connect to the Camel endpoint from servicemix
JBI? What should be the target service/endpoint. There are no names for the
endpoint in Camel.

With Best Regards,
Diwakar

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4891804.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

           >> try testing the same scenario using spring 
           It works! The file is created with a random name and not same as
the input file name. 
           Thanks.

With Best Regards,
Diwakar

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4890662.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by Ioannis Canellos <io...@gmail.com>.
You can dump the jbi packaging and still use jbi components.

In any case yes you can combine camel and jbi with both osgi and jbi
packaging.
I think that there is a known issue in the operability of camel-blueprint
and jbi (I am not 100% sure, I'll have to search a bit).

Can you please try testing the same scenario using spring instead of
blueprint to define your routes?

-- 
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

            Does not seem to work. The sa zip, the camel file and the error
log are attached. 
            I have tried jbi:service and jbi:endpoint. Both dint work.
            Please let me know your comment.

With Best Regards,
Diwakar


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4885276.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

                Found one solution. Use
servicemix-camel-2011.01-installer.zip. It has Camel 2.6. 
                To use Camel 2.8, the camel-core and camel-spring jars of
2.8 can be replaced in servicemix-camel-2011.01-installer.zip (and jbi.xml).
Or build servicemix-camel locally with the required Camel dependencies
locally. 

With Best Regards, 
Diwakar 


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4969206.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Oct 5, 2011 at 6:55 AM, diwakar <di...@nsn.com> wrote:
> Hi,
>
>             >> Don't use JBI if you can avoid using it.
>             Since we have used lof of JBI, we want to know if the
> interworking between JBI and Came possible. Please let us know.
>

Yes using the SMX Camel JBI component
http://camel.apache.org/jbi

> With Best Regards,
> Diwakar
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4871510.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel JBI Interaction

Posted by diwakar <di...@nsn.com>.
Hi, 

             >> Don't use JBI if you can avoid using it. 
             Since we have used lof of JBI, we want to know if the
interworking between JBI and Came possible. Please let us know.

With Best Regards,
Diwakar


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4871510.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JBI Interaction

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 30, 2011 at 8:19 PM, diwakar <di...@nsn.com> wrote:
> Hi,
>
>           I have a File sender endpoint (test:s) created that sends a file
> to a folder. The SA containg this SU is deployed into Servicemix 4.3 deploy
> folder. I am trying to send a file from Camel poller (file:input2) to the
> JBI sender(test:s). This does not work. The code is below.
>
>           Is this expected to work? Please let me know your comment.
>

Don't use JBI if you can avoid using it.

> With Best Regards,
> Diwakar
>
> JBI File sender:
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>   xmlns:file="http://servicemix.apache.org/file/1.0"
>   xmlns:med="test"
>   xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://servicemix.apache.org/file/1.0
>   http://servicemix.apache.org/schema/servicemix-file-3.2.3.xsd
>   http://www.springframework.org/schema/beans
>   http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>   <file:sender directory="Directory1" endpoint="endpoint" service="med:s">
>   </file:sender>
> </beans>
>
> Camel File poller:
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="
> http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
> <camelContext xmlns="http://camel.apache.org/schema/blueprint">
> <route>
> <from uri="file:input2"/>
> <threads>
> <log message="Copying ${file:name} to the output directory"/>
> <to uri="jbi:service:test/s"/>
> </threads>
> </route>
> </camelContext>
> </blueprint>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JBI-Interaction-tp4857978p4857978.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/