Re: camel xmljson add @ signs to the json output. how to remove the @ signs

2014-11-18 Thread salemi
Hi Clause,

I looked at their json-lib code and based on what I read they need to have
the @ sign for the attributes and # for the text elements.
They need those "annotations" to be able to covert a json properly back to
xml. The @ and # signs are hard coded in their code.

Do you think I should asked to change the code?

Ali





-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013p5759220.html
Sent from the Camel - Users mailing list archive at Nabble.com.


dynamically add routes defined in DSL to a camel routes

2014-11-18 Thread salemi
Hi All,

is there a clean way to dynamically add routes defined in DSL to a running
CamelContext instance. The reason I need to do this because in the
production I don't want to turn of the Camel instance but be able to a new
routes and remove routes that are not needed. I would like to use DSL to
define the routes since it is much easier on business users.

Is there any solution for this out there?

Thanks,
Ali



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/dynamically-add-routes-defined-in-DSL-to-a-camel-routes-tp5759221.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel-Hive

2014-11-18 Thread smilevasu6
Hi Charles ,

Thanks for such a quick response.

I am able to connect to Hive from camel. I can see the Hive table data in my
eclipse console.

But the problem is, that data i want in a file.

22:58:17.081 [Camel (camel-1) thread #1 - timer://foo] DEBUG
org.apache.camel.processor.Pipeline - Message exchange has failed: so
breaking out of pipeline for exchange: Exchange[Message: [{bd_use_id=73.0,
bd_use_number=CUSE0073}, {bd_use_id=2.0, bd_use_number=CASU2},
{bd_use_id=379.0, bd_use_number=CUSE0379}, {bd_use_id=380.0,
bd_use_number=CUSE0380}, {bd_use_id=381.0, bd_use_number=CUSE0381},
{bd_use_id=263.0, bd_use_number=CUSE0263}, {bd_use_id=264.0,
bd_use_number=CUSE0264}, {bd_use_id=314.0, bd_use_number=CUSE0314},
{bd_use_id=326.0, bd_use_number=CUSE0326}, {bd_use_id=341.0,
bd_use_number=CUSE0341}, {bd_use_id=342.0, bd_use_number=CUSE0342},
{bd_use_id=348.0, bd_use_number=CUSE0348}, {bd_use_id=17.0,
bd_use_number=CUSE0017}, {bd_use_id=354.0, bd_use_number=CUSE0354},
{bd_use_id=357.0, bd_use_number=CUSE0357}, {bd_use_id=360.0,
bd_use_number=CUSE0360}, {bd_use_id=361.0, bd_use_number=CUSE0361},
{bd_use_id=362.0, bd_use_number=CUSE0362}, {bd_use_id=365.0,
bd_use_number=CUSE0365}, {bd_use_id=372.0, bd_use_number=CUSE0372},
{bd_use_id=382.0, bd_use_number=CUSE0382}, {bd_use_id=383.0,
bd_use_number=CUSE0383}, {bd_use_id=384.0, bd_use_number=CUSE0384},
{bd_use_id=18.0, ... [Body clipped after 1000 chars, total length is 17124]]
Exception: java.sql.SQLException: Method not supported
22:58:17.094 [Camel (camel-1) thread #1 - timer://foo] WARN 
o.a.c.component.timer.TimerConsumer - Error processing exchange.
Exchange[Message: [{bd_use_id=73.0, bd_use_number=CUSE0073}, {bd_use_id=2.0,
bd_use_number=CASU2}, {bd_use_id=379.0, bd_use_number=CUSE0379},
{bd_use_id=380.0, bd_use_number=CUSE0380}, {bd_use_id=381.0,
bd_use_number=CUSE0381}, {bd_use_id=263.0, bd_use_number=CUSE0263},
{bd_use_id=264.0, bd_use_number=CUSE0264}, {bd_use_id=314.0,
bd_use_number=CUSE0314}, {bd_use_id=326.0, bd_use_number=CUSE0326},
{bd_use_id=341.0, bd_use_number=CUSE0341}, {bd_use_id=342.0,
bd_use_number=CUSE0342}, {bd_use_id=348.0, bd_use_number=CUSE0348},
{bd_use_id=17.0, bd_use_number=CUSE0017}, {bd_use_id=354.0,
bd_use_number=CUSE0354}, {bd_use_id=357.0, bd_use_number=CUSE0357},
{bd_use_id=360.0, bd_use_number=CUSE0360}, {bd_use_id=361.0,
bd_use_number=CUSE0361}, {bd_use_id=362.0, bd_use_number=CUSE0362},
{bd_use_id=365.0, bd_use_number=CUSE0365}, {bd_use_id=372.0,
bd_use_number=CUSE0372}, {bd_use_id=382.0, bd_use_number=CUSE0382},
{bd_use_id=383.0, bd_use_number=CUSE0383}, {bd_use_id=384.0,
bd_use_number=CUSE0384}, {bd_use_id=18.0, ... [Body clipped after 1000
chars, total length is 17124]]. Caused by: [java.sql.SQLException - Method
not supported]
java.sql.SQLException: Method not supported
at org.apache.hive.jdbc.HiveConnection.commit(HiveConnection.java:508)
at
org.apache.camel.component.jdbc.JdbcProducer.processingSqlBySettingAutoCommit(JdbcProducer.java:85)
at
org.apache.camel.component.jdbc.JdbcProducer.process(JdbcProducer.java:66)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:113)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at
org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:166)
at
org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:74)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)


I am getting hive data as bd_use_id=73.0, bd_use_number=CUSE0073, but when i
try to copy the data in file, i am getting the above error, Method not
supported.

My Router is 

rom("timer://foo?period=6").
setBody(constant("select bd_use_id,bd_use_number from 
bd_users"))
.to("jdbc:fromdatasource")
.convertBodyTo(String.class)
   .to("file:/home/cloudera/Desktop/Sri")
  .end();  

Please help me. What to do?



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


Re: camel xmljson add @ signs to the json output. how to remove the @ signs

2014-11-18 Thread Claus Ibsen
Hi

Ah great to know it was hardcoded. I would suggest to ask them to add
an option so you can turn that off. As there are use cases where you
only need a one way transformation.

They could also consider different strategies how to control this
mapping. So there is a default strategy that does as today. And then
people can switch to different ones, such as one that simply dont
include those signs. And another that allow end users to provide their
own mapping code to have 100% control how they want to do that.

An alternative is that we introduce an option in the Camel component
but then it would need to process the output message and remove those
@ signs. But its IMHO better to improve this in the xmljson library
itself.

On Mon, Nov 17, 2014 at 9:10 PM, salemi  wrote:
> Hi Clause,
>
> I looked at their json-lib code and based on what I read they need to have
> the @ sign for the attributes and # for the text elements.
> They need those "annotations" to be able to covert a json properly back to
> xml. The @ and # signs are hard coded in their code.
>
> Do you think I should asked to change the code?
>
> Ali
>
>
>
>
>
> -
> Alireza Salemi
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013p5759220.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: dynamically add routes defined in DSL to a camel routes

2014-11-18 Thread Claus Ibsen
If you use the XML DSL you can
http://camel.apache.org/loading-routes-from-xml-files.html

For java its just the java api and there is methods on camel context
to add/remove routes.



On Mon, Nov 17, 2014 at 9:16 PM, salemi  wrote:
> Hi All,
>
> is there a clean way to dynamically add routes defined in DSL to a running
> CamelContext instance. The reason I need to do this because in the
> production I don't want to turn of the Camel instance but be able to a new
> routes and remove routes that are not needed. I would like to use DSL to
> define the routes since it is much easier on business users.
>
> Is there any solution for this out there?
>
> Thanks,
> Ali
>
>
>
> -
> Alireza Salemi
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/dynamically-add-routes-defined-in-DSL-to-a-camel-routes-tp5759221.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Camel-Hive

2014-11-18 Thread Claus Ibsen
Hi

>From the stacktrace it looks like its the jdbc component that fails.
Try set the option resetAutoCommit=false
http://camel.apache.org/jdbc

On Tue, Nov 18, 2014 at 8:25 AM, smilevasu6  wrote:
> Hi Charles ,
>
> Thanks for such a quick response.
>
> I am able to connect to Hive from camel. I can see the Hive table data in my
> eclipse console.
>
> But the problem is, that data i want in a file.
>
> 22:58:17.081 [Camel (camel-1) thread #1 - timer://foo] DEBUG
> org.apache.camel.processor.Pipeline - Message exchange has failed: so
> breaking out of pipeline for exchange: Exchange[Message: [{bd_use_id=73.0,
> bd_use_number=CUSE0073}, {bd_use_id=2.0, bd_use_number=CASU2},
> {bd_use_id=379.0, bd_use_number=CUSE0379}, {bd_use_id=380.0,
> bd_use_number=CUSE0380}, {bd_use_id=381.0, bd_use_number=CUSE0381},
> {bd_use_id=263.0, bd_use_number=CUSE0263}, {bd_use_id=264.0,
> bd_use_number=CUSE0264}, {bd_use_id=314.0, bd_use_number=CUSE0314},
> {bd_use_id=326.0, bd_use_number=CUSE0326}, {bd_use_id=341.0,
> bd_use_number=CUSE0341}, {bd_use_id=342.0, bd_use_number=CUSE0342},
> {bd_use_id=348.0, bd_use_number=CUSE0348}, {bd_use_id=17.0,
> bd_use_number=CUSE0017}, {bd_use_id=354.0, bd_use_number=CUSE0354},
> {bd_use_id=357.0, bd_use_number=CUSE0357}, {bd_use_id=360.0,
> bd_use_number=CUSE0360}, {bd_use_id=361.0, bd_use_number=CUSE0361},
> {bd_use_id=362.0, bd_use_number=CUSE0362}, {bd_use_id=365.0,
> bd_use_number=CUSE0365}, {bd_use_id=372.0, bd_use_number=CUSE0372},
> {bd_use_id=382.0, bd_use_number=CUSE0382}, {bd_use_id=383.0,
> bd_use_number=CUSE0383}, {bd_use_id=384.0, bd_use_number=CUSE0384},
> {bd_use_id=18.0, ... [Body clipped after 1000 chars, total length is 17124]]
> Exception: java.sql.SQLException: Method not supported
> 22:58:17.094 [Camel (camel-1) thread #1 - timer://foo] WARN
> o.a.c.component.timer.TimerConsumer - Error processing exchange.
> Exchange[Message: [{bd_use_id=73.0, bd_use_number=CUSE0073}, {bd_use_id=2.0,
> bd_use_number=CASU2}, {bd_use_id=379.0, bd_use_number=CUSE0379},
> {bd_use_id=380.0, bd_use_number=CUSE0380}, {bd_use_id=381.0,
> bd_use_number=CUSE0381}, {bd_use_id=263.0, bd_use_number=CUSE0263},
> {bd_use_id=264.0, bd_use_number=CUSE0264}, {bd_use_id=314.0,
> bd_use_number=CUSE0314}, {bd_use_id=326.0, bd_use_number=CUSE0326},
> {bd_use_id=341.0, bd_use_number=CUSE0341}, {bd_use_id=342.0,
> bd_use_number=CUSE0342}, {bd_use_id=348.0, bd_use_number=CUSE0348},
> {bd_use_id=17.0, bd_use_number=CUSE0017}, {bd_use_id=354.0,
> bd_use_number=CUSE0354}, {bd_use_id=357.0, bd_use_number=CUSE0357},
> {bd_use_id=360.0, bd_use_number=CUSE0360}, {bd_use_id=361.0,
> bd_use_number=CUSE0361}, {bd_use_id=362.0, bd_use_number=CUSE0362},
> {bd_use_id=365.0, bd_use_number=CUSE0365}, {bd_use_id=372.0,
> bd_use_number=CUSE0372}, {bd_use_id=382.0, bd_use_number=CUSE0382},
> {bd_use_id=383.0, bd_use_number=CUSE0383}, {bd_use_id=384.0,
> bd_use_number=CUSE0384}, {bd_use_id=18.0, ... [Body clipped after 1000
> chars, total length is 17124]]. Caused by: [java.sql.SQLException - Method
> not supported]
> java.sql.SQLException: Method not supported
> at org.apache.hive.jdbc.HiveConnection.commit(HiveConnection.java:508)
> at
> org.apache.camel.component.jdbc.JdbcProducer.processingSqlBySettingAutoCommit(JdbcProducer.java:85)
> at
> org.apache.camel.component.jdbc.JdbcProducer.process(JdbcProducer.java:66)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:113)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:166)
> at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:74)
> at java.util.TimerThread.mainLoop(Timer.java:555)
> at java.util.TimerThread.run(Timer.java:505)
>
>
> I am getting hive data as bd_use_id=73.0, bd_use_number=CUSE0073, but when i
> try to copy the data in file, i am getting the above error, Method not
> supported.
>
> My Router is
>
> rom("timer://foo?period=6").
> setBody(constant("select bd_use_id,bd_use_number from 
> bd_users"))
> .to("jdbc:fromdatasource")
> .convertBodyTo(String.class)
>.to("file:/home/cloudera/Desktop/Sri")
>   

Re: CXF webservice deployment on glassfish

2014-11-18 Thread Willem Jiang
It looks CXF doesn’t follow the @PostConstruct instruction[1].

[1]https://docs.oracle.com/javaee/7/api/javax/annotation/PostConstruct.html


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 15, 2014 at 1:41:03 AM, sab12in (sab1...@yahoo.co.in) wrote:
> Hi,
>  
> I have both cxf-rt-transports-http,cxf-rt-transports-http-jetty jar and now
> i get the following exception.
>  
>  
>  
> Exception while deploying the app [camel-example-reportincident-2.14.0] :
> The lifecycle method [finalizeConfig] must not throw a checked exception.
> Related annotation information: annotation
> [@javax.annotation.PostConstruct()] on annotated element [public void
> org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.finalizeConfig()  
> throws java.security.GeneralSecurityException,java.io.IOException] of type  
> [METHOD]. Please see server.log for more details.
> Thanks and Regards,
> Sabyasachi
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/CXF-webservice-deployment-on-glassfish-tp5758405p5759153.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



camel cxf convert comma separated string to one parameter - how to escape comma

2014-11-18 Thread dermoritz
I want to send a comma separated string to simple web service (cxf based).
Without comma all works fine. Camel's type converters and magic take the
string and find the only method that takes a string in wsdl and generate the
xml (the wsdl has only one method at all). If i send a comma separated
string i get an error because the type converter or something else
interprets the string as multiple parameters and no method matches.

Is there a way to supress or escape the ',' to let camel use it as single
parameter?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cxf-convert-comma-separated-string-to-one-parameter-how-to-escape-comma-tp5759243.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel-Hive

2014-11-18 Thread smilevasu6
Thank you so much Claus Ibsen, its working.

Now we can connect to hive using camel



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


Re: Servlet Component with REST DSL: problem in URI query string construction?

2014-11-18 Thread Rodney van Luinen
Thanks Willem,

I did try a search in Jira, when I followed the link you provided it's no
surprise I didn't find the issue since I was searching on all the wrong
terms! :-)

I had things like servlet query string rest dsl, none of which matched.
Remedial search school for me I guess ;-)
In terms of how I can bring this fix into my application, is there a point
release I can declare in maven? That is, 2.14.1 or similar? I am unable to
use a SNAPSHOT release or a custom patched version in my application for
policy reasons. If it's not possible then no problem I can work around it
in the short term.

Thanks again.

Regards,
Rod.

On 18 November 2014 17:52, Willem Jiang  wrote:

> It’s a bug of Camel[1] which has been fixed few weeks ago.
>
> [1]https://issues.apache.org/jira/browse/CAMEL-7971
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
> On November 18, 2014 at 11:32:30 AM, rvanluinen (rvanlui...@gmail.com)
> wrote:
> > I have been experimenting with Camel 2.14.0 and the REST DSL using the
> > servlet component.
> > I have followed the code in the example, however for reasons of my own
> I'd
> > like to use a different servlet name than the default of CamelServlet.
> This
> > works fine with vanilla servlet:/// URIs - add ?servletName=my-servlet
> and
> > all is good.
> >
> > To do this with the REST DSL I use the following:
> >
> > restConfiguration().component("servlet").endpointProperty("servletName",
> > "my-servlet");
> > rest("/rest").post().otherDSLStatements;
> >
> > Contrary to what I thought, endpointProperty and not componentProperty
> sees
> > this property added to the URI.
> >
> > The problem is, it doesn't work.
> > I stepped through the code and it appears the problem is that the URI
> that
> > gets constructed for my post prior to being turned into a rest:// URI
> looks
> > something like:
> > servlet:///rest?httpMethodRestrict=POST?servletName=my-servlet.
> >
> > Which doesn't get correctly parsed by URISupport.parseQuery() since it
> > doesn't separate the second key/value pair using an ampersand ('&') as
> you
> > might expect.
> >
> > The code from ServletComponent looks like this (lines 194-197):
> >
> > String url = "servlet:///%s?httpMethodRestrict=%s";
> > if (!query.isEmpty()) {
> > url = url + "?" + query;
> > }
> >
> > I can also confirm that using the debugger and changing the second '?' to
> > '&' results in the behaviour that I'd expect to see, which is that
> > my-servlet actually handles the request.
> >
> > I don't think I'm doing anything screwy here, can anyone else confirm
> > they've had similar problems or not? I think it's a bug but following
> > etiquette I'm posting here first and not raising issues in Jira
> immediately.
> >
> > Regards,
> > Rod
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Servlet-Component-with-REST-DSL-problem-in-URI-query-string-construction-tp5759228.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>


After using in XML DSL, my email body includes unwanted route metadata

2014-11-18 Thread fidoedidoe
Hi I'm new to camel, so forgive me for asking (more?) dumb question(s). With
help from this forum I've created a Multicast route, that emails
recipient(s) on completion. just baby steps for now..the logic / complexity
will expand as my understanding increases. 

In my real code (not the pseudo below) I'm successfully routing / delivering
a completion email *but* the body of the email contains what I'm describing
as additional route metadata outside of the text I'm setting using 
Any suggestions on what I'm overlooking / how to suppress the email body
items such as: "CamelFileLength", etc

Code:



Received Email body:



Many thanks! 



--
View this message in context: 
http://camel.465427.n5.nabble.com/After-using-setBody-in-XML-DSL-my-email-body-includes-unwanted-route-metadata-tp5759245.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: After using in XML DSL, my email body includes unwanted route metadata

2014-11-18 Thread Claus Ibsen
Hi

Is the uri of the smtp endpoint correct? In the code you use ? to
separate parameters, but you should use & which should be escaped in
xml, eg &

On Tue, Nov 18, 2014 at 11:47 AM, fidoedidoe  wrote:
> Hi I'm new to camel, so forgive me for asking (more?) dumb question(s). With
> help from this forum I've created a Multicast route, that emails
> recipient(s) on completion. just baby steps for now..the logic / complexity
> will expand as my understanding increases.
>
> In my real code (not the pseudo below) I'm successfully routing / delivering
> a completion email *but* the body of the email contains what I'm describing
> as additional route metadata outside of the text I'm setting using 
> Any suggestions on what I'm overlooking / how to suppress the email body
> items such as: "CamelFileLength", etc
>
> Code:
>
>
>
> Received Email body:
>
>
>
> Many thanks!
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/After-using-setBody-in-XML-DSL-my-email-body-includes-unwanted-route-metadata-tp5759245.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: After using in XML DSL, my email body includes unwanted route metadata

2014-11-18 Thread fidoedidoe
Hi Claus

Good spot - that's an honest typo in my pseudo, my apologies, I've corrected
the original post. My actual code escapes & as suggested. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/After-using-setBody-in-XML-DSL-my-email-body-includes-unwanted-route-metadata-tp5759245p5759247.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: After using in XML DSL, my email body includes unwanted route metadata

2014-11-18 Thread fidoedidoe
I think I've found the answered my own question. The additional metadata is
(exchange?) header information, which can be cleared from the body using
. 

The final (pseudo) ends up looking like this: 





--
View this message in context: 
http://camel.465427.n5.nabble.com/After-using-setBody-in-XML-DSL-my-email-body-includes-unwanted-route-metadata-tp5759245p5759248.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Servlet Component with REST DSL: problem in URI query string construction?

2014-11-18 Thread Willem Jiang
I’m afraid you have to wait for the release of Camel 2.14.1 which will be 
released in next month.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 18, 2014 at 5:48:56 PM, Rodney van Luinen (rvanlui...@gmail.com) 
wrote:
> Thanks Willem,
>  
> I did try a search in Jira, when I followed the link you provided it's no
> surprise I didn't find the issue since I was searching on all the wrong
> terms! :-)
>  
> I had things like servlet query string rest dsl, none of which matched.
> Remedial search school for me I guess ;-)
> In terms of how I can bring this fix into my application, is there a point
> release I can declare in maven? That is, 2.14.1 or similar? I am unable to
> use a SNAPSHOT release or a custom patched version in my application for
> policy reasons. If it's not possible then no problem I can work around it
> in the short term.
>  
> Thanks again.
>  
> Regards,
> Rod.
>  
> On 18 November 2014 17:52, Willem Jiang wrote:
>  
> > It’s a bug of Camel[1] which has been fixed few weeks ago.
> >
> > [1]https://issues.apache.org/jira/browse/CAMEL-7971
> >
> > --
> > Willem Jiang
> >
> > Red Hat, Inc.
> > Web: http://www.redhat.com
> > Blog: http://willemjiang.blogspot.com (English)
> > http://jnn.iteye.com (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> >
> >
> > On November 18, 2014 at 11:32:30 AM, rvanluinen (rvanlui...@gmail.com)
> > wrote:
> > > I have been experimenting with Camel 2.14.0 and the REST DSL using the
> > > servlet component.
> > > I have followed the code in the example, however for reasons of my own
> > I'd
> > > like to use a different servlet name than the default of CamelServlet.
> > This
> > > works fine with vanilla servlet:/// URIs - add ?servletName=my-servlet
> > and
> > > all is good.
> > >
> > > To do this with the REST DSL I use the following:
> > >
> > > restConfiguration().component("servlet").endpointProperty("servletName",  
> > > "my-servlet");
> > > rest("/rest").post().otherDSLStatements;
> > >
> > > Contrary to what I thought, endpointProperty and not componentProperty
> > sees
> > > this property added to the URI.
> > >
> > > The problem is, it doesn't work.
> > > I stepped through the code and it appears the problem is that the URI
> > that
> > > gets constructed for my post prior to being turned into a rest:// URI
> > looks
> > > something like:
> > > servlet:///rest?httpMethodRestrict=POST?servletName=my-servlet.
> > >
> > > Which doesn't get correctly parsed by URISupport.parseQuery() since it
> > > doesn't separate the second key/value pair using an ampersand ('&') as
> > you
> > > might expect.
> > >
> > > The code from ServletComponent looks like this (lines 194-197):
> > >
> > > String url = "servlet:///%s?httpMethodRestrict=%s";
> > > if (!query.isEmpty()) {
> > > url = url + "?" + query;
> > > }
> > >
> > > I can also confirm that using the debugger and changing the second '?' to
> > > '&' results in the behaviour that I'd expect to see, which is that
> > > my-servlet actually handles the request.
> > >
> > > I don't think I'm doing anything screwy here, can anyone else confirm
> > > they've had similar problems or not? I think it's a bug but following
> > > etiquette I'm posting here first and not raising issues in Jira
> > immediately.
> > >
> > > Regards,
> > > Rod
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > http://camel.465427.n5.nabble.com/Servlet-Component-with-REST-DSL-problem-in-URI-query-string-construction-tp5759228.html
> >   
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
>  



Re: camel cxf convert comma separated string to one parameter - how to escape comma

2014-11-18 Thread Willem Jiang
You may need to put the String parameter into Object array to avoid the type 
converter misfire. 

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 18, 2014 at 4:55:44 PM, dermoritz (tantea...@hotmail.com) wrote:
> I want to send a comma separated string to simple web service (cxf based).
> Without comma all works fine. Camel's type converters and magic take the
> string and find the only method that takes a string in wsdl and generate the
> xml (the wsdl has only one method at all). If i send a comma separated
> string i get an error because the type converter or something else
> interprets the string as multiple parameters and no method matches.
>  
> Is there a way to supress or escape the ',' to let camel use it as single
> parameter?
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-cxf-convert-comma-separated-string-to-one-parameter-how-to-escape-comma-tp5759243.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Camel webservice sample Error

2014-11-18 Thread dharshan
Hi

I am trying to execute sample camel-example-spring-ws but is giving error as
below 
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
36 in XML document from ServletContext resource
[/WEB-INF/spring-ws-servlet.xml
2: Attribute 'local' is not allowed to appear in element 'ref'.
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
at
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:532)
at
org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
at
org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
at
org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:298)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:282)
at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at
org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:520)
at
org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:365)
at
org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:523)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder

Simple email forward route

2014-11-18 Thread A.Light
Hi all,
I'm going to post a question that has already been posted  here
  
and  here

 
, without resolution. Since the previous posts are 1 or 2 years old, I
thought the better thing was to make a new post. We can then point those
posts to here if we get a solution.

Said that, I'm trying to implement a complex route that involves reading and
writing emails, but I'm getting consistently a "Missing start boundary"
exception for which I'm asking for help here. After stripping out from the
route everything not related to the exception, I ended up with this simple
spring route:

  

recei...@foodomain.com
forwar...@foodomain.com

  

My camel version is 2.14.0, java is 1.7. 
Here is the email writeTo format, as taken from
MimeMultipart.writeTo(FileOutputStream):  emailWriteTo.txt
  
Here is the stacktrace of the error:  Stacktrace02.txt
  

What is causing the exception?
Let me know if there's anything else I can provide to help identify the
problem which most surely is somewhere in my configuration.

Thanks for any suggestion,
A.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Simple-email-forward-route-tp5759253.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Tail like File component?

2014-11-18 Thread Gonzalo Vasquez
Thanks David, I'll read about it

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
+56 2 335 2461
gvasq...@altiuz.cl
http://www.altiuz.cl
http://www.altiuzreports.com
  


El 17-11-2014, a las 17:34, David Karlsen  escribió:

> You can try the stream component:
> http://camel.apache.org/stream.html
> 
> 2014-11-17 21:32 GMT+01:00 Gonzalo Vasquez :
> 
>> Hi everybody.
>> 
>> Is it possible to use the File component (or other component) as a
>> consumer to mimic unix 'tai'l command? What I mean is: monitor a folder /
>> file and do something on each new line added to such fileI guess the
>> streaming option would help, but not sure on how to keep the File always
>> open and not to end on the last available line, also I'm wondering on how
>> to signal a file end or something like that.
>> 
>> Regards,
>> Gonzalo Vásquez Sáez
>> Gerente Investigación y Desarrollo (R&D)
>> Altiuz Soluciones Tecnológicas de Negocios Ltda.
>> Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
>> +56 2 335 2461
>> gvasq...@altiuz.cl
>> http://www.altiuz.cl
>> http://www.altiuzreports.com
>> 
>> 
>> 
>> 
> 
> 
> -- 
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen



Re: Camel webservice sample Error

2014-11-18 Thread Willem Jiang
Which version of camel were you using?
Did you try the latest release one  — Camel 2.14.0?

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 18, 2014 at 7:45:11 PM, dharshan (cdharsh...@gmail.com) wrote:
> Hi
>  
> I am trying to execute sample camel-example-spring-ws but is giving error as
> below
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line  
> 36 in XML document from ServletContext resource
> [/WEB-INF/spring-ws-servlet.xml
> 2: Attribute 'local' is not allowed to appear in element 'ref'.
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>   
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
>   
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
>   
> at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
>   
> at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
>   
> at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
>   
> at
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
>   
> at
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
>   
> at
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
>   
> at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
>   
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
>   
> at
> org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
>   
> at
> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
>   
> at
> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
>   
> at
> org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
>   
> at
> org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
>   
> at
> org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
>   
> at javax.servlet.GenericServlet.init(GenericServlet.java:244)
> at
> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:532)  
> at
> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)  
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>   
> at
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)  
> at
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
>   
> at
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)  
> at
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
>   
> at
> org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
> at
> org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:298)
>   
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>   
> at
> org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
>   
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
>   
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>   
> at
> org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
>   
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>   
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
>   
> at org.eclipse.jetty.server.Server.doStart(Server.java:282)
> at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>   
> at
> org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:520)
>   
> at
> org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:365)
>   
> at
> org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:523)
> at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
>   
> at
> org.apa

Re: camel cxf convert comma separated string to one parameter - how to escape comma

2014-11-18 Thread dermoritz
Thanks this is working! List is working too, i use
Arrays.asList("one,parameter").

In meanwhile i tried to send the real payload object (used the generated
code), this is working on another CxfProducer in our project (no data mode
set!). 
But in this case camel tries to convert the xml-object back to a string and
i get exception. Here i have to explicitly set DataFormat to Cxf_Message?

So why in one case i could send "native payload" objects to cxf producer
without setting data mode (should be pojo by default) and in another case i
have to explicitly set data mode?




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cxf-convert-comma-separated-string-to-one-parameter-how-to-escape-comma-tp5759243p5759257.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-hbase dependency inconsistency

2014-11-18 Thread Mark Webb
Sorry for the cross-post, I'm not sure if this is a ServiceMix or Camel
problem.

I am working on some data routes that will push data to HBase within
ServiceMix.  My development environment depends on Apache Camel 2.13.2,
specifically the camel-hbase component version 2.13.2 depends on avro
1.5.3.  This is according to the dependency hierarchy that maven provides.
I only have camel-base version 2.13.2 listed in my pom.xml and maven pulls
in the dependencies.  I'm not specifically including avro.

When I deploy the camel-hbase feature in ServiceMix 5.1.2 I get an error
saying that I must deploy avro  >= 1.7.7.  So it seems like the same
version of the camel-hbase component relies on 2 different versions of
avro: 1.5.3 for development and 1.7.7 for deployment within ServiceMix.

Is there any way to fix this problem?

Thanks,
Mark


direct-vm in OSGI - how to handle context updates?

2014-11-18 Thread Thomas Weinschenk
Hi folks,

I am using direct-vm to link different camel contexts (environment is Karaf
2.3.3 and Camel 2.12.2).
Everything works fine until I update one of the routes acting as the
direct-vm cosumer. This leads to 'No consumers available ...' exceptions.
The problems seems to be the fact, that the consumer must be started before
the producer. But even when I try to restart the routes it might not work.

Here is an example...

Camel Context 1
/


/

Camel Context 2
/


/

Camel Context 3
/


/

E.g. in Karaf, drop them in the deploy folder and it works. But as soon as
you change one of the files...your lost ;)

Any idea how I can handle updates on direct-vm 'chained' context/routes?

Regards,
Thomas



--
View this message in context: 
http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: direct-vm in OSGI - how to handle context updates?

2014-11-18 Thread Claus Ibsen
Hi

You can use the block option to allow some time to wait for the update
to be complete.

On Tue, Nov 18, 2014 at 3:36 PM, Thomas Weinschenk
 wrote:
> Hi folks,
>
> I am using direct-vm to link different camel contexts (environment is Karaf
> 2.3.3 and Camel 2.12.2).
> Everything works fine until I update one of the routes acting as the
> direct-vm cosumer. This leads to 'No consumers available ...' exceptions.
> The problems seems to be the fact, that the consumer must be started before
> the producer. But even when I try to restart the routes it might not work.
>
> Here is an example...
>
> Camel Context 1
> /
> 
> 
> /
>
> Camel Context 2
> /
> 
> 
> /
>
> Camel Context 3
> /
> 
> 
> /
>
> E.g. in Karaf, drop them in the deploy folder and it works. But as soon as
> you change one of the files...your lost ;)
>
> Any idea how I can handle updates on direct-vm 'chained' context/routes?
>
> Regards,
> Thomas
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: direct-vm in OSGI - how to handle context updates?

2014-11-18 Thread Thomas Weinschenk
Hi Claus,

Thank you for your answer. If I add a block it works. But I need the
refresh/restart the context in the correct order. In my example route1,
route2 and then route3.

This works if I do it manually but I have no glue how this could work
automatically in production. I deploy and update the files dynamically. 

Regards,
Thomas



--
View this message in context: 
http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759266.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to propagate the HTTP response headers from the Camel route to the cxfrs:bean

2014-11-18 Thread Ton Swieb
Hi,

I am using CXFRS bean in combination with Camel and I would like to set a
custom HTTP response from within the Camel route, but without making my own
CXF Response object.

I have a route like:
from("cxfrs:bean:restService?binding=#cxfrsBinding")
.setHeader(HttpHeaders.CONTENT_LANGUAGE,constant("EN"))

The HTTP response generated by CXFRS does not contain the custom header.

I tried to set a custom HeaderFilterStrategy based on
CxfRsHeaderFilterStrategy:
public class HeaderFilterStrategy extends CxfRsHeaderFilterStrategy {

@Override
protected void initialize() {
super.initialize();
getInFilter().add(HttpHeaders.CONTENT_LANGUAGE);
getOutFilter().add(HttpHeaders.CONTENT_LANGUAGE);
}
}

and supplied it to CXF-RS using the default CXFRS binding:




But that didn't work.

Any ideas how to get this working without using a CXF Response object?
I am using Camel 2.10.0.redhat-60024 and CXF 2.6.0.redhat-60024

Regards,

Ton


Re: Simple email forward route

2014-11-18 Thread Paul McCulloch
You may be able to work around this (which may hide a real underlying
problem!) with -Dmail.mime.multipart.allowempty=true

On 18 November 2014 12:21, A.Light  wrote:

> Hi all,
> I'm going to post a question that has already been posted  here
> 
> and  here
> <
> http://camel.465427.n5.nabble.com/Missing-start-boundary-exception-on-camel-mail-2-10-2-td5724769.html
> >
> , without resolution. Since the previous posts are 1 or 2 years old, I
> thought the better thing was to make a new post. We can then point those
> posts to here if we get a solution.
>
> Said that, I'm trying to implement a complex route that involves reading
> and
> writing emails, but I'm getting consistently a "Missing start boundary"
> exception for which I'm asking for help here. After stripping out from the
> route everything not related to the exception, I ended up with this simple
> spring route:
>
>   
>  uri="imap://mailserver:143?username=recei...@foodomain.com
> &password=xx&consumer.delay=1000"/>
>  headerName="from">recei...@foodomain.com
>  headerName="to">forwar...@foodomain.com
> 
>   
>
> My camel version is 2.14.0, java is 1.7.
> Here is the email writeTo format, as taken from
> MimeMultipart.writeTo(FileOutputStream):  emailWriteTo.txt
> 
> Here is the stacktrace of the error:  Stacktrace02.txt
> 
>
> What is causing the exception?
> Let me know if there's anything else I can provide to help identify the
> problem which most surely is somewhere in my configuration.
>
> Thanks for any suggestion,
> A.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Simple-email-forward-route-tp5759253.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: direct-vm in OSGI - how to handle context updates?

2014-11-18 Thread Claus Ibsen
Hi

The deploy folder is not as good to use. So if you want to refresh in
specific order, then copy the files in the given order, but make sure
to have delay between to give time to pickup the files one by one.

I am not sure if the felix fileinstall sorts the files first or
something when it scans the deploy folder. You can ask on karaf
mailing list or dive into the codebase to see what the code does.



On Tue, Nov 18, 2014 at 4:08 PM, Thomas Weinschenk
 wrote:
> Hi Claus,
>
> Thank you for your answer. If I add a block it works. But I need the
> refresh/restart the context in the correct order. In my example route1,
> route2 and then route3.
>
> This works if I do it manually but I have no glue how this could work
> automatically in production. I deploy and update the files dynamically.
>
> Regards,
> Thomas
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-how-to-handle-context-updates-tp5759259p5759266.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: camel-hbase dependency inconsistency

2014-11-18 Thread Filippo Balicchia
Hi Mark,
did you try servicemix 5.14 to check if with camel 2.13.3
the problem is resolved ?

Regards

--Filippo

2014-11-18 15:09 GMT+01:00 Mark Webb :
> Sorry for the cross-post, I'm not sure if this is a ServiceMix or Camel
> problem.
>
> I am working on some data routes that will push data to HBase within
> ServiceMix.  My development environment depends on Apache Camel 2.13.2,
> specifically the camel-hbase component version 2.13.2 depends on avro
> 1.5.3.  This is according to the dependency hierarchy that maven provides.
> I only have camel-base version 2.13.2 listed in my pom.xml and maven pulls
> in the dependencies.  I'm not specifically including avro.
>
> When I deploy the camel-hbase feature in ServiceMix 5.1.2 I get an error
> saying that I must deploy avro  >= 1.7.7.  So it seems like the same
> version of the camel-hbase component relies on 2 different versions of
> avro: 1.5.3 for development and 1.7.7 for deployment within ServiceMix.
>
> Is there any way to fix this problem?
>
> Thanks,
> Mark


Re: camel-hbase dependency inconsistency

2014-11-18 Thread Sobkowiak, Krzysztof
Hi Mark

There was a problem with camel-avro included in ServiceMix 5.1.2
(https://issues.apache.org/jira/browse/CAMEL-7655). The same problem
probably was for camel-hbase as it uses avro too. ServiceMix 5.1.4
includes the Camel version which fixes this problem. You should use the
new version.

But there is another known problem
(https://issues.apache.org/jira/browse/SM-2323) with freeze while
refreshing some bundles. I have tested installation of camel-hbase on
5.1.4 and I had this problem. You should add camel-hbase at the end of
featuresBoot in org.apache.karaf.features.cfg to solve this problem.
This problem will not occur in ServiceMix 5.3.x and later based on Karaf
2.4.x or Karaf 3.0.x

If you still need to use ServiceMix 5.1.2 ther is a workaround described
here
https://issues.apache.org/jira/browse/SM-2346?focusedCommentId=14083772&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14083772

I hope it helps to solve you problem

Regards
Krzysztof




On 18-Nov-2014 15:09, Mark Webb wrote:
> Sorry for the cross-post, I'm not sure if this is a ServiceMix or Camel
> problem.
>
> I am working on some data routes that will push data to HBase within
> ServiceMix.  My development environment depends on Apache Camel 2.13.2,
> specifically the camel-hbase component version 2.13.2 depends on avro
> 1.5.3.  This is according to the dependency hierarchy that maven provides.
> I only have camel-base version 2.13.2 listed in my pom.xml and maven pulls
> in the dependencies.  I'm not specifically including avro.
>
> When I deploy the camel-hbase feature in ServiceMix 5.1.2 I get an error
> saying that I must deploy avro  >= 1.7.7.  So it seems like the same
> version of the camel-hbase component relies on 2 different versions of
> avro: 1.5.3 for development and 1.7.7 for deployment within ServiceMix.
>
> Is there any way to fix this problem?
>
> Thanks,
> Mark
>

-- 
Krzysztof Sobkowiak

JEE & OSS Architect | Technical Architect @ Capgemini | Committer @ ASF
Capgemini  | Software Solutions Center
 | Wroclaw
e-mail: krzys.sobkow...@gmail.com  |
Twitter: @KSobkowiak
Calendar: http://goo.gl/yvsebC


Multiple property placeholders?

2014-11-18 Thread Gary Kennedy
I'm using Camel 2.14.0, with Karaf 3.0.1, and in the blueprint I have a couple 
of property 'bags'.

One is the usual configuration admin property placeholder, the other is a 
custom property bag, which gets it's values from runtime scanning.

How can I use both property sets in the same camel context?

I've tried multiple propertyPlaceholder tags (schema violation), and I'm 
looking at setting locations on the properties component (by creating a 
properties component bean) but I'm not too sure that will either work, or be 
"the way to go".

Any ideas please?

Cheers,
Gary



How to get Spring System Environment variables in camel properties

2014-11-18 Thread harmohan.singh
i want to pass environment variables (O/S environment variables) to camel
routes. something like,

 

similar to how the values are set for configuring properties location:
location=file:${env:APP_HOME}/etc/foo.properties

but, since that doesnt work. i thought of using spring systemEnvironment to
get the value:
#{systemEnvironment['shouldIStart']}  like
{{systemEnvironment['shouldIStart']}}
but it looks like the syntax {{}} is only configured with ${} and not #{}

is there another way to pass the env variables to routes



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-get-Spring-System-Environment-variables-in-camel-properties-tp5759281.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multiple property placeholders?

2014-11-18 Thread Gary Kennedy
Urgh, I'm stupid.

 

And I don't even have to explicitly state the configuration admin properties.

Cheers,
Gary

On 19 Nov 2014, at 11:29 am, Gary Kennedy  wrote:

> I'm using Camel 2.14.0, with Karaf 3.0.1, and in the blueprint I have a 
> couple of property 'bags'.
> 
> One is the usual configuration admin property placeholder, the other is a 
> custom property bag, which gets it's values from runtime scanning.
> 
> How can I use both property sets in the same camel context?
> 
> I've tried multiple propertyPlaceholder tags (schema violation), and I'm 
> looking at setting locations on the properties component (by creating a 
> properties component bean) but I'm not too sure that will either work, or be 
> "the way to go".
> 
> Any ideas please?
> 
> Cheers,
> Gary
> 



Re: How to get Spring System Environment variables in camel properties

2014-11-18 Thread harmohan.singh
Work around: 
set jvm variable from environment variable

so, my config was
-DshoudIStart=${shoudIStart}






--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-get-Spring-System-Environment-variables-in-camel-properties-tp5759281p5759283.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Temporary queues, or, jms uri from camel uri?

2014-11-18 Thread Gary Kennedy
So I want to talk to a system that will send back several reply messages for a 
given command message.

The general idea is to have a specific route that will process the reply 
messages. (maybe behind an aggregator/resequencer, maybe not)

Since the plan is to (eventually) use this in a production environment, I want 
to use a temporary queue for the replies rather than a shared queue.

The basic template at the moment:


< !-- magic here -- >
< !-- prep a command message -- >
< !-- now to send the command message -- >






< !-- more magic -- >


So the main question is how can I get {{temp-queue}} to expand to the JMS 
specific uri of the Camel uri "jms:temp:queue:client-replies"?

But if anyone knows how to deal with temporary queues other solutions would be 
welcome. :)

Cheers,
Gary



Re: Camel-Hive

2014-11-18 Thread smilevasu6
Hi,

Again there is problem with camel hive.

As i am able to connect to hive and able fetch the data from hive table.

Now i want to load the data in another hive table.

when i try to do the same some times i am getting invalid path and some
times there is no errors but data is not moving to target hive table.

Please help me

Here is my router,

from("timer://foo?period=6").

setBody(constant("select * from default.emp where 
salary > 5000"))
.to("jdbc:fromdatasource?resetAutoCommit=false")
.convertBodyTo(String.class)
.to("file:/home/cloudera/Desktop/Sri")
.end();

from("file:/home/cloudera/Desktop/Sri").
setBody(constant("LOAD DATA LOCAL INPATH 
'/home/cloudera/Desktop/Sri'
OVERWRITE INTO TABLE default.emp_h"))
.to("jdbc:todatasource?resetAutoCommit=false")
.convertBodyTo(String.class)
.end();



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


Re: dynamically add routes defined in DSL to a camel routes

2014-11-18 Thread salemi
Hi Claus,
thank you for your respond. I used the code but is shows as deprecated. Is
there a new way to do the loading of new routes from XML file?

Thanks,
Ali



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/dynamically-add-routes-defined-in-DSL-to-a-camel-routes-tp5759221p5759277.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel webservice sample Error

2014-11-18 Thread dharshan
Yes i have added latest version its working finw thanks lot



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-webservice-sample-Error-tp5759250p5759272.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Polling consumer from Aggregator

2014-11-18 Thread shishya
Hi,

I am creating an elasticsearch component.
I would like to aggregate individual requests in to a bulk request with 1000
entries. Since I do not know if elasticsearch is available, I would like for
the component to poll the aggregator at regular intervals, when the
elasticsearch is available. 
Is it possible to do this with aggregator or am I doing something
fundamentally wrong?

Regards,
Shishya



-
Thanks,
Sri
--
View this message in context: 
http://camel.465427.n5.nabble.com/Polling-consumer-from-Aggregator-tp5759275.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: dynamically add routes defined in DSL to a camel routes

2014-11-18 Thread salemi
great. thank you.



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/dynamically-add-routes-defined-in-DSL-to-a-camel-routes-tp5759221p5759273.html
Sent from the Camel - Users mailing list archive at Nabble.com.


weather endpoint throws exception

2014-11-18 Thread salemi
Hi,

I am using the weather endpoint 



and it throws the following error. Any idea why?

Thanks,
Ali

11:06:11.423 [main] INFO  org.apache.camel.main.MainSupport - [S:]Apache
Camel 2.14.0 stopping
org.apache.camel.TypeConversionException: Error during type conversion from
type: java.net.URL to the required type: java.lang.String with value
http://freegeoip.net/json/ due java.io.FileNotFoundException:
http://freegeoip.net/json/
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:566)
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:174)
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:150)
at
org.apache.camel.component.weather.WeatherConfiguration.getCurrentGeoLocation(WeatherConfiguration.java:155)
at
org.apache.camel.component.weather.WeatherConfiguration.getQuery(WeatherConfiguration.java:129)
at
org.apache.camel.component.weather.WeatherConfiguration.getQuery(WeatherConfiguration.java:120)
at
org.apache.camel.component.weather.WeatherEndpoint.createConsumer(WeatherEndpoint.java:39)
at
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
at
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:80)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:134)
at
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:2379)
at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2309)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2091)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1951)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1777)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1745)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:254)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:950)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:217)
at org.apache.camel.spring.Main.doStart(Main.java:157)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:149)
at org.apache.camel.main.MainSupport.run(MainSupport.java:353)
at org.apache.camel.spring.Main.main(Main.java:90)
Caused by: org.apache.camel.RuntimeCamelException:
java.io.FileNotFoundException: http://freegeoip.net/json/
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
at 
org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1006)
at
org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:276)
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:165)
... 30 more
Caused by: java.io.FileNotFoundException: http://freegeoip.net/json/
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1623)
at java.net.URL.openStream(URL.java:1037)
at
org.apache.camel.converter.IOConverter.toInputStream(IOConverter.java:69)
at org.apache.camel.converter.IOConverter.toString(IOConverter.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.l

Re: Camel webservice sample Error

2014-11-18 Thread dharshan
I will check and let you know as soon as posible.

On Tue, Nov 18, 2014 at 6:18 PM, Willem.Jiang [via Camel] <
ml-node+s465427n575925...@n5.nabble.com> wrote:

> Which version of camel were you using?
> Did you try the latest release one  — Camel 2.14.0?
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
> On November 18, 2014 at 7:45:11 PM, dharshan ([hidden email]
> ) wrote:
>
> > Hi
> >
> > I am trying to execute sample camel-example-spring-ws but is giving
> error as
> > below
> > org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> Line
> > 36 in XML document from ServletContext resource
> > [/WEB-INF/spring-ws-servlet.xml
> > 2: Attribute 'local' is not allowed to appear in element 'ref'.
> > at
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>
> > at
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
>
> > at
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
>
> > at
> >
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
>
> > at
> >
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
>
> > at
> >
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
>
> > at
> >
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
>
> > at
> >
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
>
> > at
> >
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
>
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
>
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
>
> > at
> >
> org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
>
> > at
> >
> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
>
> > at
> >
> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
>
> > at
> >
> org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
>
> > at
> >
> org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
>
> > at
> >
> org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
>
> > at javax.servlet.GenericServlet.init(GenericServlet.java:244)
> > at
> >
> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:532)
>
> > at
> > org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)
>
> > at
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>
> > at
> >
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
>
> > at
> >
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
>
> > at
> >
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
>
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
>
> > at
> > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
> > at
> >
> org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:298)
>
> > at
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>
> > at
> >
> org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
>
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
>
> > at
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>
> > at
> >
> org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
>
> > at
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>
> > at
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
>
> > at org.eclipse.jetty.server.Server.doStart(Server.java:282)
> > at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
> > at
> >
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>
> > at
> >
> o

Re: How to get Spring System Environment variables in camel properties

2014-11-18 Thread Claus Ibsen
Hi

See the info box on the top of this page
http://camel.apache.org/using-propertyplaceholder.html

On Wed, Nov 19, 2014 at 3:31 AM, harmohan.singh
 wrote:
> i want to pass environment variables (O/S environment variables) to camel
> routes. something like,
>
>  
>
> similar to how the values are set for configuring properties location:
> location=file:${env:APP_HOME}/etc/foo.properties
>
> but, since that doesnt work. i thought of using spring systemEnvironment to
> get the value:
> #{systemEnvironment['shouldIStart']}  like
> {{systemEnvironment['shouldIStart']}}
> but it looks like the syntax {{}} is only configured with ${} and not #{}
>
> is there another way to pass the env variables to routes
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-get-Spring-System-Environment-variables-in-camel-properties-tp5759281.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: dynamically add routes defined in DSL to a camel routes

2014-11-18 Thread Claus Ibsen
Hi

Yeah unfortunately those methods on camelcontext was marked as
deprecated to refer people to ModelCamelContext.

Frankly I think we should remove those as it confuses people much more
than the goal.

So to avoid the deprecation then type cast

ModelCamelContext mcc = (ModelCamelContext) camelContext;


On Tue, Nov 18, 2014 at 10:42 PM, salemi  wrote:
> Hi Claus,
> thank you for your respond. I used the code but is shows as deprecated. Is
> there a new way to do the loading of new routes from XML file?
>
> Thanks,
> Ali
>
>
>
> -
> Alireza Salemi
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/dynamically-add-routes-defined-in-DSL-to-a-camel-routes-tp5759221p5759277.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: weather endpoint throws exception

2014-11-18 Thread Claus Ibsen
Hi

I guess its a connectivity issue with http://freegeoip.net/json/
If you try that url in a web browser its not online

On Tue, Nov 18, 2014 at 7:14 PM, salemi  wrote:
> Hi,
>
> I am using the weather endpoint
>
> 
>
> and it throws the following error. Any idea why?
>
> Thanks,
> Ali
>
> 11:06:11.423 [main] INFO  org.apache.camel.main.MainSupport - [S:]Apache
> Camel 2.14.0 stopping
> org.apache.camel.TypeConversionException: Error during type conversion from
> type: java.net.URL to the required type: java.lang.String with value
> http://freegeoip.net/json/ due java.io.FileNotFoundException:
> http://freegeoip.net/json/
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:566)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:174)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:150)
> at
> org.apache.camel.component.weather.WeatherConfiguration.getCurrentGeoLocation(WeatherConfiguration.java:155)
> at
> org.apache.camel.component.weather.WeatherConfiguration.getQuery(WeatherConfiguration.java:129)
> at
> org.apache.camel.component.weather.WeatherConfiguration.getQuery(WeatherConfiguration.java:120)
> at
> org.apache.camel.component.weather.WeatherEndpoint.createConsumer(WeatherEndpoint.java:39)
> at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
> at
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:80)
> at org.apache.camel.impl.RouteService.warmUp(RouteService.java:134)
> at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:2379)
> at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2309)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2091)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1951)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1777)
> at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1745)
> at
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:254)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
> at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
> at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:950)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
> at
> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:217)
> at org.apache.camel.spring.Main.doStart(Main.java:157)
> at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at org.apache.camel.main.MainSupport.run(MainSupport.java:149)
> at org.apache.camel.main.MainSupport.run(MainSupport.java:353)
> at org.apache.camel.spring.Main.main(Main.java:90)
> Caused by: org.apache.camel.RuntimeCamelException:
> java.io.FileNotFoundException: http://freegeoip.net/json/
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
> at 
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1006)
> at
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:276)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:165)
> ... 30 more
> Caused by: java.io.FileNotFoundException: http://freegeoip.net/json/
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1623)
> at java.net.URL.openStream(URL.java:1037)
> at
> org.apache.camel.converter.IOConverter.toInputStream(IOConverter.java:69)

Invocation of a Spring bean method at a scheduled time when using Camel routing

2014-11-18 Thread usj
Hi,

Here is the use case.

I need to use Camel Routes to:
a)invoke a Spring bean method, at certain time intervals or specific
scheduled time
b)delegate the result of the bean invocation to a Camel processor to handle
the result

My approach as at now is:
- Use CronScheduledRoutePolicy for scheduled invocation.

My problem is:
I have noticed when building Camel routes,  typically RouteBuilder.from() is
begun with either using an end point such as file or jms.
However, in this case, I need to invoke Spring bean.
How do I achieve this? The series of question marks in my following sample
code highlights the problematic area.
from("???")
.routePolicy(cronScheduledRoutePolicy).noAutoStartup()
.bean(handleResult)
.end();

Any help, appreciated heaps!!!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Invocation-of-a-Spring-bean-method-at-a-scheduled-time-when-using-Camel-routing-tp5759289.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: weather endpoint throws exception

2014-11-18 Thread Claus Ibsen
To avoid the geo lookup, then use the location parameter

location=london,uk

Then there is no geo location lookup and the weather works.

This is the direct api its using
http://api.openweathermap.org/data/2.5/weather?q=london,uk

On Wed, Nov 19, 2014 at 7:23 AM, Claus Ibsen  wrote:
> Hi
>
> I guess its a connectivity issue with http://freegeoip.net/json/
> If you try that url in a web browser its not online
>
> On Tue, Nov 18, 2014 at 7:14 PM, salemi  wrote:
>> Hi,
>>
>> I am using the weather endpoint
>>
>> 
>>
>> and it throws the following error. Any idea why?
>>
>> Thanks,
>> Ali
>>
>> 11:06:11.423 [main] INFO  org.apache.camel.main.MainSupport - [S:]Apache
>> Camel 2.14.0 stopping
>> org.apache.camel.TypeConversionException: Error during type conversion from
>> type: java.net.URL to the required type: java.lang.String with value
>> http://freegeoip.net/json/ due java.io.FileNotFoundException:
>> http://freegeoip.net/json/
>> at
>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:566)
>> at
>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:174)
>> at
>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:150)
>> at
>> org.apache.camel.component.weather.WeatherConfiguration.getCurrentGeoLocation(WeatherConfiguration.java:155)
>> at
>> org.apache.camel.component.weather.WeatherConfiguration.getQuery(WeatherConfiguration.java:129)
>> at
>> org.apache.camel.component.weather.WeatherConfiguration.getQuery(WeatherConfiguration.java:120)
>> at
>> org.apache.camel.component.weather.WeatherEndpoint.createConsumer(WeatherEndpoint.java:39)
>> at
>> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
>> at
>> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:80)
>> at org.apache.camel.impl.RouteService.warmUp(RouteService.java:134)
>> at
>> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:2379)
>> at
>> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2309)
>> at
>> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2091)
>> at
>> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1951)
>> at
>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1777)
>> at 
>> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>> at
>> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1745)
>> at
>> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:254)
>> at
>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
>> at
>> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
>> at
>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
>> at
>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
>> at
>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:950)
>> at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
>> at
>> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
>> at
>> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
>> at
>> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:217)
>> at org.apache.camel.spring.Main.doStart(Main.java:157)
>> at 
>> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>> at org.apache.camel.main.MainSupport.run(MainSupport.java:149)
>> at org.apache.camel.main.MainSupport.run(MainSupport.java:353)
>> at org.apache.camel.spring.Main.main(Main.java:90)
>> Caused by: org.apache.camel.RuntimeCamelException:
>> java.io.FileNotFoundException: http://freegeoip.net/json/
>> at
>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
>> at 
>> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1006)
>> at
>> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
>> at
>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:276)
>> at
>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandator

route synchronization in camel

2014-11-18 Thread cool_rk
Hi

   I am creating a route to aggregate messages from jms queue. I want to
aggregate messages after some fix count let's say i want to aggregate after
100 messages. So is their any way to stop jms queue lookup route when i
aggregating my 100 messages in aggregator route. And after aggregation route
completion i want my jms lookup route is again started for further messages
extraction.

Thanks in advance for any help 



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