newbie help

2009-12-28 Thread yaog

Hi,

I am a newbie with Camel.

1. how does the routesBuilder work in IDS? simple "from" and "to in code of
course does not compile...

2. I have the following spring section:








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



 




In My Main I do this:


ApplicationContext context = new
ClassPathXmlApplicationContext("spring-camel-context.xml");
ProducerTemplate producerTemplate =
(ProducerTemplate)context.getBean("camelTemplate");
producerTemplate.sendBody("bean:compA", ExchangePattern.InOut, 
"message");


But I see it gets to compA but not to compB. what is the problem?

from logs looks like route is built ok:

Route 0: EventDrivenConsumerRoute[Endpoint[bean://compA] ->
Instrumentation:route[UnitOfWork(Channel[sendTo(Endpoint[bean://compB])])]]

Please advise.

Thanks.


-- 
View this message in context: 
http://old.nabble.com/newbie-help-tp26951866p26951866.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Issue in upload with Camel

2009-12-28 Thread Hebert Hu

I started the upload like this

CamelContext context = new DefaultCamelContext();
RouteBuilder route = createRouteBuilder();
context.addRoutes(route);
context.start();

I'm able to get the route service status by 
RouteDefinition definition = context.getRouteDefinitions().get(0);
context.getRouteStatus(definition)

But how can I tell whther the upload is finished?
As I always get "Started" even the upload is finished.


Hebert Hu wrote:
> 
> Hi, 
> 
> I've encountered a strange problem when using Camel Sftp component for
> uploading.
> 
> Here's my code
> 
> protected RouteBuilder createRouteBuilder() throws Exception {
> return new RouteBuilder() {
> public void configure() throws Exception {
> from("file:c:\\uploadfiles?noop=true").to(getFtpUrl());
> from(getFtpUrl()).to("mock:result");
> }
> };
> }
> 
> private String getFtpUrl(){
>   return
> "sftp://usern...@sftpserver/ftpload?password=password&binary=true&knownHostsFile=c://.ssh//known_hosts";;
>   }
> 
> The problem is: When I start my upload procedure, for the files in the
> c:\uploadfiles (multiples files), some of them will create a .camellock
> file while others not. As in the remote server, some of the files that
> have a .camellock copy will be uploaded while others not. Noted that not
> all the files that has .camellock copies will be uploaded. And an
> exception is thrown
> SEVERE: Cannot retrieve file: ftpload/a.txt
> org.apache.camel.component.file.GenericFileOperationFailedException:
> Cannot retrieve file: ftpload/a.txt
>   at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:326)
>   at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:312)
>   at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:183)
>   at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:120)
>   at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:93)
>   at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:99)
>   at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
>   at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)
>   at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>   at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:80)
>   at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:157)
>   at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:181)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>   at java.lang.Thread.run(Thread.java:799)
> When I run the upload procedure again, more .camellock files appeared,
> more files been uploaded, and the exception is still thrown.
> For example. 10 files in c:\uploadfiles, run the upload for the first
> time, 5 .camellock appeared, 1 file with .camellock uploaded, and an
> exception. Run for the second time, 2 more .camellock appeared, 1 more
> file uploaded, and an exception again.
> 
> I'm using Camel-core 2.0.0, camel-ftp 2.0.0
> 
> Can any one shed some light on me?
> 

-- 
View this message in context: 
http://old.nabble.com/Issue-in-upload-with-Camel-tp26940685p26951787.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Startup invocation of a route

2009-12-28 Thread Stephen Gargan
Christopher,

Claus has got you covered ;) There is an EventNotification mechanism
that you can use. Add the following to your routes configure

public class InvokedOnStartupRoute extends RouteBuilder {

@Override
public void configure() throws Exception {
final CamelContext context = getContext();
context.getManagementStrategy().setEventNotifier(new EventNotifier() {
public void notify(EventObject event) throws Exception {
   if(event instanceof CamelContextStartedEvent)
   {
   ProducerTemplate template = context.createProducerTemplate();
   template.sendBody("direct:invokedOnStartup", "Started");
   }
}
public boolean isEnabled(EventObject event) {
return true;
}
});
from("direct:invokedOnStartup").to("mock:invokedOnStartup");
}
}

It might be nice also if there were a method in the LifecycleStrategy
interface, onInitializationComplete or the like, that fit a similar
purpose. I'll let Claus comment on that.

rgds,

ste


On Mon, Dec 28, 2009 at 6:06 PM, huntc  wrote:
>
> Hi Stephen,
>
> Thanks for your response.
>
> I do understand the use of the direct component, but thanks for the
> explanation any how.
>
> I guess using the Spring Events mechanism will get me there, but it'd be
> nice to codify the solution in a way that remains agnostic of being invoked
> from Spring.
>
> I'm thinking that it'd be useful to raise a JIRA so that RouteBuilder gets
> the opportunity of kicking things off once the context is ready. What'd
> think?
>
> BTW: I do not have a Main class as I'm using org.apache.camel.spring.Main.
>
> Kind regards,
> Christopher
> --
> View this message in context: 
> http://old.nabble.com/Startup-invocation-of-a-route-tp26949232p26950280.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


Re: Issue in upload with Camel

2009-12-28 Thread Willem Jiang

How did you trigger the uploading thread ?
You can let the main thread wait for your uploading thread, if you start 
the uploading thread from the main thread.


Willem


Hebert Hu wrote:
Thanks for your swift reply. 
I think I found the problem just due to the uploading and downloading at the

sametime.
One more question, it seems that the uploading process is runing on a
separate thread. Sometimes the main program finishes before the uploading
thread returns, that stops the uploading. How I can prevent
such situation?

Hebert Hu wrote:
Hi, 


I've encountered a strange problem when using Camel Sftp component for
uploading.

Here's my code

protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("file:c:\\uploadfiles?noop=true").to(getFtpUrl());
from(getFtpUrl()).to("mock:result");
}
};
}

private String getFtpUrl(){
return
"sftp://usern...@sftpserver/ftpload?password=password&binary=true&knownHostsFile=c://.ssh//known_hosts";;
}

The problem is: When I start my upload procedure, for the files in the
c:\uploadfiles (multiples files), some of them will create a .camellock
file while others not. As in the remote server, some of the files that
have a .camellock copy will be uploaded while others not. Noted that not
all the files that has .camellock copies will be uploaded. And an
exception is thrown
SEVERE: Cannot retrieve file: ftpload/a.txt
org.apache.camel.component.file.GenericFileOperationFailedException:
Cannot retrieve file: ftpload/a.txt
at
org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:326)
at
org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:312)
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:183)
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:120)
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:93)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:99)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:80)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:157)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:799)
When I run the upload procedure again, more .camellock files appeared,
more files been uploaded, and the exception is still thrown.
For example. 10 files in c:\uploadfiles, run the upload for the first
time, 5 .camellock appeared, 1 file with .camellock uploaded, and an
exception. Run for the second time, 2 more .camellock appeared, 1 more
file uploaded, and an exception again.

I'm using Camel-core 2.0.0, camel-ftp 2.0.0

Can any one shed some light on me?







Re: Issue in upload with Camel

2009-12-28 Thread Hebert Hu

Thanks for your swift reply. 
I think I found the problem just due to the uploading and downloading at the
sametime.
One more question, it seems that the uploading process is runing on a
separate thread. Sometimes the main program finishes before the uploading
thread returns, that stops the uploading. How I can prevent
such situation?

Hebert Hu wrote:
> 
> Hi, 
> 
> I've encountered a strange problem when using Camel Sftp component for
> uploading.
> 
> Here's my code
> 
> protected RouteBuilder createRouteBuilder() throws Exception {
> return new RouteBuilder() {
> public void configure() throws Exception {
> from("file:c:\\uploadfiles?noop=true").to(getFtpUrl());
> from(getFtpUrl()).to("mock:result");
> }
> };
> }
> 
> private String getFtpUrl(){
>   return
> "sftp://usern...@sftpserver/ftpload?password=password&binary=true&knownHostsFile=c://.ssh//known_hosts";;
>   }
> 
> The problem is: When I start my upload procedure, for the files in the
> c:\uploadfiles (multiples files), some of them will create a .camellock
> file while others not. As in the remote server, some of the files that
> have a .camellock copy will be uploaded while others not. Noted that not
> all the files that has .camellock copies will be uploaded. And an
> exception is thrown
> SEVERE: Cannot retrieve file: ftpload/a.txt
> org.apache.camel.component.file.GenericFileOperationFailedException:
> Cannot retrieve file: ftpload/a.txt
>   at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:326)
>   at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:312)
>   at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:183)
>   at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:120)
>   at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:93)
>   at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:99)
>   at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
>   at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)
>   at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>   at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:80)
>   at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:157)
>   at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:181)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>   at java.lang.Thread.run(Thread.java:799)
> When I run the upload procedure again, more .camellock files appeared,
> more files been uploaded, and the exception is still thrown.
> For example. 10 files in c:\uploadfiles, run the upload for the first
> time, 5 .camellock appeared, 1 file with .camellock uploaded, and an
> exception. Run for the second time, 2 more .camellock appeared, 1 more
> file uploaded, and an exception again.
> 
> I'm using Camel-core 2.0.0, camel-ftp 2.0.0
> 
> Can any one shed some light on me?
> 

-- 
View this message in context: 
http://old.nabble.com/Issue-in-upload-with-Camel-tp26940685p26950356.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Startup invocation of a route

2009-12-28 Thread huntc

Hi Stephen,

Thanks for your response.

I do understand the use of the direct component, but thanks for the
explanation any how.

I guess using the Spring Events mechanism will get me there, but it'd be
nice to codify the solution in a way that remains agnostic of being invoked
from Spring.

I'm thinking that it'd be useful to raise a JIRA so that RouteBuilder gets
the opportunity of kicking things off once the context is ready. What'd
think?

BTW: I do not have a Main class as I'm using org.apache.camel.spring.Main.

Kind regards,
Christopher
-- 
View this message in context: 
http://old.nabble.com/Startup-invocation-of-a-route-tp26949232p26950280.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: camel-xmpp througth proxy

2009-12-28 Thread Willem Jiang

Hi,

I just did a quick search and find Smack API 3.1.0 (which is not finally 
released yet) supports the proxy setting[1].
And now we use the Smack API 3.0.4 in camel-xmpp component, and it 
doesn't support the proxy setting.


Please feel free to submit a upgrading patch for it :)

[1]http://www.igniterealtime.org/issues/browse/SMACK-226

Willem


Claus Ibsen wrote:

Hi

Check out the XMPP Smack API which is used for the XMPP stuff, whether
it supports http proxy and how it does.


On Wed, Dec 23, 2009 at 10:00 AM, Aleksey Masny  wrote:

Hello all!

My route:
from("stream:in?promptMessage=You message:
").to("xmpp://pi...@qip.ru/aleksey.ma...@gmail.com?password=xx");

My problem:
At home, without proxy server, this route send message to
aleksey.ma...@gmail.com sucessfull.
But at office computer, with proxy server, xmpp component throw exception
after try to connect, and message not send.

Tracer INFO  2e15772d-07ff-48e7-b720-0708c4aee90e

(route1) from(stream://in?promptMessage=You message: ) -->

xmpp://pi...@qip.ru/aleksey.ma...@gmail.com?password=xx <<<
Pattern:InOnly, BodyType:String, Body:mymessage
XmppPrivateChatProducerDEBUG Creating XmppPrivateChatProducer to
participant aleksey.ma...@gmail.com
DefaultManagementAgent DEBUG Registered MBean with objectname:
org.apache.camel:context=masny/camelContext,type=producers,name=XmppPrivateChatProducer(0x14627a)
XmppPrivateChatProducerDEBUG Starting producer:
Producer[xmpp://pi...@qip.ru/aleksey.ma...@gmail.com?password=xx]
ProducerCache  DEBUG Adding to producer cache with key:
Endpoint[xmpp://pi...@qip.ru/aleksey.ma...@gmail.com?password=xx] for
producer:
Producer[xmpp://pi...@qip.ru/aleksey.ma...@gmail.com?password=xx]
DefaultErrorHandlerDEBUG Failed delivery for exchangeId:
2e15772d-07ff-48e7-b720-0708c4aee90e. On delivery attempt: 0 caught:
java.lang.NullPointerException
DefaultErrorHandlerDEBUG This exchange is not handled so its
marked as failed: Exchange[Message: mymessage]

I try to set proxy before init Camel
   public static void main(String... args) throws Exception {

   System.getProperties().put("proxySet", "true");
   System.getProperties().put("proxyHost", "127.0.0.1");
   System.getProperties().put("proxyPort", "8989");

   Main.main(args);
   }

But message not sended.

I try to set VM parameters when running my route
-DproxyHost="osaka.mti.net"
-DproxyPort=3128
Yes, message not sended also.

How settings proxy for camel-xmpp component?

For example, in camel-http component have own proxy settings.
Sorry my English.
--
View this message in context: 
http://old.nabble.com/camel-xmpp-througth-proxy-tp26897637p26897637.html
Sent from the Camel - Users mailing list archive at Nabble.com.










Re: Startup invocation of a route

2009-12-28 Thread Stephen Gargan
Hi,

So I like to think of "direct" endpoints as internal connectors for
for linking routes. They are a great way of decoupling the business
and workflow logic in your routes from the transport related logic.

Say for instance your service that Quartz executes is defined in a
bean 'myservice'. You might have a route that looks very like

from("quartz://services/myService?trigger.repeatInterval=1").to("bean:myService");

you could decouple the bean invocation from the quartz trigger as follows.

from("quartz://services/myService?trigger.repeatInterval=1").to("direct:my-service-in");
from("direct:my-service-in").to("bean:myservice");

the choice of "direct:my-service-in" as the name is entirely
arbitrary, as arbitrary as "direct:start" in lots of the tests. But as
it appears in the 'to' of one route and the 'from' in another the two
routes are now linked with this virtual channel and when the quartz
endpoint fires it will drive the direct endpoint which will
synchronously drive the bean my service.

Why would you want to do this? well think about testing your routes.
You have your business logic route which can now be very easily driven
and tested by sending exchanges to this "direct:my-service-in" with no
need to setup much transport logic. This makes for cheaper cleaner
route tests as you can test the transport and logic independently.

Getting back to your scenario, you want to be able to invoke the
service route on startup. Now that you have decoupled the routes you
can simply add another route that also sends an exchange 'to' the
"direct:my-service-in" uri when your app starts.

If you're using spring you get this very cheaply as the
SpringCamelContext will kick off a spring event when the context
starts. You could create a route to consume this spring event and
forward it to your service via its direct uri

from("spring-event:default").to("direct:my-service-in"); // note you
may need to filter the kinds of spring events you want to trigger the
service.

or you could just use a producer template to fire it in your main
class after everything is set up.

template.sendBody("direct:my-service-in"", "Inital invocation or whatever");

Main take away is that direct endpoints are your friend and great for
decoupling.

Hope this helps, shout back if not.

ste


On Mon, Dec 28, 2009 at 3:29 PM, huntc  wrote:
>
> One thing that has always eluded me is how to specify that something be done
> immediately upon the CamelContext having started up.
>
> For example, I have a Quartz based service that executes every hour at 10
> minutes past the hour. However when the CamelContext starts up I'd like this
> service to be invoked immediately and then go into its scheduling behaviour.
> This is so that other consumers of the services I provide can get their data
> immediately without having to wait up to an hour given service startup.
>
> Firstly it'd be great if there was an option on the Quartz component to
> always fire off an initial event. However in general terms it'd be great to
> have the ability to specify that a route is invoked upon the CamelContext
> having been established (with all of its routes configured within the
> current RouterBuilder). Perhaps RouteBuilder needs a new overide-able method
> that is invoked in this situation.
>
> Incidentally I see many references to from("direct:start") throughout the
> doco and examples, but no idea of how this route is invoked.
>
> Thanks for any help in unwinding my confusion.
> --
> View this message in context: 
> http://old.nabble.com/Startup-invocation-of-a-route-tp26949232p26949232.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Startup invocation of a route

2009-12-28 Thread huntc

One thing that has always eluded me is how to specify that something be done
immediately upon the CamelContext having started up.

For example, I have a Quartz based service that executes every hour at 10
minutes past the hour. However when the CamelContext starts up I'd like this
service to be invoked immediately and then go into its scheduling behaviour.
This is so that other consumers of the services I provide can get their data
immediately without having to wait up to an hour given service startup.

Firstly it'd be great if there was an option on the Quartz component to
always fire off an initial event. However in general terms it'd be great to
have the ability to specify that a route is invoked upon the CamelContext
having been established (with all of its routes configured within the
current RouterBuilder). Perhaps RouteBuilder needs a new overide-able method
that is invoked in this situation.

Incidentally I see many references to from("direct:start") throughout the
doco and examples, but no idea of how this route is invoked.

Thanks for any help in unwinding my confusion.
-- 
View this message in context: 
http://old.nabble.com/Startup-invocation-of-a-route-tp26949232p26949232.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: question: ActiveMQ component - optimization technics

2009-12-28 Thread Nick Chistyakov
Yes, Claus :) I understand :) No offense meant!


On Mon, Dec 28, 2009 at 9:32 PM, Claus Ibsen  wrote:

> On Mon, Dec 28, 2009 at 3:24 PM, Nick Chistyakov 
> wrote:
> > Hi Claus!
> >
> > Not the easiest way to get to know it :)))
> > But thanks!
>
> This is not the final answer. The people who created the component may
> have more details about the optimizations etc.
>
> I personally dont have the time to track that down. And with open
> source we all got the source at hand to take a peek :)
>
>
>
> >
> > Best regards,
> > Nick
> >
> > On Mon, Dec 28, 2009 at 11:57 AM, Claus Ibsen 
> wrote:
> >
> >> Hi
> >>
> >>
> >> On Sun, Dec 27, 2009 at 6:42 PM, Nick Chistyakov 
> >> wrote:
> >> > Hello guys,
> >> >
> >> > Merry christmas! Hope you are having a good time!
> >> >
> >> > Sometimes, reading the project documentation, I come across the
> >> declarations
> >> > that the ActiveMQ component of Camel project is set up with a number
> of
> >> > optimizations in mind,
> >> >
> >> > Can you please be more concrete - what kind of optimizations?
> >> > Where can I read more about it?
> >> >
> >> Check the source code :)
> >>
> >> As I know it its pre configured to work with AMQ over generic JMS.
> >> So its just retrofitted to work better with AMQ than it would with a
> >> plain JMS configuration.
> >>
> >>
> >>
> >> >
> >> > Best regards,
> >> > Nick
> >> >
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> Apache Camel Committer
> >>
> >> Author of Camel in Action: http://www.manning.com/ibsen/
> >> Open Source Integration: http://fusesource.com
> >> Blog: http://davsclaus.blogspot.com/
> >> Twitter: http://twitter.com/davsclaus
> >>
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>


Re: question: ActiveMQ component - optimization technics

2009-12-28 Thread Claus Ibsen
On Mon, Dec 28, 2009 at 3:24 PM, Nick Chistyakov  wrote:
> Hi Claus!
>
> Not the easiest way to get to know it :)))
> But thanks!

This is not the final answer. The people who created the component may
have more details about the optimizations etc.

I personally dont have the time to track that down. And with open
source we all got the source at hand to take a peek :)



>
> Best regards,
> Nick
>
> On Mon, Dec 28, 2009 at 11:57 AM, Claus Ibsen  wrote:
>
>> Hi
>>
>>
>> On Sun, Dec 27, 2009 at 6:42 PM, Nick Chistyakov 
>> wrote:
>> > Hello guys,
>> >
>> > Merry christmas! Hope you are having a good time!
>> >
>> > Sometimes, reading the project documentation, I come across the
>> declarations
>> > that the ActiveMQ component of Camel project is set up with a number of
>> > optimizations in mind,
>> >
>> > Can you please be more concrete - what kind of optimizations?
>> > Where can I read more about it?
>> >
>> Check the source code :)
>>
>> As I know it its pre configured to work with AMQ over generic JMS.
>> So its just retrofitted to work better with AMQ than it would with a
>> plain JMS configuration.
>>
>>
>>
>> >
>> > Best regards,
>> > Nick
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: question: ActiveMQ component - optimization technics

2009-12-28 Thread Nick Chistyakov
Hi Claus!

Not the easiest way to get to know it :)))
But thanks!

Best regards,
Nick

On Mon, Dec 28, 2009 at 11:57 AM, Claus Ibsen  wrote:

> Hi
>
>
> On Sun, Dec 27, 2009 at 6:42 PM, Nick Chistyakov 
> wrote:
> > Hello guys,
> >
> > Merry christmas! Hope you are having a good time!
> >
> > Sometimes, reading the project documentation, I come across the
> declarations
> > that the ActiveMQ component of Camel project is set up with a number of
> > optimizations in mind,
> >
> > Can you please be more concrete - what kind of optimizations?
> > Where can I read more about it?
> >
> Check the source code :)
>
> As I know it its pre configured to work with AMQ over generic JMS.
> So its just retrofitted to work better with AMQ than it would with a
> plain JMS configuration.
>
>
>
> >
> > Best regards,
> > Nick
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>


Re: CAMEL and WebDAV ?

2009-12-28 Thread Claus Ibsen
Hi

There is also Milton
http://milton.ettrema.com/index.html

Its Apache licensed so we can create a component for it and have it in
the Camel kit.

But I guess if JackRabbit is on the WebDav wagon you can maybe use camel-jcr?
http://camel.apache.org/jcr


On Tue, Dec 22, 2009 at 9:01 AM, Charles Moulliard  wrote:
> Hi Ali,
>
> Have you had a look to JackRabbit project. It proposes a WebDav
> client/server
>
> http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webdav/README.txt
>
> Maybe this could be helpful for you and camel community
>
> Have a nice Christmas too.
>
> Regards,
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *
> blog : http://cmoulliard.blogspot.com
> twitter : http://twitter.com/cmoulliard
> Linkedlin : http://www.linkedin.com/in/charlesmoulliard
>
> Apache Camel Group :
> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
>
>
> On Mon, Dec 21, 2009 at 6:52 PM, S. Ali Tokmen 
> wrote:
>
>> Hello
>>
>> Le 21/12/2009 15:07, Charles Moulliard a écrit :
>>
>>  Here is the answer of claus -->
>>> http://www.mail-archive.com/users@camel.apache.org/msg04835.html
>>>
>>>
>>
>> Pity things didn't evolve since :(
>>
>> On http://commons.apache.org/vfs/ I can see they have a good, easy to
>> connect WebDAV connector. But, it is still in SNAPSHOT form for some reason
>> that I don't understand.
>>
>> For the server side, http://sourceforge.net/projects/webdav-servlet/ works
>> pretty well. It is a servlet, without dependencies.
>>
>> Anyways, have a nice Christmas
>>
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Issue in upload with Camel

2009-12-28 Thread Claus Ibsen
Hi

And uploading and downloading at the *same* time from the same JVM may
not be a good idea. You may start to download files while they are
being uploaded. I wonder if the FTP server supports locking the file
during upload process.

You can use tempPrefix to upload the files with a inprogress filename
and filter that name on the download side so you do not pick up files
being uploaded.

The options from file2 is also avail for the FTP
http://camel.apache.org/file2.html
http://camel.apache.org/ftp2.html


On Mon, Dec 28, 2009 at 9:18 AM, Hebert Hu  wrote:
>
> Hi,
>
> I've encountered a strange problem when using Camel Sftp component for
> uploading.
>
> Here's my code
>
>    protected RouteBuilder createRouteBuilder() throws Exception {
>        return new RouteBuilder() {
>            public void configure() throws Exception {
>                from("file:c:\\uploadfiles?noop=true").to(getFtpUrl());
>                from(getFtpUrl()).to("mock:result");
>            }
>        };
>    }
>
> private String getFtpUrl(){
>        return
> "sftp://usern...@sftpserver/ftpload?password=password&binary=true&knownHostsFile=c://.ssh//known_hosts";;
>        }
>
> The problem is: When I start my upload procedure, for the files in the
> c:\uploadfiles (multiples files), some of them will create a .camellock file
> while others not. As in the remote server, some of the files that have a
> .camellock copy will be uploaded while others not. Noted that not all the
> files that has .camellock copies will be uploaded. And an exception is
> thrown
> SEVERE: Cannot retrieve file: ftpload/a.txt
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> retrieve file: ftpload/a.txt
>        at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:326)
>        at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:312)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:183)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:120)
>        at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:93)
>        at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:99)
>        at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
>        at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)
>        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:80)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:157)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:181)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>        at java.lang.Thread.run(Thread.java:799)
> When I run the upload procedure again, more .camellock files appeared, more
> files been uploaded, and the exception is still thrown.
> For example. 10 files in c:\uploadfiles, run the upload for the first time,
> 5 .camellock appeared, 1 file with .camellock uploaded, and an exception.
> Run for the second time, 2 more .camellock appeared, 1 more file uploaded,
> and an exception again.
>
> Can any one shed some light on me?
> --
> View this message in context: 
> http://old.nabble.com/Issue-in-upload-with-Camel-tp26940685p26940685.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Issue in upload with Camel

2009-12-28 Thread Claus Ibsen
Hi

What version of Camel are you using?

I can see you are using Windows which have some issues with its file
system locking files.
We have made some recent fixes in the 2.2 trunk code and 2.1 as well.
So try with latest version.



On Mon, Dec 28, 2009 at 9:18 AM, Hebert Hu  wrote:
>
> Hi,
>
> I've encountered a strange problem when using Camel Sftp component for
> uploading.
>
> Here's my code
>
>    protected RouteBuilder createRouteBuilder() throws Exception {
>        return new RouteBuilder() {
>            public void configure() throws Exception {
>                from("file:c:\\uploadfiles?noop=true").to(getFtpUrl());
>                from(getFtpUrl()).to("mock:result");
>            }
>        };
>    }
>
> private String getFtpUrl(){
>        return
> "sftp://usern...@sftpserver/ftpload?password=password&binary=true&knownHostsFile=c://.ssh//known_hosts";;
>        }
>
> The problem is: When I start my upload procedure, for the files in the
> c:\uploadfiles (multiples files), some of them will create a .camellock file
> while others not. As in the remote server, some of the files that have a
> .camellock copy will be uploaded while others not. Noted that not all the
> files that has .camellock copies will be uploaded. And an exception is
> thrown
> SEVERE: Cannot retrieve file: ftpload/a.txt
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> retrieve file: ftpload/a.txt
>        at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:326)
>        at
> org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:312)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:183)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:120)
>        at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:93)
>        at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:99)
>        at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
>        at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)
>        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:80)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:157)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:181)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>        at java.lang.Thread.run(Thread.java:799)
> When I run the upload procedure again, more .camellock files appeared, more
> files been uploaded, and the exception is still thrown.
> For example. 10 files in c:\uploadfiles, run the upload for the first time,
> 5 .camellock appeared, 1 file with .camellock uploaded, and an exception.
> Run for the second time, 2 more .camellock appeared, 1 more file uploaded,
> and an exception again.
>
> Can any one shed some light on me?
> --
> View this message in context: 
> http://old.nabble.com/Issue-in-upload-with-Camel-tp26940685p26940685.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: question: ActiveMQ component - optimization technics

2009-12-28 Thread Claus Ibsen
Hi


On Sun, Dec 27, 2009 at 6:42 PM, Nick Chistyakov  wrote:
> Hello guys,
>
> Merry christmas! Hope you are having a good time!
>
> Sometimes, reading the project documentation, I come across the declarations
> that the ActiveMQ component of Camel project is set up with a number of
> optimizations in mind,
>
> Can you please be more concrete - what kind of optimizations?
> Where can I read more about it?
>
Check the source code :)

As I know it its pre configured to work with AMQ over generic JMS.
So its just retrofitted to work better with AMQ than it would with a
plain JMS configuration.



>
> Best regards,
> Nick
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Issue in upload with Camel

2009-12-28 Thread Hebert Hu

Hi, 

I've encountered a strange problem when using Camel Sftp component for
uploading.

Here's my code

protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("file:c:\\uploadfiles?noop=true").to(getFtpUrl());
from(getFtpUrl()).to("mock:result");
}
};
}

private String getFtpUrl(){
return
"sftp://usern...@sftpserver/ftpload?password=password&binary=true&knownHostsFile=c://.ssh//known_hosts";;
}

The problem is: When I start my upload procedure, for the files in the
c:\uploadfiles (multiples files), some of them will create a .camellock file
while others not. As in the remote server, some of the files that have a
.camellock copy will be uploaded while others not. Noted that not all the
files that has .camellock copies will be uploaded. And an exception is
thrown
SEVERE: Cannot retrieve file: ftpload/a.txt
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
retrieve file: ftpload/a.txt
at
org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:326)
at
org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:312)
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:183)
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:120)
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:93)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:99)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:295)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:80)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:157)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:799)
When I run the upload procedure again, more .camellock files appeared, more
files been uploaded, and the exception is still thrown.
For example. 10 files in c:\uploadfiles, run the upload for the first time,
5 .camellock appeared, 1 file with .camellock uploaded, and an exception.
Run for the second time, 2 more .camellock appeared, 1 more file uploaded,
and an exception again.

Can any one shed some light on me?
-- 
View this message in context: 
http://old.nabble.com/Issue-in-upload-with-Camel-tp26940685p26940685.html
Sent from the Camel - Users mailing list archive at Nabble.com.