Starting route defined in XML query

2013-03-22 Thread gilboy
Hi

I read somewhere in the past of a utility class provided by camel which you
could use/call(e.g. from cmd prompt) to load a spring file which in turn
would start up the xml defined routes. However, I cannot recall the name of
it

E.g. java org.apache...UtilityName spring-context.xml(which contains camel
routes)

Just wondering if anyone could provide

Thanks
Joe



--
View this message in context: 
http://camel.465427.n5.nabble.com/Starting-route-defined-in-XML-query-tp5729706.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Cannot write null body to file error !

2013-03-22 Thread Christian Müller

  
  
  Camel rocks
  


Best,
Christian

On Fri, Mar 22, 2013 at 10:15 PM, bru1900  wrote:

> Am sorry about my lack of understanding.
>
> But by adding Camel rocks to the
> file endpoint you mean? which file?
>
> This is my context file(that am executing) and the other is my msg file (
> present in src/data)
>
>
> On Fri, Mar 22, 2013 at 5:07 PM, Christian Mueller [via Camel] <
> ml-node+s465427n5729701...@n5.nabble.com> wrote:
>
> > By using "quartz://src/data" it looks like you want route messages from
> > the
> > src/data folder. But in this case "src" is the timer group name and
> "data"
> > is the timer name.
> > And the quartz component sends an empty message (with a null body).
> That's
> > what the file component complians. If you add something like:
> > Camel rocks
> >
> > before your file endpoint, it should work...
> >
> > Best,
> > Christian
> >
> > On Fri, Mar 22, 2013 at 9:50 PM, bru1900 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5729701&i=0>>
> > wrote:
> >
> > > I did look at these documents, in one of the examples, the suggested
> was
> > >
> > > from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").
> > >
> > > i am trying to do a similar thing in xml configuration. Where am i
> going
> > > wrong?
> > >
> > >
> > >
> > > On Fri, Mar 22, 2013 at 4:47 PM, Christian Mueller [via Camel] <
> > > [hidden email] >
> > wrote:
> > >
> > > > Your Quartz URI is not valid. You can read more about it at [1].
> > > > I think you are looking for the cron scheduled route policy [2].
> > > >
> > > > [1] http://camel.apache.org/quartz.html
> > > > [2] http://camel.apache.org/cronscheduledroutepolicy.html
> > > >
> > > > Best,
> > > > Christian
> > > >
> > > > On Fri, Mar 22, 2013 at 8:45 PM, bru1900 <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=5729698&i=0>>
> > > > wrote:
> > > >
> > > > > I am newly learning how to set up routes in camel, and Quartz
> > schedule
> > > > > them.
> > > > >
> > > > > I wrote a simple xml config,
> > > > > 
> > > > > http://www.springframework.org/schema/beans";
> > > > >xmlns:camel="http://camel.apache.org/schema/spring";
> > > > >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > > > >xsi:schemaLocation="
> > http://www.springframework.org/schema/beans
> > > > > http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> > > > >http://camel.apache.org/schema/spring
> > > > > http://camel.apache.org/schema/spring/camel-spring.xsd";>
> > > > >
> > > > >   http://camel.apache.org/schema/spring
> > > > > ">
> > > > > 
> > > > >
> > > > >  
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > > The simple file transfer works, but when i added the scheduling
> part
> > am
> > > > > getting the following error.
> > > > > Any help will be highly appreciated.
> > > > >
> > > > > [artzScheduler-camel-1_Worker-5] QuartzEndpoint
> > ERROR
> > > > Error
> > > > > processing exchange. Exchange[Message: [Body is null]]. Caused by:
> > > > > [org.quartz.JobExecutionException -
> > > > >
> org.apache.camel.component.file.GenericFileOperationFailedException:
> > > > Cannot
> > > > > write null body to file:
> > > > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > > > > [artzScheduler-camel-1_Worker-5] JobRunShell
>  INFO
> > > >  Job
> > > > > DEFAULT.quartz-endpoint1 threw a JobExecutionException:
> > > > > org.quartz.JobExecutionException:
> > > > >
> org.apache.camel.component.file.GenericFileOperationFailedException:
> > > > Cannot
> > > > > write null body to file:
> > > > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29
> > [See
> > > > > nested exception:
> > > > >
> org.apache.camel.component.file.GenericFileOperationFailedException:
> > > > Cannot
> > > > > write null body to file:
> > > > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
> >
> > > >
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
> >
> > > >
> > > > > at
> > > > >
> > >
> org.quartz.core.JobRunShell.run(JobRunShell.java:216)[quartz-1.8.5.jar:]
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)[quartz-1.8.5.jar:]
> >
> > > >
> > > > > [artzScheduler-camel-1_Worker-6] simple
> INFO
> > > > >  Moving
> > > > > message to Folder
> > > > > [
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > >
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/Cannot-write-null-bod

Re: Cannot write null body to file error !

2013-03-22 Thread bru1900
Am sorry about my lack of understanding.

But by adding Camel rocks to the
file endpoint you mean? which file?

This is my context file(that am executing) and the other is my msg file (
present in src/data)


On Fri, Mar 22, 2013 at 5:07 PM, Christian Mueller [via Camel] <
ml-node+s465427n5729701...@n5.nabble.com> wrote:

> By using "quartz://src/data" it looks like you want route messages from
> the
> src/data folder. But in this case "src" is the timer group name and "data"
> is the timer name.
> And the quartz component sends an empty message (with a null body). That's
> what the file component complians. If you add something like:
> Camel rocks
>
> before your file endpoint, it should work...
>
> Best,
> Christian
>
> On Fri, Mar 22, 2013 at 9:50 PM, bru1900 <[hidden 
> email]>
> wrote:
>
> > I did look at these documents, in one of the examples, the suggested was
> >
> > from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").
> >
> > i am trying to do a similar thing in xml configuration. Where am i going
> > wrong?
> >
> >
> >
> > On Fri, Mar 22, 2013 at 4:47 PM, Christian Mueller [via Camel] <
> > [hidden email] >
> wrote:
> >
> > > Your Quartz URI is not valid. You can read more about it at [1].
> > > I think you are looking for the cron scheduled route policy [2].
> > >
> > > [1] http://camel.apache.org/quartz.html
> > > [2] http://camel.apache.org/cronscheduledroutepolicy.html
> > >
> > > Best,
> > > Christian
> > >
> > > On Fri, Mar 22, 2013 at 8:45 PM, bru1900 <[hidden email]<
> > http://user/SendEmail.jtp?type=node&node=5729698&i=0>>
> > > wrote:
> > >
> > > > I am newly learning how to set up routes in camel, and Quartz
> schedule
> > > > them.
> > > >
> > > > I wrote a simple xml config,
> > > > 
> > > > http://www.springframework.org/schema/beans";
> > > >xmlns:camel="http://camel.apache.org/schema/spring";
> > > >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > > >xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> > > > http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> > > >http://camel.apache.org/schema/spring
> > > > http://camel.apache.org/schema/spring/camel-spring.xsd";>
> > > >
> > > >   http://camel.apache.org/schema/spring
> > > > ">
> > > > 
> > > >
> > > >  
> > > >  
> > > > 
> > > > 
> > > > 
> > > >
> > > > 
> > > >
> > > > The simple file transfer works, but when i added the scheduling part
> am
> > > > getting the following error.
> > > > Any help will be highly appreciated.
> > > >
> > > > [artzScheduler-camel-1_Worker-5] QuartzEndpoint
> ERROR
> > > Error
> > > > processing exchange. Exchange[Message: [Body is null]]. Caused by:
> > > > [org.quartz.JobExecutionException -
> > > > org.apache.camel.component.file.GenericFileOperationFailedException:
> > > Cannot
> > > > write null body to file:
> > > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > > > [artzScheduler-camel-1_Worker-5] JobRunShellINFO
> > >  Job
> > > > DEFAULT.quartz-endpoint1 threw a JobExecutionException:
> > > > org.quartz.JobExecutionException:
> > > > org.apache.camel.component.file.GenericFileOperationFailedException:
> > > Cannot
> > > > write null body to file:
> > > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29
> [See
> > > > nested exception:
> > > > org.apache.camel.component.file.GenericFileOperationFailedException:
> > > Cannot
> > > > write null body to file:
> > > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
>
> > >
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
>
> > >
> > > > at
> > > >
> > org.quartz.core.JobRunShell.run(JobRunShell.java:216)[quartz-1.8.5.jar:]
> > > > at
> > > >
> > > >
> > >
> >
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)[quartz-1.8.5.jar:]
>
> > >
> > > > [artzScheduler-camel-1_Worker-6] simple INFO
> > > >  Moving
> > > > message to Folder
> > > > [
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696.html
> > > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > > >
> > >
> > >
> > > --
> > >  If you reply to this email, your message will be added to the
> discussion
> > > below:
> > >
> > >
> >
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696p5729698.html
> > >  T

Re: Cannot write null body to file error !

2013-03-22 Thread Christian Müller
By using "quartz://src/data" it looks like you want route messages from the
src/data folder. But in this case "src" is the timer group name and "data"
is the timer name.
And the quartz component sends an empty message (with a null body). That's
what the file component complians. If you add something like:
Camel rocks

before your file endpoint, it should work...

Best,
Christian

On Fri, Mar 22, 2013 at 9:50 PM, bru1900  wrote:

> I did look at these documents, in one of the examples, the suggested was
>
> from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").
>
> i am trying to do a similar thing in xml configuration. Where am i going
> wrong?
>
>
>
> On Fri, Mar 22, 2013 at 4:47 PM, Christian Mueller [via Camel] <
> ml-node+s465427n5729698...@n5.nabble.com> wrote:
>
> > Your Quartz URI is not valid. You can read more about it at [1].
> > I think you are looking for the cron scheduled route policy [2].
> >
> > [1] http://camel.apache.org/quartz.html
> > [2] http://camel.apache.org/cronscheduledroutepolicy.html
> >
> > Best,
> > Christian
> >
> > On Fri, Mar 22, 2013 at 8:45 PM, bru1900 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5729698&i=0>>
> > wrote:
> >
> > > I am newly learning how to set up routes in camel, and Quartz schedule
> > > them.
> > >
> > > I wrote a simple xml config,
> > > 
> > > http://www.springframework.org/schema/beans";
> > >xmlns:camel="http://camel.apache.org/schema/spring";
> > >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > >xsi:schemaLocation="http://www.springframework.org/schema/beans
> > > http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> > >http://camel.apache.org/schema/spring
> > > http://camel.apache.org/schema/spring/camel-spring.xsd";>
> > >
> > >   http://camel.apache.org/schema/spring
> > > ">
> > > 
> > >
> > >  
> > >  
> > > 
> > > 
> > > 
> > >
> > > 
> > >
> > > The simple file transfer works, but when i added the scheduling part am
> > > getting the following error.
> > > Any help will be highly appreciated.
> > >
> > > [artzScheduler-camel-1_Worker-5] QuartzEndpoint ERROR
> > Error
> > > processing exchange. Exchange[Message: [Body is null]]. Caused by:
> > > [org.quartz.JobExecutionException -
> > > org.apache.camel.component.file.GenericFileOperationFailedException:
> > Cannot
> > > write null body to file:
> > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > > [artzScheduler-camel-1_Worker-5] JobRunShellINFO
> >  Job
> > > DEFAULT.quartz-endpoint1 threw a JobExecutionException:
> > > org.quartz.JobExecutionException:
> > > org.apache.camel.component.file.GenericFileOperationFailedException:
> > Cannot
> > > write null body to file:
> > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29 [See
> > > nested exception:
> > > org.apache.camel.component.file.GenericFileOperationFailedException:
> > Cannot
> > > write null body to file:
> > > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > > at
> > >
> > >
> >
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
> >
> > > at
> > >
> > >
> >
> org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
> >
> > > at
> > >
> org.quartz.core.JobRunShell.run(JobRunShell.java:216)[quartz-1.8.5.jar:]
> > > at
> > >
> > >
> >
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)[quartz-1.8.5.jar:]
> >
> > > [artzScheduler-camel-1_Worker-6] simple INFO
> > >  Moving
> > > message to Folder
> > > [
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> > --
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696p5729698.html
> >  To unsubscribe from Cannot write null body to file error !, click here<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5729696&code=cmFyZXJlbXlAZ21haWwuY29tfDU3Mjk2OTZ8LTE5Mzg3NTA5NjY=
> >
> > .
> > NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.c

Re: How to schedule FTP with quartz?

2013-03-22 Thread Chris Wolf
I found the issue with my custom CronScheduledRoutePolicy - initially
the startTime/resumeTime are only scheduled in
onInit() - so to re-resume (re-start), you need to call
scheduleRoute(Action.RESUME, route); in onStart()

...but now I'm getting:

quartz.ScheduledRoutePolicy WARN  Route is not in a started state and
cannot be resumed. The current route state is Suspended

What is the deal?  I thought resumeRoute was the inverse of
suspenRoute, but this log message seems to indicate that
calling CamelContext.suspendRoute(routeId) will put the route into a
state that cannot be resumed.

Thanks,


Chris

On Fri, Mar 22, 2013 at 4:04 PM, Chris Wolf  wrote:
> Pontus,
>
> Thanks for that.  Since I already has started implementing a class
> derived from CronScheduledRoutePolicy, I just finished it.
> It works by starting a Timer thread in onStart/onResume at the end of
> the time period, the route is suspended, but then upon
> the next schedule cron start time, I don't see it being resumed - I
> wonder if the RoutePolicy itself is being suspend too?
>
> Well, I try it your way also.
>
>
> Thanks,
>
>
> Chris
>
> On Wed, Mar 20, 2013 at 4:34 AM, Pontus Ullgren  wrote:
>> Hello,
>>
>> On Tue, Mar 19, 2013 at 11:22 PM, Chris Wolf  wrote:
>>> On Mon, Mar 18, 2013 at 4:57 PM, Pontus Ullgren  wrote:
 Hello Chris,

 On Mon, Mar 18, 2013 at 8:54 PM, Chris Wolf  wrote:
> Claus,
>
> I have a few further questions about CronScheduledRoutePolicy.  I
> noticed that it has setters such as setRouteStartTime,
> setRouteStopTime, each which takes a cron expression string.  What I'm
> looking for is to be able to use a cron expression for the start, but
> a relative time length for stop.   Otherwise, I need to write code to
> parse the start time expression, then calculate a stop time cron
> expression.  Any ideas?
>
 Depending on your needs you could enable "sendEmptyMessageWhenIdle" on
 the endpoint and then suspend the route when you receive a empty
 message. Which means that there is no more files to poll at the
 moment.
 You can use the content based route EIP for this.
>>>
>>> That is interesting to know, thanks.  In my case, the files at the
>>> remote end are themselves deposited at an irregular rate, but within a
>>> defined time window, so during that time window, there will be
>>> intermittent idleness...

 Another solution would be to write your own RoutePolicy to take care
 of your needs.
>>>
>>> Yes, this sounds like the best approach...
>>>
>>>

 I just started to wonder if it might be possible to combine the
 CronScheduledRoutePolicy with a SimpleScheduledRoutePolicy.
 I have _not_ tested this so I'm not sure if it works. It might be that
 there is a collision in the way they work with Quartz.

> Also I see that CronScheduledRoutePolicy has setRouteResumeTime,
> setRouteSuspendTime such that for my FTP poll window, I could either
> do start/stop or resume/suspend - which is recommended?
>
 I would highly recommend resume/suspend.
 I've had some thread leak problem with the file component when it was
 repetitively started/stopped.
>>>
>>> Ok, but I guess the first policy callback with be onStart since the
>>> route will be
>>> configured with noAutoStartup(), so upon that first onStart, I'll
>>> suspend then toggle
>>> between onSuspend/onResume...
>>>
>> Yes this is what I do. We have a route that should start 06:30 each
>> day and then poll all files that are in the folder at that time.
>> After that it should suspend.
>>
>> Here is some pseudo code.
>> SuspendRouteProcessor is a processor that suspends the route based on route 
>> id.
>> ---
>> String cronStr = "* 30 6 * * * ?";
>> String input = 
>> "ftp://user@remotehost/inbox?sendEmptyMessageWhenIdle=true&password=secret";;
>> CronScheduledRoutePolicy scheduledRP = new CronScheduledRoutePolicy();
>> scheduledRoutePolicy.setRouteStartTime(cronStr);
>> scheduledRoutePolicy.setRouteResumeTime(cronStr);
>>
>> from(input)
>> .routeId("input1")
>> .routePolicy(versionPolicy, scheduledRoutePolicy)
>> .noAutoStartup()
>>  .choice()
>> .when(body().isNotNull())
>>.to("direct:processFiles")
>> .end()
>> .log(LoggingLevel.DEBUG, "All files processed, suspend 
>> route")
>> .process(new SuspendRouteProcessor("input1"))
>> ;
>> --
>>
>> The only downside with this is that after the initial start we get a
>> WARN log message that the route can not be started since it is in
>> suspend state.
>> But as long as you can live with the WARN log it works.
>>

 // Pontus

> Thanks,
>
> Chris
>
> On Sat, Mar 2, 2013 at 1:43 AM, Claus Ibsen  wrote:
>> Hi
>>
>> See about route policy
>> http://camel.apache.org/routepolicy
>>
>> And the scheduled route policy
>> http://camel.apa

Re: Cannot write null body to file error !

2013-03-22 Thread bru1900
I did look at these documents, in one of the examples, the suggested was

from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").

i am trying to do a similar thing in xml configuration. Where am i going wrong?



On Fri, Mar 22, 2013 at 4:47 PM, Christian Mueller [via Camel] <
ml-node+s465427n5729698...@n5.nabble.com> wrote:

> Your Quartz URI is not valid. You can read more about it at [1].
> I think you are looking for the cron scheduled route policy [2].
>
> [1] http://camel.apache.org/quartz.html
> [2] http://camel.apache.org/cronscheduledroutepolicy.html
>
> Best,
> Christian
>
> On Fri, Mar 22, 2013 at 8:45 PM, bru1900 <[hidden 
> email]>
> wrote:
>
> > I am newly learning how to set up routes in camel, and Quartz schedule
> > them.
> >
> > I wrote a simple xml config,
> > 
> > http://www.springframework.org/schema/beans";
> >xmlns:camel="http://camel.apache.org/schema/spring";
> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >xsi:schemaLocation="http://www.springframework.org/schema/beans
> > http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> >http://camel.apache.org/schema/spring
> > http://camel.apache.org/schema/spring/camel-spring.xsd";>
> >
> >   http://camel.apache.org/schema/spring
> > ">
> > 
> >
> >  
> >  
> > 
> > 
> > 
> >
> > 
> >
> > The simple file transfer works, but when i added the scheduling part am
> > getting the following error.
> > Any help will be highly appreciated.
> >
> > [artzScheduler-camel-1_Worker-5] QuartzEndpoint ERROR
> Error
> > processing exchange. Exchange[Message: [Body is null]]. Caused by:
> > [org.quartz.JobExecutionException -
> > org.apache.camel.component.file.GenericFileOperationFailedException:
> Cannot
> > write null body to file:
> > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > [artzScheduler-camel-1_Worker-5] JobRunShellINFO
>  Job
> > DEFAULT.quartz-endpoint1 threw a JobExecutionException:
> > org.quartz.JobExecutionException:
> > org.apache.camel.component.file.GenericFileOperationFailedException:
> Cannot
> > write null body to file:
> > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29 [See
> > nested exception:
> > org.apache.camel.component.file.GenericFileOperationFailedException:
> Cannot
> > write null body to file:
> > C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> > at
> >
> >
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
>
> > at
> >
> >
> org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
>
> > at
> > org.quartz.core.JobRunShell.run(JobRunShell.java:216)[quartz-1.8.5.jar:]
> > at
> >
> >
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)[quartz-1.8.5.jar:]
>
> > [artzScheduler-camel-1_Worker-6] simple INFO
> >  Moving
> > message to Folder
> > [
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696p5729698.html
>  To unsubscribe from Cannot write null body to file error !, click 
> here
> .
> NAML
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696p5729699.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot write null body to file error !

2013-03-22 Thread Christian Müller
Your Quartz URI is not valid. You can read more about it at [1].
I think you are looking for the cron scheduled route policy [2].

[1] http://camel.apache.org/quartz.html
[2] http://camel.apache.org/cronscheduledroutepolicy.html

Best,
Christian

On Fri, Mar 22, 2013 at 8:45 PM, bru1900  wrote:

> I am newly learning how to set up routes in camel, and Quartz schedule
> them.
>
> I wrote a simple xml config,
> 
> http://www.springframework.org/schema/beans";
>xmlns:camel="http://camel.apache.org/schema/spring";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
>   http://camel.apache.org/schema/spring
> ">
> 
>
>  
>  
> 
> 
> 
>
> 
>
> The simple file transfer works, but when i added the scheduling part am
> getting the following error.
> Any help will be highly appreciated.
>
> [artzScheduler-camel-1_Worker-5] QuartzEndpoint ERROR Error
> processing exchange. Exchange[Message: [Body is null]]. Caused by:
> [org.quartz.JobExecutionException -
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> write null body to file:
> C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> [artzScheduler-camel-1_Worker-5] JobRunShellINFO  Job
> DEFAULT.quartz-endpoint1 threw a JobExecutionException:
> org.quartz.JobExecutionException:
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> write null body to file:
> C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29 [See
> nested exception:
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> write null body to file:
> C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
> at
>
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
> at
>
> org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
> at
> org.quartz.core.JobRunShell.run(JobRunShell.java:216)[quartz-1.8.5.jar:]
> at
>
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)[quartz-1.8.5.jar:]
> [artzScheduler-camel-1_Worker-6] simple INFO
>  Moving
> message to Folder
> [
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: How to schedule FTP with quartz?

2013-03-22 Thread Chris Wolf
Pontus,

Thanks for that.  Since I already has started implementing a class
derived from CronScheduledRoutePolicy, I just finished it.
It works by starting a Timer thread in onStart/onResume at the end of
the time period, the route is suspended, but then upon
the next schedule cron start time, I don't see it being resumed - I
wonder if the RoutePolicy itself is being suspend too?

Well, I try it your way also.


Thanks,


Chris

On Wed, Mar 20, 2013 at 4:34 AM, Pontus Ullgren  wrote:
> Hello,
>
> On Tue, Mar 19, 2013 at 11:22 PM, Chris Wolf  wrote:
>> On Mon, Mar 18, 2013 at 4:57 PM, Pontus Ullgren  wrote:
>>> Hello Chris,
>>>
>>> On Mon, Mar 18, 2013 at 8:54 PM, Chris Wolf  wrote:
 Claus,

 I have a few further questions about CronScheduledRoutePolicy.  I
 noticed that it has setters such as setRouteStartTime,
 setRouteStopTime, each which takes a cron expression string.  What I'm
 looking for is to be able to use a cron expression for the start, but
 a relative time length for stop.   Otherwise, I need to write code to
 parse the start time expression, then calculate a stop time cron
 expression.  Any ideas?

>>> Depending on your needs you could enable "sendEmptyMessageWhenIdle" on
>>> the endpoint and then suspend the route when you receive a empty
>>> message. Which means that there is no more files to poll at the
>>> moment.
>>> You can use the content based route EIP for this.
>>
>> That is interesting to know, thanks.  In my case, the files at the
>> remote end are themselves deposited at an irregular rate, but within a
>> defined time window, so during that time window, there will be
>> intermittent idleness...
>>>
>>> Another solution would be to write your own RoutePolicy to take care
>>> of your needs.
>>
>> Yes, this sounds like the best approach...
>>
>>
>>>
>>> I just started to wonder if it might be possible to combine the
>>> CronScheduledRoutePolicy with a SimpleScheduledRoutePolicy.
>>> I have _not_ tested this so I'm not sure if it works. It might be that
>>> there is a collision in the way they work with Quartz.
>>>
 Also I see that CronScheduledRoutePolicy has setRouteResumeTime,
 setRouteSuspendTime such that for my FTP poll window, I could either
 do start/stop or resume/suspend - which is recommended?

>>> I would highly recommend resume/suspend.
>>> I've had some thread leak problem with the file component when it was
>>> repetitively started/stopped.
>>
>> Ok, but I guess the first policy callback with be onStart since the
>> route will be
>> configured with noAutoStartup(), so upon that first onStart, I'll
>> suspend then toggle
>> between onSuspend/onResume...
>>
> Yes this is what I do. We have a route that should start 06:30 each
> day and then poll all files that are in the folder at that time.
> After that it should suspend.
>
> Here is some pseudo code.
> SuspendRouteProcessor is a processor that suspends the route based on route 
> id.
> ---
> String cronStr = "* 30 6 * * * ?";
> String input = 
> "ftp://user@remotehost/inbox?sendEmptyMessageWhenIdle=true&password=secret";;
> CronScheduledRoutePolicy scheduledRP = new CronScheduledRoutePolicy();
> scheduledRoutePolicy.setRouteStartTime(cronStr);
> scheduledRoutePolicy.setRouteResumeTime(cronStr);
>
> from(input)
> .routeId("input1")
> .routePolicy(versionPolicy, scheduledRoutePolicy)
> .noAutoStartup()
>  .choice()
> .when(body().isNotNull())
>.to("direct:processFiles")
> .end()
> .log(LoggingLevel.DEBUG, "All files processed, suspend route")
> .process(new SuspendRouteProcessor("input1"))
> ;
> --
>
> The only downside with this is that after the initial start we get a
> WARN log message that the route can not be started since it is in
> suspend state.
> But as long as you can live with the WARN log it works.
>
>>>
>>> // Pontus
>>>
 Thanks,

 Chris

 On Sat, Mar 2, 2013 at 1:43 AM, Claus Ibsen  wrote:
> Hi
>
> See about route policy
> http://camel.apache.org/routepolicy
>
> And the scheduled route policy
> http://camel.apache.org/scheduledroutepolicy.html
>
> On Sat, Mar 2, 2013 at 12:15 AM, Chris Wolf  wrote:
>> I have a requirement to download files via FTP during a certain time
>> window and according to a schedule. e.g. Only on trading days between
>> 6:30AM and 7:00AM.  The FTP component, alone, seems to just do
>> indefinite polling according to delay/initialDelay.
>>
>> From the "Camel In Action" book, chapter 7, I see some examples of
>> sending a text message with the Timer and Quartz components, but I
>> can't quite see how to put that together to implement "kicking off
>> routes at specified intervals", mentioned in the best practices list
>> at the end of that chapter.  How would I use quartz to stop/start the
>> FTP component, or the route 

Cannot write null body to file error !

2013-03-22 Thread bru1900
I am newly learning how to set up routes in camel, and Quartz schedule them.

I wrote a simple xml config, 

http://www.springframework.org/schema/beans";
   xmlns:camel="http://camel.apache.org/schema/spring";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>

  http://camel.apache.org/schema/spring";>


 
 






The simple file transfer works, but when i added the scheduling part am
getting the following error. 
Any help will be highly appreciated.

[artzScheduler-camel-1_Worker-5] QuartzEndpoint ERROR Error
processing exchange. Exchange[Message: [Body is null]]. Caused by:
[org.quartz.JobExecutionException -
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
write null body to file:
C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
[artzScheduler-camel-1_Worker-5] JobRunShellINFO  Job
DEFAULT.quartz-endpoint1 threw a JobExecutionException: 
org.quartz.JobExecutionException:
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
write null body to file:
C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29 [See
nested exception:
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
write null body to file:
C:\Data\FuseJars\messages\ID-CGL-R8Y2AEZ-64638-1363878882438-0-29]
at
org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
at
org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)[camel-quartz-2.10.0.fuse-71-047.jar:2.10.0.fuse-71-047]
at 
org.quartz.core.JobRunShell.run(JobRunShell.java:216)[quartz-1.8.5.jar:]
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)[quartz-1.8.5.jar:]
[artzScheduler-camel-1_Worker-6] simple INFO  Moving
message to Folder
[



--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-error-tp5729696.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to call CXF web service from Camel

2013-03-22 Thread santhosh
I recommend you try this

Some ideas:
I am assuming you have cxf webservice as seperate project or hitting service
deployed elsewhere from camel.If no, i recommend to untangle cxf webservice
and camel.

First get the cxf webservice  project deployed.Check if the wsdl is
available.

then change you cxf bean to take wsdl argument.

  http://localhost:8080/HelloWeb/Hello";
wsdlURL="http://localhost:8080/HelloWeb/Hello?wsdl"; endpointName=??
serviceName=??/>

camel-context:

 
   



 


this should work.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-call-CXF-web-service-from-Camel-tp5729692p5729694.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How can I perform immediate shutdown of a context and all it's routes and services, etc.?

2013-03-22 Thread Chris Wolf
I am implementing some unit tests and if things go wrong I just want
to shutdown ASAP without regard for inconsistent
states, etc.  There's no easy hook in DefaultShutDownStrategy to do
that because you need to know the route
startup order, so I ended up with this convoluted code (that I kick
off in a separate thread). It doesn't work, BTW.

DefaultRouteStartupOrder rsuo = null;
int startOrder = 0;
List suo = new
ArrayList();
List routes = context.getRoutes();
for (Route route : routes) {
List services = route.getServices();
for (Service service : services) {
if (service instanceof RouteService) {
rsuo = new
DefaultRouteStartupOrder(startOrder, route, (RouteService) service);
suo.add(rsuo);
}
}
startOrder++;
}
ShutdownStrategy sds = context.getShutdownStrategy();
sds.shutdownForced(context, suo);

I know there must be an easier way, but I haven't found such.  Any ideas?

Thanks,

Chris


How to call CXF web service from Camel

2013-03-22 Thread abhi
Hi All,
I am new to Apache Camel and I am trying to call CXF web service from Camel.

Here is my camel-context.xml
--





  




http://localhost:8080/HelloWeb/Hello";
wsdlURL="http://localhost:8080/HelloWeb/Hello?wsdl";
serviceClass="com.server.HelloFirst" 
/>
 





Below are the source code of my web service 
HelloFirst.java
--
package com.server;

import javax.jws.WebService;

@WebService
public interface HelloFirst {
public String myHello(String str);
}


HelloFirstImpl.java
--
package com.server;

import javax.jws.WebService;

@WebService(endpointInterface = "com.server.HelloFirst")
public class HelloFirstImpl {
public String myHello(String str){
return "HelloFirstImpl: Hello :"+str;
}
}


cxf.xml
-

http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:jaxws="http://cxf.apache.org/jaxws";
xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd";>







Using a java client I am able to invoke above web service but when I try to
do it through Camel it gives me following error:

Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'HelloService': Initialization of bean failed; nested exception is
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type 'java.lang.String' to required type 'java.lang.Class' for
property 'serviceClass'; nested exception is
java.lang.IllegalArgumentException: Cannot find class
[com.server.HelloFirst]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
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:186)
at org.apache.camel.spring.Main.doStart(Main.java:140)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
at org.apache.camel.main.MainSupport.run(MainSupport.java:141)
at org.test.CamelFirstCXF.main(CamelFirstCXF.java:30)
Caused by: org.springframework.beans.TypeMismatchException: Failed to
convert property value of type 'java.lang.String' to required type
'java.lang.Class' for property 'serviceClass'; nested exception is
java.lang.IllegalArgumentException: Cannot find class
[com.server.HelloFirst]
at
org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:486)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:518)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1373)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1332)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
... 15 more
Caused by: java.lang.IllegalArgumentException: Cannot find class
[com.ser

Re: HTTP Basic Authentication

2013-03-22 Thread cgsk
Thanks for the reply. The problem got resolved after adding
httpClient.authenticationPreemptive=true



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


Re: How to gave version to camel context file ?

2013-03-22 Thread sarfaraj
Worked, Thank you very much *Christian* 



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-gave-version-to-camel-context-file-tp5729650p5729685.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel component for Google-Drive - How about creating it ?

2013-03-22 Thread Christian Müller
May a look into the camel-aws components code (S3) is also  useful for you:
https://svn.apache.org/repos/asf/camel/trunk/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/

Best,
Christian

On Fri, Mar 22, 2013 at 1:49 PM, Gnanaguru S <
gnanaguru.sattanat...@wipro.com> wrote:

>
> Christian,
>
> Drive Java SDK is available. I was able to find it here:
> https://code.google.com/p/google-api-java-client/
>
> They have mentioned the license as *Apache 2.0 *.
>
> I am not able to come to a conclusion whether this SDK will help us achieve
> what we want as a camel component.
>
> Let me dig it up further.
>
> -Guru
>  @gnanagurus
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-component-for-Google-Drive-How-about-creating-it-tp5729673p5729681.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Came Hibernate SaveorUpdate Option

2013-03-22 Thread Christian Müller
We are calling:
session.persist(value);

You can check the code by yourself if you want:
http://code.google.com/a/apache-extras.org/p/camel-extra/source/browse/trunk/components/camel-hibernate/src/main/java/org/apacheextras/camel/component/hibernate/HibernateProducer.java

Best,
Christian

On Tue, Mar 12, 2013 at 5:24 PM,  wrote:

> Hi,
> Please advise if we have saveorupdate hibernate feature in Camel Hibernate
> endpoint?
>
> Thanks
> Ganesh
>
> ___
>
> This message may contain information that is confidential or privileged.
> If you are not an intended recipient of this message, please delete it and
> any attachments, and notify the sender that you have received it in error.
> Unless specifically stated in the message or otherwise indicated, you may
> not uplicate, redistribute or forward this message or any portion thereof,
> including any attachments, by any means to any other person, including any
> retail investor or customer. This message is not a recommendation, advice,
> offer or solicitation, to buy/sell any product or service, and is not an
> official confirmation of any transaction. Any opinions presented are solely
> those of the author and do not necessarily represent those of Barclays.
>
> This message is subject to terms available at:
> www.barclays.com/emaildisclaimer and, if received from Barclays' Sales or
> Trading desk, the terms available at:
> www.barclays.com/salesandtradingdisclaimer/. By messaging with Barclays
> you consent to the foregoing. Barclays Bank PLC is a company registered in
> England (number 1026167) with its registered office at 1 Churchill Place,
> London, E14 5HP. This email may relate to or be sent from other members of
> the Barclays group.
>
> ___
>


Re: smpp datacoding - alphabet at endpoint level not taken into account

2013-03-22 Thread Christian Müller
Hello Fred!

Please find my comments inline.

Best,
Christian

On Fri, Mar 1, 2013 at 12:12 PM, fclose  wrote:

> Hello,
>
> This, week I have been struggling with the sending of sms with special
> (french) characters.
>
> On the initial tests I did I was setting the dataCoding / alphabet (= 8
> UCS2) as URI options of the endpoint.
> This didn't work.
>
What do exactly mean with "This didn't work"? Can you provide a unit test
which express your expected behavior?


>
> When I set the alphabet to UCS2 as a Producer Message Header and encoding =
> UTF-16BE as URI options,   then it works :-)
>
> I'm using camel 2.10.3, and a spring based endpoint configuration for the
> endpoint.
>
>
> I'm wondering why setting the alphabet as a URI option is not taken into
> account ?
>
It is. Have a look at
https://svn.apache.org/repos/asf/camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java->
check createSubmitSmTemplate()
and also
https://svn.apache.org/repos/asf/camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java->
getShortMessage()
Feel free to comment if you think there is something wrong with it.


> Final question why is not possible to set the encoding as a producer
> message
> headers ?
>
I think while until now nobody had the need...

>
>
> --Fred
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/smpp-datacoding-alphabet-at-endpoint-level-not-taken-into-account-tp5728345.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel component for Google-Drive - How about creating it ?

2013-03-22 Thread Gnanaguru S

Christian, 

Drive Java SDK is available. I was able to find it here:
https://code.google.com/p/google-api-java-client/

They have mentioned the license as *Apache 2.0 *. 

I am not able to come to a conclusion whether this SDK will help us achieve
what we want as a camel component. 

Let me dig it up further. 

-Guru
 @gnanagurus



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-component-for-Google-Drive-How-about-creating-it-tp5729673p5729681.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Cannot read inbound mesage from CXF webservice

2013-03-22 Thread Christian Müller
Hi Heiko!

Good to know you could solve the issue by yourself.

If you want to check whether your exchange already has an out message, you
can call:
exchange.hasOut();

Best,
Christian

On Fri, Mar 22, 2013 at 12:29 PM, Heiko  wrote:

> Hi guys,
>
> It´s me again. I finally solved the issue.
> @Christian: You gave me the right trace with "don´t call the
> exchange.getOut()", since that creates an new out message.
> @Claus: Also thanks to you for the link to the docs I read through.
>
> Many Thanks.
>
> Camel rocks! :o)
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Cannot-read-inbound-message-from-CXF-webservice-empty-message-body-tp5729613p5729676.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--


Re: Camel component for Google-Drive - How about creating it ?

2013-03-22 Thread Christian Müller
Sounds useful. We have already similar support for Amazon's cloud service
S3.
Is there a SDK available (from Google)? Did you checked the license?

Best,
Christian

On Fri, Mar 22, 2013 at 12:18 PM, Gnanaguru S <
gnanaguru.sattanat...@wipro.com> wrote:

> Hello,
>
> I am researching on the technical possibility of creating a camel component
> for connecting to Google drive.
>
> say camel-drive !
>
> How about the usefulness of this component ? I got a imagination like, I
> drop a file in my machine
>
> 1. from 'Camel-file' its been sent to 'camel-drive', so my file is on cloud
> now.
>
> Will this componet work out ? I want to understand the limitations and
> usability.
>
> -Guru
>   @gnanagurus
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-component-for-Google-Drive-How-about-creating-it-tp5729673.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--


Re: Cannot read inbound mesage from CXF webservice

2013-03-22 Thread Heiko
Hi guys,

It´s me again. I finally solved the issue.
@Christian: You gave me the right trace with "don´t call the
exchange.getOut()", since that creates an new out message.
@Claus: Also thanks to you for the link to the docs I read through.

Many Thanks.

Camel rocks! :o)



--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-read-inbound-message-from-CXF-webservice-empty-message-body-tp5729613p5729676.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel component for Google-Drive - How about creating it ?

2013-03-22 Thread Gnanaguru S
Hello,

I am researching on the technical possibility of creating a camel component
for connecting to Google drive.

say camel-drive !

How about the usefulness of this component ? I got a imagination like, I
drop a file in my machine 

1. from 'Camel-file' its been sent to 'camel-drive', so my file is on cloud
now. 

Will this componet work out ? I want to understand the limitations and
usability. 

-Guru
  @gnanagurus





--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-component-for-Google-Drive-How-about-creating-it-tp5729673.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Smpp stop route recommendations

2013-03-22 Thread fclose
Hello,


I have configured a route listening for incoming sms messages.
We did a mini load test with 2 messages / seconds.
this works perfectly but we have a problem when we stop the route, at that
time we seem to lose messages 

smsc considers that 2 messages were rejected *before *the unbind.


So, I have 2 questions: 

1/ how would you advise stopping that route ?
currently what I'm doing is (simply)

camelContext.stopRoute(routeId);


2/ the route is only receiving sms not sending any 
it is configured with registeredDelivery = 0 

which means :  No SMSC delivery receipt requested.

Should I not use 1 instead of 0 ?


possible values: 

0: No SMSC delivery receipt requested.
1: SMSC delivery receipt requested where final delivery outcome is success
or failure.
2: SMSC delivery receipt requested where the final delivery outcome is
delivery failure.




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


Re: Cannot read inbound mesage from CXF webservice

2013-03-22 Thread Heiko
Hi Christian,

Please see my post on Claus reply.

But for both of you here is my boring AggregationStrategy I forgot to paste:





--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-read-inbound-message-from-CXF-webservice-empty-message-body-tp5729613p5729662.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Cannot read inbound mesage from CXF webservice

2013-03-22 Thread Heiko
Thanks Claus & Christian,

I tried everything you both recommended before and it still doesn´t worked
out for me.

@Claus: Yes, I think I already defined an InOut route. Please proove from
the route def. Am I wrong?
@Claus: Yes, I already activated stream caching, since this route is
streambased. My understanding it, that I have to activate the stream caching
either per route or per context. Is my route defintion wrong?

@Christian: You brought up an interessting point I didn´t took into account
so far. I stripped the call or exchange.getOut() method. Didn´t work,
eigther :o(

So, hopefully all cables are connected. Hope you guys find my mistake.

My route now looks like this:


createTemisAuthetificationMessage stayed the same as it was before.

My setTemisWebServiceTokenToHeader now looks like this:


But unfortunately this is my output. Still no body there:





--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-read-inbound-message-from-CXF-webservice-empty-message-body-tp5729613p5729661.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Warning being thrown after setting preserveMessageQos=true

2013-03-22 Thread Christian Müller
Do you use transactions?
Do you use inOut or inOnly message exchange pattern?
Did you already checked line 324 in PrefetchSubscription.java? What does it?

Best,
Christian

On Wed, Mar 20, 2013 at 1:24 PM, wxkevin wrote:

> I am using Camel 2.9.1 and Java DSL.
>
> I attempted to setup an expiration time for my custom message being sent to
> a queue such as:
>
> .from()
>
>// DO some processing and create message
>
>.setHeader("JMSExpiration", constant(System.currentTimeMillis() + 3000))
>.setHeader("JMSDeliveryMode", constant(DeliveryMode.NON_PERSISTENT))
>.to("jms.queue.myQueue?preserverMessageQos=true")
>.end();
>
> As soon as this was set up I started to receive warnings in the consumer of
> these messages:
>
> WARN | org.springframework.jms.connection.CachingConnectionFactory |
> Encountered a JMSException = resetting the underlying JMS Connection
> javax.jms.JMSException: Could not correlate acknowledgement with dispatched
> message: MessageAck {}
>  at
>
> org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:324)
>  at 
>  
> WARN | org.apache.camel.component.jms.DefaultJmsMessageListenerContainer |
> Setup of JMS message listener invoker failed for destination 'myQueue' -
> trying to recover. Cause: Could not commit JMS transaction; nested
> exception
> is havax.jms.IllegalStateException: The Session is closed.
>
> Any ideas?
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Warning-being-thrown-after-setting-preserveMessageQos-true-tp5729498.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--


Re: bean dont work

2013-03-22 Thread Christian Müller
User post the question twice and got an answer in the other thread.

On Wed, Mar 20, 2013 at 2:55 PM, takidean  wrote:

> i use to extract some information from an xml file to insert them into a
> jdbc
> data base this is what i did and it doesn't work
>
> **main***
> public class Cntx {
>
> /**
>  * @param args
>  * @throws Exception
>  */
> public static void main(String[] args) throws Exception {
> // TODO Auto-generated method stub
> CamelContext context = new DefaultCamelContext();
> context.addRoutes(new MyRouteBuilder());
> context.start();
> Thread.sleep(3000);
> context.stop();
> }
>
> }
> ***MyrouteBuilder***
> public class MyRouteBuilder extends RouteBuilder {
>
> /**
>  * Let's configure the Camel routing rules using Java code...
>  */
> public void configure() {
>
> // here is a sample which processes the input files
> // (leaving them in place - see the 'noop' flag)
> // then performs content based routing on the message using XPath
> from("file:src/data")
> .choice()
> .when(xpath("/person/user = 'SFIN'"))
> .to("bean:OrderToSql").to("bean:SfinPull");
> }
>
> }
> *OrderToSqlBean**
> public class OrderToSql {
>
>public String toSql(@XPath("order/@firstName") String name,
>@XPath("order/@lastName") int amount,
>@XPath("order/@city") String customer) {
> StringBuilder sb = new StringBuilder();
> sb.append("insert into examen.user ");
> sb.append("(name, lastname, city) values (");
> sb.append("'").append(name).append("', ");
> sb.append("'").append(amount).append("', ");
> sb.append("'").append(customer).append("') ");
> return sb.toString();
> }
> }
> **SfinPull***/
> public class SfinPull {
>
> public void Pull(String s) throws SQLException,
> ClassNotFoundException{
>
>  String url = "jdbc:mysql://localhost:3306/examen";
>  String login = "root";
>  String pass = "";
>  Class.forName("com.mysql.jdbc.Driver");
>  Connection connection = DriverManager.getConnection(url, login,
> pass);
>  PreparedStatement ps=connection.prepareStatement(s);
> ps.executeUpdate();
>
> }
>
> }
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/bean-dont-work-tp5729509.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--


Re: Permanent Suspension of Routes

2013-03-22 Thread Christian Müller
Yeah, that sounds good...

Best,
Christian

On Fri, Mar 22, 2013 at 7:55 AM, Claus Ibsen  wrote:

> On Thu, Mar 21, 2013 at 2:20 PM, sushil_vsk5 
> wrote:
> > Hello:
> > I have been able to successfully suspend and resume routes using the
> > relevant JMX operations. However, when the container [app server] is
> > restarted, the routes again start up which I do not want. I want that
> > whatever routes have been suspended should remain so even after server
> > restarts till the time I explicitly resume them again. Is it possible to
> > implement this somehow?
> > Regards,
> > Sushil
> >
>
> I guess setting autoStartup false on camel context.
> And use an event listener, and listen when camel has been started.
>
> And then load from a persisten store the data that tells you which
> routes to start.
> Then start them using the api on CamelContext.
>
> And the even listener allows you to keep track when a route is stopped
> also. Then you can update
> your persisten store to reflect that change.
>
> A little example about the event notifier is here
>
> http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html
>
> And the even objects we have is in this package
>
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/event/package-summary.html
>
>
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Permanent-Suspension-of-Routes-tp5729614.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>



--


Re: How to gave version to camel context file ?

2013-03-22 Thread Christian Müller
See the Spring deployer section at
https://cwiki.apache.org/KARAF/44-deployer.html
You have to add:


  Bundle-Version: 1.0.0


Another (easier) solution is to rename your file from camel-context.xml to
camel-context-1.0.0.xml.

Best,
Christian

On Fri, Mar 22, 2013 at 4:57 AM, sarfaraj  wrote:

> Hi
>
> I have camel context file with some route logic. I have deployed that on
> servicemix but I see it has 0.0.0 version by default. (see below)
>
> 
>
> Can I add version (like 1.0.0) to that camel context file ? I have only
> camel file no other project structure, even dont have pom.xml. I know
> version is related to maven and this is just camel file without maven
> artifact.
>
> Is it possible ?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-gave-version-to-camel-context-file-tp5729650.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--