Re: Programmatically creating endpoints

2010-10-18 Thread Jean-Baptiste Onofré

Hi Bruno,

No sure to have fully understood what's your problem.

Anyway, you can create the route in a RouteBuilder.

public void myRouteBuilder(String endpoint1Name, String arg1, String 
value1) {

RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from(seda: + endpoint1Name + ? + arg1 + = + value1);
  }
}
}

Regards
JB

On 10/18/2010 10:19 AM, Bruno Dusausoy wrote:

Hi,

I have a small application which uses file and mail components.
I pass some endpoints parameters to the application via the command-line
arguments that are then parsed (thanks to the excellent JCommander lib,
BTW).
In order to create the routes (and the endpoints) I must concatenate
some strings.
Is there another way to create endpoints, like programmatically ?

I've been able to successfully create file endpoints entirely
programmatically thanks to the FileEndpoint class, but I've not been
able to see a SmtpEndpoint or something similar.

Is the only way of creating endpoints by going through string
concatenation ?

Regards.
--
Bruno Dusausoy
YP5 Software

--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.


AW: Programmatically creating endpoints

2010-10-18 Thread Schneider Christian
Hi Bruno,

in the case of the mail component the endpoint is called MailEndpoint. It will 
be able to handle the uri prefixes of smtp, pop3 and imap. As these things are 
not so well documented in the wiki you best look into the respective component 
source to see how it works programmatically. Normally a component is quite 
small so it is quite easy to understand the sources.

Best Regards

Christian
 




Christian Schneider
Informationsverarbeitung 
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-Ursprüngliche Nachricht-
Von: Bruno Dusausoy [mailto:bdusau...@yp5.be] 
Gesendet: Montag, 18. Oktober 2010 10:19
An: Camel Users ML
Betreff: Programmatically creating endpoints

Hi,

I have a small application which uses file and mail components.
I pass some endpoints parameters to the application via the 
command-line arguments that are then parsed (thanks to the excellent 
JCommander lib, BTW).
In order to create the routes (and the endpoints) I must concatenate 
some strings.
Is there another way to create endpoints, like programmatically ?

I've been able to successfully create file endpoints entirely 
programmatically thanks to the FileEndpoint class, but I've not been 
able to see a SmtpEndpoint or something similar.

Is the only way of creating endpoints by going through string 
concatenation ?

Regards.
--
Bruno Dusausoy
YP5 Software

--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.


Re: AW: Programmatically creating endpoints

2010-10-18 Thread Bruno Dusausoy
On Mon, 18 Oct 2010 10:33:53 +0200, Schneider Christian
christian.schnei...@enbw.com wrote:
 Hi Bruno,
 
 in the case of the mail component the endpoint is called
 MailEndpoint. It will be able to handle the uri prefixes of smtp, pop3
 and imap. As these things are not so well documented in the wiki you
 best look into the respective component source to see how it works
 programmatically. Normally a component is quite small so it is quite
 easy to understand the sources.
 

Nice !
Actually I was being confused by the Javadoc link which points to Camel
2.2.0 API - without even noticing it :-/ - but didn't see any
MailEndpoint.

Thanks a lot for pointing that out :).

Regards.
-- 
Bruno Dusausoy
YP5 Software
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.


[camel-exec] feature ?

2010-10-18 Thread Olivier.Roger

Hello Camel,

I am using Camel 2.4 with has the camel-exec component. I wanted to deploy
it in servicemix but I cannot find a camel-exec feature.

It is possible to explain how I could create such a feature ?
I am using the Fuse distribution of servicemix.

Thanks in advance,

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


RE: [camel-exec] feature ?

2010-10-18 Thread Łukasz Dywicki
Hi Olivier,
You can install camel-exec using standard install command instead features:
ka...@root install mvn:org.apache.camel/camel-exec/version.

Lack of the feature can be submitted as issue to jira.

Best regards,
Lukasz

-Original Message-
From: Olivier.Roger [mailto:olivier.ro...@bsb.com] 
Sent: Monday, October 18, 2010 2:00 PM
To: users@camel.apache.org
Subject: [camel-exec] feature ?


Hello Camel,

I am using Camel 2.4 with has the camel-exec component. I wanted to deploy
it in servicemix but I cannot find a camel-exec feature.

It is possible to explain how I could create such a feature ?
I am using the Fuse distribution of servicemix.

Thanks in advance,

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



Re: [camel-exec] feature ?

2010-10-18 Thread Jean-Baptiste Onofré

Hi Olivier,

Camel feature 
(mvn:org.apache.camel.karaf/apache-camel/2.4.0/xml/features) doesn't 
provide the camel-exec feature.


You can define your own feature descriptor with the following (as 
commons-exec 1.0.1 is an OSGi bundle):


feature name=camel-exec version=2.4.0
  feature version=2.4.0camel-core/feature
  bundlemvn:org.apache.commons/commons-exec/1.0.1/bundle

bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io/1.4_1/bundle
  bundlemvn:commons-lang/commons-lang/2.5/bundle
  bundlemvn:org.apache.camel/camel-exec/2.4.0/bundle
/feature

I'm gonna submit a patch to Camel to include it in the feature 
descriptor (watch on CAMEL-3248).


Regards
JB

On 10/18/2010 02:00 PM, Olivier.Roger wrote:


Hello Camel,

I am using Camel 2.4 with has the camel-exec component. I wanted to deploy
it in servicemix but I cannot find a camel-exec feature.

It is possible to explain how I could create such a feature ?
I am using the Fuse distribution of servicemix.

Thanks in advance,

Olivier


Re: [camel-exec] feature ?

2010-10-18 Thread Jean-Baptiste Onofré

Hi Lukasz,

unfortunately I don't think it's enough regarding the camel-exec 
dependencies.


Regards
JB

On 10/18/2010 02:16 PM, Łukasz Dywicki wrote:

Hi Olivier,
You can install camel-exec using standard install command instead features:
ka...@root  install mvn:org.apache.camel/camel-exec/version.

Lack of the feature can be submitted as issue to jira.

Best regards,
Lukasz

-Original Message-
From: Olivier.Roger [mailto:olivier.ro...@bsb.com]
Sent: Monday, October 18, 2010 2:00 PM
To: users@camel.apache.org
Subject: [camel-exec] feature ?


Hello Camel,

I am using Camel 2.4 with has the camel-exec component. I wanted to deploy
it in servicemix but I cannot find a camel-exec feature.

It is possible to explain how I could create such a feature ?
I am using the Fuse distribution of servicemix.

Thanks in advance,

Olivier


Re: [camel-exec] feature ?

2010-10-18 Thread Olivier.Roger

That's exactly what I needed,

Thanks you both ;)
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/camel-exec-feature-tp3217295p3217457.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: [camel-exec] feature ?

2010-10-18 Thread Jean-Baptiste Onofré

No problem.

The patch has been already submitted to review.

I saw some properties/version (commons-io, etc) that should need some 
homogeneous dependency management. I will submit another patch in that way.


Regards
JB

On 10/18/2010 04:01 PM, Olivier.Roger wrote:


That's exactly what I needed,

Thanks you both ;)


Re: Loading camel-context.xml

2010-10-18 Thread Richard Kettelerij

Which version of ActiveMQ do you use? This is exception (Chunk stream does
not exist at page: 0 ) is thrown by ActiveMQ and is a known bug:
https://issues.apache.org/activemq/browse/AMQ-2935. 

It's fixed in ActiveMQ 5.5.0. Perhaps you can try using the latest snapshot
release of ActiveMQ 5.5.0 and report your findings is the ticket?

-
Richard Kettelerij,
http://github.com/rkettelerij
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Loading-camel-context-xml-tp3216112p3217813.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-18 Thread Mark Webb
will this work with the camel:dot task in maven?  If you do not
override the toString() method in your org.apache.camel.Processor, the
text in the output .png file just shows as a class instance string.



On Sat, Oct 9, 2010 at 2:03 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 Its a known issue with the tracer when it gets a bit more complex when
 using interceptors etc.
 Its listed in the known issue section in the release notes.
 And we got a couple of JIRA tickets about this.

 A rework on internals in Camel 3 should help us make this work better
 than we currently can do in 2.x.


 On Fri, Oct 8, 2010 at 11:22 PM, Christian Müller
 christian.muel...@gmail.com wrote:
 Hello Claus, hello Ade!

 I modified the test a bit on my machine. I added the following two lines to
 enable the default tracer:

 {code:java}
                context.setTracing(true);
                context.getInterceptStrategies().add(new Tracer());
 {code}

 I received the following log statements:

 {code}
 2010-10-08 23:13:14,164 [main           ] INFO
 Tracer                         -
 ID-christian-muellers-macbook-pro-local-56443-1286572393506-0-2  (foo)
 from(direct://start) -- log://foo  Pattern:InOnly, BodyType:String,
 Body:Hello World
 2010-10-08 23:13:14,165 [main           ] INFO
 foo                            - Exchange[ExchangePattern:InOnly,
 BodyType:String, Body:Hello World]
 2010-10-08 23:13:14,168 [main           ] INFO
 Tracer                         -
 ID-christian-muellers-macbook-pro-local-56443-1286572393506-0-2  (foo)
 log://foo -- 
 org.apache.camel.processor.inlinedprocessoridtest$...@786c1a82
 Pattern:InOnly, BodyType:String, Body:Hello World
 2010-10-08 23:13:14,169 [main           ] INFO
 Tracer                         -
 ID-christian-muellers-macbook-pro-local-56443-1286572393506-0-2  (foo)
 org.apache.camel.processor.inlinedprocessoridtest$...@786c1a82 --
 mock://result  Pattern:InOnly, Headers:{foo=123}, BodyType:String,
 Body:Hello World
 {code}

 That's not what we want, is it? Instead of log://foo --
 org.apache.camel.processor.inlinedprocessoridtest$...@786c1a82 I expected
 log -- inlined.

 Have a nice weekend,
 Christian

 P.S. Looking forward to the FUSE community day in Paris.




 --
 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 moving files to ftp

2010-10-18 Thread Gustavo Franke
Here's what I have in my RouteBuilder

public void configure() {
String localWorkFolder = /tmp/camel;

from(ftp://gust...@localhost:21/Test?password=gustavomove=.processed;).to(file://
+ localWorkFolder);
from(file:// + localWorkFolder + ?noop=true).beanRef(parser,
convert);
from(file:///tmp/camelout).to(ftp://gustavo
@localhost:21/Test/out?password=gustavofileName=${file:onlyname});
}

I'm not sure if I am missing some thing but on the java app side the files
are generated properly, those files should be copied to the ftp.
But for some reason, on the ftp side the files are generated but its content
is missing or corrupt, and I'm completely clueless regarding to this.

If I don't explicit the fileName=${file:onlyname} I get this error Error
writing file [Test/out/C:\tmp\camel\myFile.txt] being Test/out the remote
folder and C:\tmp\camel\myFile.txt path of the file. That's the reason why I
added the fileName=${file:onlyname} but I don't know why the content is
missing.

Any help would be great.
Thanks,
Gustavo


Re: File component not working with 2.5 snapshot

2010-10-18 Thread GSegel

Interesting...here's what I'm seeing:

INFO [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] (main)
Found 4 packages with 0 @Converter classes to load
INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (main) Loaded 0
type converters in 0.032 seconds


Obviously something is wrong with my environment.  Any ideas of where I need
to start looking?  I haven't used the File component in a couple months but
when I used it last it worked.  

I'm using the 2.5 snapshot release.

Thanks,
Glenn


Willem.Jiang wrote:
 
  
 Here is is mine
 
 Oct 14, 2010 10:34:31 PM 
 org.apache.camel.impl.converter.AnnotationTypeConverterLoader load
 INFO: Found 3 packages with 13 @Converter classes to load
 Oct 14, 2010 10:34:31 PM 
 org.apache.camel.impl.converter.DefaultTypeConverter loadTypeConverters
 INFO: Loaded 146 type converters in 0.429 seconds
 
 
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/File-component-not-working-with-2-5-snapshot-tp3212019p3218428.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: File component not working with 2.5 snapshot

2010-10-18 Thread Claus Ibsen
On Tue, Oct 19, 2010 at 4:17 AM, GSegel gsegel...@itsfac.com wrote:

 Interesting...here's what I'm seeing:

 INFO [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] (main)
 Found 4 packages with 0 @Converter classes to load
 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (main) Loaded 0
 type converters in 0.032 seconds


 Obviously something is wrong with my environment.  Any ideas of where I need
 to start looking?  I haven't used the File component in a couple months but
 when I used it last it worked.


What is your environment? OS, JDK, How do you start Camel?


 I'm using the 2.5 snapshot release.

 Thanks,
 Glenn


 Willem.Jiang wrote:


 Here is is mine

 Oct 14, 2010 10:34:31 PM
 org.apache.camel.impl.converter.AnnotationTypeConverterLoader load
 INFO: Found 3 packages with 13 @Converter classes to load
 Oct 14, 2010 10:34:31 PM
 org.apache.camel.impl.converter.DefaultTypeConverter loadTypeConverters
 INFO: Loaded 146 type converters in 0.429 seconds


 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/File-component-not-working-with-2-5-snapshot-tp3212019p3218428.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 moving files to ftp

2010-10-18 Thread Willem Jiang

Did you wrote the file into /tmp/camelout ?
I didn't find any route which will put the files into /tmp/camelout 
directory.


On 10/19/10 5:56 AM, Gustavo Franke wrote:

Here's what I have in my RouteBuilder

public void configure() {
 String localWorkFolder = /tmp/camel;
 
from(ftp://gust...@localhost:21/Test?password=gustavomove=.processed;).to(file://
+ localWorkFolder);
 from(file:// + localWorkFolder + ?noop=true).beanRef(parser,
convert);
 from(file:///tmp/camelout).to(ftp://gustavo
@localhost:21/Test/out?password=gustavofileName=${file:onlyname});
 }

I'm not sure if I am missing some thing but on the java app side the files
are generated properly, those files should be copied to the ftp.
But for some reason, on the ftp side the files are generated but its content
is missing or corrupt, and I'm completely clueless regarding to this.

If I don't explicit thefileName=${file:onlyname} I get this error Error
writing file [Test/out/C:\tmp\camel\myFile.txt] being Test/out the remote
folder and C:\tmp\camel\myFile.txt path of the file. That's the reason why I
added thefileName=${file:onlyname} but I don't know why the content is
missing.

Any help would be great.
Thanks,
Gustavo




--
Willem
--
Open Source Integration: http://www.fusesource.com
Blog:http://willemjiang.blogspot.com (English)
 http://jnn.javaeye.com (Chinese)
Twitter: http://twitter.com/willemjiang