You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "AMARNATH, Balachandar" <BA...@airbus.com> on 2013/02/04 06:21:39 UTC

ServiceMix deploying a camel route

Hi,

I am new to servicemix. I have a camel route written in JavaDSL using Routebuilder class, configure method.... I want to deploy this route into servicemix container. I tried sample examples comes with the servicemix bundle (camel-osgi and camel-blueprint) and seems they require a XML document in which route and beans are defined.  Is there a way to avoid the usage of these XMLs and with only using java DSL, deploy the route and interact with the route ?

With thanks and regards
Balachandar




The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.


Re: ServiceMix deploying a camel route

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

You don't need have XML DSL, only java DSL should be fine. Do you have any problem with JAVA DSL only?
You probably need a bundle activator to start the route, or use way like 
    
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <package>your.java.dsl.package</package>
      </camelContext>
to let camel know where your java DSL is and launch it.

-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-2-4, at 下午1:21, AMARNATH, Balachandar wrote:

> Hi,
> 
> I am new to servicemix. I have a camel route written in JavaDSL using Routebuilder class, configure method.... I want to deploy this route into servicemix container. I tried sample examples comes with the servicemix bundle (camel-osgi and camel-blueprint) and seems they require a XML document in which route and beans are defined.  Is there a way to avoid the usage of these XMLs and with only using java DSL, deploy the route and interact with the route ?
> 
> With thanks and regards
> Balachandar
> 
> 
> 
> 
> The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
> If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
> Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
> All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
> 


Re: ServiceMix deploying a camel route

Posted by Henryk Konsek <he...@gmail.com>.
Hi Amarnath,

> Now I am able to deploy my DSL route. But this route needs an input from the user.

Your end-user won't use ServiceMix console, is she? :)

You need to collect the input from the UI of your choice (like web
application) and send it to the route via the message. For example:

CLIENT CODE:
String userSelection = ...
ProducerTemplate producerTemplate  = ...;
producerTemplate.sendBody("direct:input_from_ui",userSelection);

ROUTE DSL:
from("direct:input_from_ui").to("log:smx").to("bean:myBusinessCompomenent");

You might be interesting in further reading regarding Camel templates [1].

Best regards.

[1] http://camel.apache.org/producertemplate.html

--
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: ServiceMix deploying a camel route

Posted by Henryk Konsek <he...@gmail.com>.
> I defined the camel route in such a way that the end user will give user input through terminal !
> No web interface involved here !

But still exposing ServiceMix console as a UI is not a way to go. If
you want user to interact with system via command line, you should
consider creating dedicated console client which will handle user
interaction and send messages to the ServiceMix (via JMS for example).

--
Henryk Konsek
http://henryk-konsek.blogspot.com

RE: ServiceMix deploying a camel route

Posted by "AMARNATH, Balachandar" <BA...@airbus.com>.
Yep,

Thanks for the information. I defined the camel route in such a way that the end user will give user input through terminal ! No web interface involved here ! Anyway, I can always modify the structure.

With regards
Balachandar

-----Original Message-----
From: Henryk Konsek [mailto:hekonsek@gmail.com] 
Sent: 04 February 2013 22:29
To: users@servicemix.apache.org
Subject: Re: ServiceMix deploying a camel route

Hi Amarnath,

> Now I am able to deploy my DSL route. But this route needs an input from the user.

Your end-user won't use ServiceMix console, is she? :)

You need to collect the input from the UI of your choice (like web
application) and send it to the route via the message. For example:

CLIENT CODE:
String userSelection = ...
ProducerTemplate producerTemplate  = ...;
producerTemplate.sendBody("direct:input_from_ui",userSelection);

ROUTE DSL:
from("direct:input_from_ui").to("log:smx").to("bean:myBusinessCompomenent");

You might be interesting in further reading regarding Camel templates [1].

Best regards.

[1] http://camel.apache.org/producertemplate.html

--
Henryk Konsek
http://henryk-konsek.blogspot.com

This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.


RE: ServiceMix deploying a camel route

Posted by "AMARNATH, Balachandar" <BA...@airbus.com>.
Thanks Freeman,

Now I am able to deploy my DSL route. But this route needs an input from the user. Through, servicemix console I am not able to give any input as the console takes it as command and hence throws an error (command not found). Is it possible to give an input to the route through the console ?


With regards
Bala

-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com] 
Sent: 04 February 2013 11:08
To: users@servicemix.apache.org
Subject: Re: ServiceMix deploying a camel route

Hi,

You don't need have XML DSL, only java DSL should be fine. Do you have any problem with JAVA DSL only?
You probably need a bundle activator to start the route, or use way like 
    
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <package>your.java.dsl.package</package>
      </camelContext>
to let camel know where your java DSL is and launch it.

-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-2-4, at 下午1:21, AMARNATH, Balachandar wrote:

> Hi,
> 
> I am new to servicemix. I have a camel route written in JavaDSL using Routebuilder class, configure method.... I want to deploy this route into servicemix container. I tried sample examples comes with the servicemix bundle (camel-osgi and camel-blueprint) and seems they require a XML document in which route and beans are defined.  Is there a way to avoid the usage of these XMLs and with only using java DSL, deploy the route and interact with the route ?
> 
> With thanks and regards
> Balachandar
> 
> 
> 
> 
> The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
> If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
> Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
> All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
> 


This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.