file-to-file copy gives unreliable results (not entire file is copied)

2015-06-02 Thread rwijngaa
Hi,

I'm trying to reproduce a problem we have in production with one of our
camel routes,
in the process i found some strange behaviour when just copying a file with
a simple
blueprint camel route (see below).

Small (zip) files seem to be copied correctly, but large files (i used
162MB) sometimes end up as 162MB (good!), 26MB, 96MB, 50MB or otherwise
corrupted. 
I played with several options (bufferSize, delay, etc) but to no avail.
I'm testing this with a clean install of ServiceMix 5.4.0 (camel 2.14.1) on
a macbookpro

This is the camel route i deployed:



Regards
Rino



--
View this message in context: 
http://camel.465427.n5.nabble.com/file-to-file-copy-gives-unreliable-results-not-entire-file-is-copied-tp5767775.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Parallel processing/multiple file consumer threads with readLock=changed and long timeout?

2015-06-02 Thread Tom Duncalf
Thanks Claus - unfortunately, there is a requirement to support existing
client workflows, which are usually not able to upload a done file
without additional development work on their end, and it seems that ProFTPD
is not able to do this automatically.

Are you aware of any way to prevent the file consumer blocking while
waiting for the changed read lock or would another approach such as one
Camel process per user directory be the recommended approach in this case?

Thanks,
Tom

Tom Duncalf / Software Developer
tomduncalf.com http://www.tomduncalf.com / @tomduncalf
http://twitter.com/tomduncalf


On 2 June 2015 at 08:12, Claus Ibsen-2 [via Camel] 
ml-node+s465427n5767770...@n5.nabble.com wrote:

 Hi

 If possible then using done file names is IMHO a better strategy.
 Though that would require the other party to do this when it uploads
 to the FTP server.



 On Mon, Jun 1, 2015 at 6:10 PM, Tom Duncalf [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5767770i=0 wrote:

  Hi,
 
  I am building a Camel route to consume files uploaded by FTP and then
 upload
  them elsewhere. It would seem that changed is the most suitable
 readLock
  strategy for this, and I would like to set a fairly large
  readLockCheckInterval and readLockTimeout (e.g. 20s and 40s) to help
 prevent
  incomplete files from users with slow/intermittent connections being
 picked
  up by the route prematurely.
 
  What I would like to achieve is to make it so that the File consumer is
 not
  blocked from picking up more files for the duration of the
 readLockTimeout -
  that is, currently, if file1 is uploaded at t=0 and file2 uploaded at
 t=5,
  then the consumer picks up file1 at t=0 and is then blocked until at
 least
  t=20 (assuming a 20s check interval), so file2 will not be picked up
 until
  at least t=20 (and processed until at least t=40). Instead, I would like
  there to be (for example) more than one consumer thread, so that when
 the
  first consumer thread picks up file1 and is waiting until t=20, another
  consumer thread can still pick up file2 at t=5 and wait until t=25.
 
  None of the concurrency options available seem to cover this scenario -
 I
  understand that I can decouple the file being consumed and the
 subsequent
  processing using, for example, a SEDA queue, or I can split the
 processing
  into multiple threads after a file has been processed by the File
 consumer
  using the Threads DSL, but I can't see how to make the consumer itself
  consume files and therefore create messages in a multi-threaded manner.
 
  One workaround may be to spawn a new process for each FTP user and have
 it
  consume from their home directory, but I would prefer to avoid this
  additional complexity and it would not gracefully handle a situation
 where
  one user uploads a large volume of files. One other option I can think
 of is
  to start multiple instances of my route somehow (to create multiple
  consumers), and then synchronise them with a shared repository for the
  inProgressRepository, but I'm not sure if that would actually work.
 
  Any input would be great - even if it is basic as I am new to Camel!
 
  Thanks,
  Tom
 
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Parallel-processing-multiple-file-consumer-threads-with-readLock-changed-and-long-timeout-tp5767753.html
  Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5767770i=1
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://camel.465427.n5.nabble.com/Parallel-processing-multiple-file-consumer-threads-with-readLock-changed-and-long-timeout-tp5767753p5767770.html
  To unsubscribe from Parallel processing/multiple file consumer threads
 with readLock=changed and long timeout?, click here
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5767753code=dG9tQHRvbWR1bmNhbGYuY29tfDU3Njc3NTN8MTAzMzMyNTM2
 .
 NAML
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=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.com/Parallel-processing-multiple-file-consumer-threads-with-readLock-changed-and-long-timeout-tp5767753p5767781.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: file-to-file copy gives unreliable results (not entire file is copied)

2015-06-02 Thread rwijngaa
When i tweak the route some more (added options readLockTimeout and
readLockCheckInterval), the succesrate seems to be 100% now. Is this
expected behaviour? I mean, you would expect the files to be copied with a
100% successrate no matter what the (timing) options right ?

Improved route:




--
View this message in context: 
http://camel.465427.n5.nabble.com/file-to-file-copy-gives-unreliable-results-not-entire-file-is-copied-tp5767775p5767783.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to react when there is a fixed period of inactivity (no traffic) in a route?

2015-06-02 Thread Claus Ibsen
Hi

I have logged a ticket to add a start timestamp then its easier for you to know
https://issues.apache.org/jira/browse/CAMEL-8824

On Tue, Jun 2, 2015 at 9:20 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 On Mon, Jun 1, 2015 at 12:26 PM, s.marjanovic
 slavisa.marjanovic...@gmail.com wrote:
 Hi,

 I managed to get around the problem by using the statistics about the last
 completed exchange and the elapsed time since last reset like this:

 Date lastCompletedExchangeTimestamp = (Date)
 camelContext.getManagementStrategy().getManagementAgent().getMBeanServer()

 .invoke(objectNameForRoute, getLastExchangeCompletedTimestamp, null,
 null);

 Date resetTimestamp = (Date)
 camelContext.getManagementStrategy().getManagementAgent().getMBeanServer()
.invoke(objectNameForRoute,
 getResetTimestamp, null, null);

 One small question though, I'm assuming that getResetTimestamp will give me
 the time that camel context was initialized or the time of the last reset of
 statistics (which doesn't concern me for now since statistics aren't being
 reset manually yet).

 When last reset.



 Am I right with my assumption? Is there anything better to replace
 getResetTimestamp with? I'm interested in obtaining camel context
 initialization timestamp here and haven't had luck finding an alternative to
 getResetTimestamp.


 You can get the uptime from the camel context.



 Thanks



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-react-when-there-is-a-fixed-period-of-inactivity-no-traffic-in-a-route-tp5767607p5767731.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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



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


Re: ConcurrentModificationException DefaulUnitOfWork.class

2015-06-02 Thread Claus Ibsen
Hi

What version of Camel do you use? And can you tell us a bit more about
which camel endpoints you use in the poll enricher?

On Mon, Jun 1, 2015 at 4:36 PM, s.lefort s.lef...@artis.fr wrote:
 Hi,

 An error occurs in the class DefaulUnitOfWork. On line 216 (it.remove) throw
 this error because
 the variable synchronizations is empty.





 This variable is cleared on method stop() called on AsyncTask. Sometimes
 this method is called before end handoverSynchronization

 Do you know this error ?

 I fixed on putting synchronized on two methods (like
 removeSynchronization, etc..)

 Regards (sorry for my english)
 Steve



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



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


Apache Camel Simple Language regex fails

2015-06-02 Thread tesla
Hi , I need a regex filter for msisdn(mobile telephone number) . I need to
check first 3 digits then i need to check 2 following digits.First 3 digits
should be 974 then following two digit should be 44.Therefore these two
msisdns should pass : tel:+97444549697 and 97444549697. So I write the
following regex : ^(tel:\+)(974)(44)|^(974)(44) 
I tested it with some regex test tools and it seems it is working but when I
try to use it with camel simple it is not working.
How I use regex is the following : ${in.header.msisdn} regex 
'^(tel:\+)(974)(44)|^(974)(44)'

What I am doing wrong?





--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-Simple-Language-regex-fails-tp5767786.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Parallel processing/multiple file consumer threads with readLock=changed and long timeout?

2015-06-02 Thread Claus Ibsen
Hi

If possible then using done file names is IMHO a better strategy.
Though that would require the other party to do this when it uploads
to the FTP server.



On Mon, Jun 1, 2015 at 6:10 PM, Tom Duncalf t...@tomduncalf.com wrote:
 Hi,

 I am building a Camel route to consume files uploaded by FTP and then upload
 them elsewhere. It would seem that changed is the most suitable readLock
 strategy for this, and I would like to set a fairly large
 readLockCheckInterval and readLockTimeout (e.g. 20s and 40s) to help prevent
 incomplete files from users with slow/intermittent connections being picked
 up by the route prematurely.

 What I would like to achieve is to make it so that the File consumer is not
 blocked from picking up more files for the duration of the readLockTimeout -
 that is, currently, if file1 is uploaded at t=0 and file2 uploaded at t=5,
 then the consumer picks up file1 at t=0 and is then blocked until at least
 t=20 (assuming a 20s check interval), so file2 will not be picked up until
 at least t=20 (and processed until at least t=40). Instead, I would like
 there to be (for example) more than one consumer thread, so that when the
 first consumer thread picks up file1 and is waiting until t=20, another
 consumer thread can still pick up file2 at t=5 and wait until t=25.

 None of the concurrency options available seem to cover this scenario - I
 understand that I can decouple the file being consumed and the subsequent
 processing using, for example, a SEDA queue, or I can split the processing
 into multiple threads after a file has been processed by the File consumer
 using the Threads DSL, but I can't see how to make the consumer itself
 consume files and therefore create messages in a multi-threaded manner.

 One workaround may be to spawn a new process for each FTP user and have it
 consume from their home directory, but I would prefer to avoid this
 additional complexity and it would not gracefully handle a situation where
 one user uploads a large volume of files. One other option I can think of is
 to start multiple instances of my route somehow (to create multiple
 consumers), and then synchronise them with a shared repository for the
 inProgressRepository, but I'm not sure if that would actually work.

 Any input would be great - even if it is basic as I am new to Camel!

 Thanks,
 Tom




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Parallel-processing-multiple-file-consumer-threads-with-readLock-changed-and-long-timeout-tp5767753.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Can simple() be made to compare strings in a case insensitive way?

2015-06-02 Thread Claus Ibsen
Hi

Yeah I am not sure if end users would be surprised if we change == to
be case insensitive for strings?

Or we could consider having =~ as an alternative comparison operator
(although =~ may not be though as insensitive operator?)

If we have a new operator or change the default behavior it would have
the performance benefit to avoid the reflection method invocation that
a .toLowerCase() would require.


Any thoughts in the community ?




On Mon, Jun 1, 2015 at 7:52 PM, s.marjanovic
slavisa.marjanovic...@gmail.com wrote:
 Hello Andrew,

 I managed to find the same information as you posted in the example,
 although without the ? part.

 Great tip about that, thanks.

 Regards,
 Slavisa



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Can-simple-be-made-to-compare-strings-in-a-case-insensitive-way-tp5767732p5767756.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: file-to-file copy gives unreliable results (not entire file is copied)

2015-06-02 Thread rwijngaa
BTW: My colleague copying a 1GB file with the same blueprint route on Windows
8 seems to have no problem at all !



--
View this message in context: 
http://camel.465427.n5.nabble.com/file-to-file-copy-gives-unreliable-results-not-entire-file-is-copied-tp5767775p5767779.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Parallel processing/multiple file consumer threads with readLock=changed and long timeout?

2015-06-02 Thread Claus Ibsen
Hi

You could either try to implement your own read lock, or alternative
try with a statefull file filter. Then in the filter you can return
false for files that hasn't waited long enough and this allow to
advance to the next file instead of blocking.

Well in fact the read lock could also be stateful. And by stateful I
mean you remember from previous time what was the last timestamp of
the file, so you can figure out whether to pickup the file or not.

We could consider adding support for stateful in the out of the box
read lock but it would maybe require a few options to control the
state cache so its size can be configured and so on.


On Tue, Jun 2, 2015 at 10:55 AM, Tom Duncalf t...@tomduncalf.com wrote:
 Thanks Claus - unfortunately, there is a requirement to support existing
 client workflows, which are usually not able to upload a done file
 without additional development work on their end, and it seems that ProFTPD
 is not able to do this automatically.

 Are you aware of any way to prevent the file consumer blocking while
 waiting for the changed read lock or would another approach such as one
 Camel process per user directory be the recommended approach in this case?

 Thanks,
 Tom

 Tom Duncalf / Software Developer
 tomduncalf.com http://www.tomduncalf.com / @tomduncalf
 http://twitter.com/tomduncalf


 On 2 June 2015 at 08:12, Claus Ibsen-2 [via Camel] 
 ml-node+s465427n5767770...@n5.nabble.com wrote:

 Hi

 If possible then using done file names is IMHO a better strategy.
 Though that would require the other party to do this when it uploads
 to the FTP server.



 On Mon, Jun 1, 2015 at 6:10 PM, Tom Duncalf [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5767770i=0 wrote:

  Hi,
 
  I am building a Camel route to consume files uploaded by FTP and then
 upload
  them elsewhere. It would seem that changed is the most suitable
 readLock
  strategy for this, and I would like to set a fairly large
  readLockCheckInterval and readLockTimeout (e.g. 20s and 40s) to help
 prevent
  incomplete files from users with slow/intermittent connections being
 picked
  up by the route prematurely.
 
  What I would like to achieve is to make it so that the File consumer is
 not
  blocked from picking up more files for the duration of the
 readLockTimeout -
  that is, currently, if file1 is uploaded at t=0 and file2 uploaded at
 t=5,
  then the consumer picks up file1 at t=0 and is then blocked until at
 least
  t=20 (assuming a 20s check interval), so file2 will not be picked up
 until
  at least t=20 (and processed until at least t=40). Instead, I would like
  there to be (for example) more than one consumer thread, so that when
 the
  first consumer thread picks up file1 and is waiting until t=20, another
  consumer thread can still pick up file2 at t=5 and wait until t=25.
 
  None of the concurrency options available seem to cover this scenario -
 I
  understand that I can decouple the file being consumed and the
 subsequent
  processing using, for example, a SEDA queue, or I can split the
 processing
  into multiple threads after a file has been processed by the File
 consumer
  using the Threads DSL, but I can't see how to make the consumer itself
  consume files and therefore create messages in a multi-threaded manner.
 
  One workaround may be to spawn a new process for each FTP user and have
 it
  consume from their home directory, but I would prefer to avoid this
  additional complexity and it would not gracefully handle a situation
 where
  one user uploads a large volume of files. One other option I can think
 of is
  to start multiple instances of my route somehow (to create multiple
  consumers), and then synchronise them with a shared repository for the
  inProgressRepository, but I'm not sure if that would actually work.
 
  Any input would be great - even if it is basic as I am new to Camel!
 
  Thanks,
  Tom
 
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Parallel-processing-multiple-file-consumer-threads-with-readLock-changed-and-long-timeout-tp5767753.html
  Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5767770i=1
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://camel.465427.n5.nabble.com/Parallel-processing-multiple-file-consumer-threads-with-readLock-changed-and-long-timeout-tp5767753p5767770.html
  To unsubscribe from Parallel processing/multiple file consumer threads
 with readLock=changed and long timeout?, click here
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5767753code=dG9tQHRvbWR1bmNhbGYuY29tfDU3Njc3NTN8MTAzMzMyNTM2
 .
 NAML
 

Re: Parallel processing/multiple file consumer threads with readLock=changed and long timeout?

2015-06-02 Thread Tom Duncalf
Thanks Claus - those are both interesting ideas, I'll give it some more
thought!

Thanks,
Tom

Tom Duncalf / Software Developer
tomduncalf.com http://www.tomduncalf.com / @tomduncalf
http://twitter.com/tomduncalf


On 2 June 2015 at 10:04, Claus Ibsen-2 [via Camel] 
ml-node+s465427n5767782...@n5.nabble.com wrote:

 Hi

 You could either try to implement your own read lock, or alternative
 try with a statefull file filter. Then in the filter you can return
 false for files that hasn't waited long enough and this allow to
 advance to the next file instead of blocking.

 Well in fact the read lock could also be stateful. And by stateful I
 mean you remember from previous time what was the last timestamp of
 the file, so you can figure out whether to pickup the file or not.

 We could consider adding support for stateful in the out of the box
 read lock but it would maybe require a few options to control the
 state cache so its size can be configured and so on.


 On Tue, Jun 2, 2015 at 10:55 AM, Tom Duncalf [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5767782i=0 wrote:

  Thanks Claus - unfortunately, there is a requirement to support existing
  client workflows, which are usually not able to upload a done file
  without additional development work on their end, and it seems that
 ProFTPD
  is not able to do this automatically.
 
  Are you aware of any way to prevent the file consumer blocking while
  waiting for the changed read lock or would another approach such as
 one
  Camel process per user directory be the recommended approach in this
 case?
 
  Thanks,
  Tom
 
  Tom Duncalf / Software Developer
  tomduncalf.com http://www.tomduncalf.com / @tomduncalf
  http://twitter.com/tomduncalf
 
 
  On 2 June 2015 at 08:12, Claus Ibsen-2 [via Camel] 
  [hidden email] http:///user/SendEmail.jtp?type=nodenode=5767782i=1
 wrote:
 
  Hi
 
  If possible then using done file names is IMHO a better strategy.
  Though that would require the other party to do this when it uploads
  to the FTP server.
 
 
 
  On Mon, Jun 1, 2015 at 6:10 PM, Tom Duncalf [hidden email]
  http:///user/SendEmail.jtp?type=nodenode=5767770i=0 wrote:
 
   Hi,
  
   I am building a Camel route to consume files uploaded by FTP and then
  upload
   them elsewhere. It would seem that changed is the most suitable
  readLock
   strategy for this, and I would like to set a fairly large
   readLockCheckInterval and readLockTimeout (e.g. 20s and 40s) to help
  prevent
   incomplete files from users with slow/intermittent connections being
  picked
   up by the route prematurely.
  
   What I would like to achieve is to make it so that the File consumer
 is
  not
   blocked from picking up more files for the duration of the
  readLockTimeout -
   that is, currently, if file1 is uploaded at t=0 and file2 uploaded at
  t=5,
   then the consumer picks up file1 at t=0 and is then blocked until at
  least
   t=20 (assuming a 20s check interval), so file2 will not be picked up
  until
   at least t=20 (and processed until at least t=40). Instead, I would
 like
   there to be (for example) more than one consumer thread, so that when
  the
   first consumer thread picks up file1 and is waiting until t=20,
 another
   consumer thread can still pick up file2 at t=5 and wait until t=25.
  
   None of the concurrency options available seem to cover this scenario
 -
  I
   understand that I can decouple the file being consumed and the
  subsequent
   processing using, for example, a SEDA queue, or I can split the
  processing
   into multiple threads after a file has been processed by the File
  consumer
   using the Threads DSL, but I can't see how to make the consumer
 itself
   consume files and therefore create messages in a multi-threaded
 manner.
  
   One workaround may be to spawn a new process for each FTP user and
 have
  it
   consume from their home directory, but I would prefer to avoid this
   additional complexity and it would not gracefully handle a situation
  where
   one user uploads a large volume of files. One other option I can
 think
  of is
   to start multiple instances of my route somehow (to create multiple
   consumers), and then synchronise them with a shared repository for
 the
   inProgressRepository, but I'm not sure if that would actually work.
  
   Any input would be great - even if it is basic as I am new to Camel!
  
   Thanks,
   Tom
  
  
  
  
   --
   View this message in context:
 
 http://camel.465427.n5.nabble.com/Parallel-processing-multiple-file-consumer-threads-with-readLock-changed-and-long-timeout-tp5767753.html
   Sent from the Camel - Users mailing list archive at Nabble.com.
 
 
 
  --
  Claus Ibsen
  -
  Red Hat, Inc.
  Email: [hidden email]
  http:///user/SendEmail.jtp?type=nodenode=5767770i=1
  Twitter: davsclaus
  Blog: http://davsclaus.com
  Author of Camel in Action: http://www.manning.com/ibsen
  hawtio: http://hawt.io/
  fabric8: http://fabric8.io/
 
 
  

Re: file-to-file copy gives unreliable results (not entire file is copied)

2015-06-02 Thread Claus Ibsen
The various read locks works differently on different file systems.

Especially when another process is writing a large file, then
changed and rename may require a higher timeout / check interval
to ensure the file is really ready.

On Tue, Jun 2, 2015 at 11:07 AM, rwijngaa
rino.van.wijngaar...@gmail.com wrote:
 When i tweak the route some more (added options readLockTimeout and
 readLockCheckInterval), the succesrate seems to be 100% now. Is this
 expected behaviour? I mean, you would expect the files to be copied with a
 100% successrate no matter what the (timing) options right ?

 Improved route:




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/file-to-file-copy-gives-unreliable-results-not-entire-file-is-copied-tp5767775p5767783.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Schematron component: Not supported: http://saxon.sf.net/feature/linenumbering

2015-06-02 Thread Ayache Khettar
Hi Dan

I have written a simple schematron service which can be deployed into
karaf: https://github.com/akhettar/zotix/tree/master/schematron-service.
Hope this will help.

Ayache

On 1 June 2015 at 21:58, Davis, Daniel davi...@si.edu wrote:

 Thanks.  I am grabbing a copy to build.

 --
 Dan

 On 06/01/2015 03:37 PM, Ayache Khettar wrote:
  Hi Daniel
 
  I have checked a fix and here is the lira ticket (keep an eye on it):
  https://issues.apache.org/jira/browse/CAMEL-8796 Hopefully, the changes
  will make it to 2.14.1 version soon.
 
  The above ticket only deals with class loader issue and it should get you
  pass the issue you were facing on karaf.
 
  Regards,
 
  Ayache
  On 20 May 2015 at 20:53, Davis, Daniel davi...@si.edu wrote:
 
  Thank you so much for both the workaround and the additional features!
 
  --
  Dan Davis
 
  On 05/19/2015 03:49 AM, Ayache Khettar wrote:
  Hi Dan
 
  Apologies for the late reply. Only yesterday I had a bit of time to
 look
  into this in more details. I am able to reproduce it on the latest
  serviceMix distribution. Looks like, when Camel schematron component is
  deployed into SMX. it uses Xalan by default as opposed to Saxon. There
  is a
  way of forcing saxon implementation but it should be done properly. A
  quick
  solution is to fork the camel-scheamtron 2.14.1 version and set the
 line
  numbering to false (
 
 
 https://github.com/apache/camel/blob/master/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/processor/TemplatesFactory.java
  (line 68). That will solve your problem I believe.
 
  In the mean time, I will raise a Jira ticket for this issue to do
  following:
  1- Expose line numbering support through uri parameter (false by
  default).
  2- Allow users to choose whether to use Saxon as the
  transformerFactoryClass.
 
  Hopefully, I should check in the changes by the end of this weekend.
 
  Regards,
 
  Ayache
 
 
 
 
 
  On 13 May 2015 at 19:25, Davis, Daniel davi...@si.edu wrote:
 
  I tried with this Java DSL route.  My code is showing a dependency on
  Saxon in ServiceMIx but I gather the camel-schematron component is
 doing
  its own binding to Xalan.  So it results in the same exception when
  trying to start the route.
 
  http://pastie.org/10187203  (Java and POM)
 
  --
  Dan Davis
 
  On 05/13/2015 11:28 AM, Davis, Daniel wrote:
  I have included the XML DSL version.  I am working up a better Java
 DSL
  version.  I can provoke the issue in a default ServiceMix 5.4.0
 install
  with only the camel-schematron feature added.  I have tried it with
 the
  Apache Saxon-He bundle installed too.  In the ServiceMix log, the
 route
  fails to start with an exception that points to ServiceMix finding
  Xalan
  and never finding Saxon (snippet below).  The Schematron rules run
  correctly in Oxygen.  My running theory is that the camel-schematron
  component version needs Saxon for the linenumbering feature but does
  not
  have it set as a required import, but I am still learning about the
  camel-schematron component.  I am trying to get it working in the
 Java
  DSL by resolving the Saxon dependencies in that code but that is not
  done yet.
 
  Thank you for looking at this.
 
  --
  Dan Davis
 
  http://pastie.org/10186857   (Contains test XML DSL route,
 Schematron
  rules, and test xml file)
 
  Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
  resolve endpoint:
 
 
 schematron:///opt/sidora/servicemix/Input/schemas/DeploymentManifest2014.sch
  due to: Not supported: http://saxon.sf.net/feature/linenumbering
  at
 
 
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:547)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:72)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:202)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)[116:org.apache.camel.camel-core:2.14.1]
  at
 
 
 

Jackson JSON Dataformat can not unmarshal what it has marshaled

2015-06-02 Thread Pontus Ullgren
Hi,

I'm trying to build a solution when I marshal POJO into JSON and send over
JMS to a remote machine. On the remote machine message is also consumed by
a Camel route.

However the JSON on the remote machine is unable to marshal the JSON that
the dataformater created.

To show the error I created a smaller POC where I use a SEDA within the
same camel context and it shows the same error.
Here is the test project https://bitbucket.org/ullgren/jsonmarshaltest

It seems that the unmarshal does not like the fact that the POJO class name
is added as a field. Is there anyway to change this behaviour,

The error I get is:

[/jsonmarshaltest.sendToBackend] SedaConsumer   WARN  Error
processing exchange. Exchange[Message:
[{com.ullgren.pontus.example.model.Order:{id:1,customerName:Joe
Doe,customerEmail:joe@acme.com,productNo:ABC123,amount:10,dispatched:false}},{com.ullgren.pontus.example.model.Order:{id:2,customerName:Elmer
Fudd,customerEmail:elmer.f...@acme.com,productNo:GUN12G,amount:2,dispatched:false}},{com.ullgren.pontus.example.model.Order:{id:3,customerName:Porky
Pig,customerEmail:porky@acme.com,productNo:STU3,amount:8,dispatched:false}},{com.ullgren.pontus.example.model.Order:{id:4,customerName:Foghorn
J. 
Leghorn,customerEmail:legh...@acme.com,productNo:CORN961,amount:10,dispatched:false}},{com.ullgren.pontus.example.model.Order:{id:5,customerName:Wile
E. 
Coyote,customerEmail:wile.coy...@acme.com,productNo:BOM44,amount:100,dispatched:false}}]].
Caused by:
[com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException -
Unrecognized field com.ullgren.pontus.example.model.Order (class
com.ullgren.pontus.example.model.Order), not marked as ignorable (6 known
properties: productNo, amount, customerName, dispatched, id,
customerEmail])
 at [Source: java.io.ByteArrayInputStream@506208e4; line: 1, column: 45]
(through reference chain:
com.ullgren.pontus.example.model.Order[com.ullgren.pontus.example.model.Order])]
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field com.ullgren.pontus.example.model.Order (class
com.ullgren.pontus.example.model.Order), not marked as ignorable (6 known
properties: productNo, amount, customerName, dispatched, id,
customerEmail])
 at [Source: java.io.ByteArrayInputStream@506208e4; line: 1, column: 45]
(through reference chain:
com.ullgren.pontus.example.model.Order[com.ullgren.pontus.example.model.Order])
at
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)
at
com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:731)
at
com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:915)
at
com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1292)
at
com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1270)
at
com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:247)
at
com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
at
com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:232)
at
com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:206)
at
com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:25)
at
com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051)
at
com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2206)
at
org.apache.camel.component.jackson.JacksonDataFormat.unmarshal(JacksonDataFormat.java:126)
at
org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:67)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:424)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at
org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291)
at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Thanks
Pontus Ullgren


Re: Can simple() be made to compare strings in a case insensitive way?

2015-06-02 Thread Pontus Ullgren
I would rather see a new operator than changing the behaviour of ==


On Tue, 2 Jun 2015 at 09:44 Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 Yeah I am not sure if end users would be surprised if we change == to
 be case insensitive for strings?

 Or we could consider having =~ as an alternative comparison operator
 (although =~ may not be though as insensitive operator?)

 If we have a new operator or change the default behavior it would have
 the performance benefit to avoid the reflection method invocation that
 a .toLowerCase() would require.


 Any thoughts in the community ?




 On Mon, Jun 1, 2015 at 7:52 PM, s.marjanovic
 slavisa.marjanovic...@gmail.com wrote:
  Hello Andrew,
 
  I managed to find the same information as you posted in the example,
  although without the ? part.
 
  Great tip about that, thanks.
 
  Regards,
  Slavisa
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Can-simple-be-made-to-compare-strings-in-a-case-insensitive-way-tp5767732p5767756.html
  Sent from the Camel - Users mailing list archive at Nabble.com.



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



File Component : scheduledExecutorService throwing Error

2015-06-02 Thread Kondalarv
I am using scheduledExecutorService for File Component but I am getting the
below Error.

Could not find a suitable setter for property: scheduledExecutorService as
there isn't a setter method with same type: java.lang.String nor type
conversion possible: No type converter available to convert from type:
java.lang.String to the required type:
java.util.concurrent.ScheduledExecutorService with value
#filewatcherThreadPool


I tried with below 2 options but getting the same error.

Config :  scheduledExecutorService=#filewatcherThreadPool

threadPool id=filewatcherThreadPool  threadName=filewatcherThreadPool
poolSize=5   maxPoolSize=20  maxQueueSize=-1/


ThreadPoolProfile customThreadPoolProfile =
new
ThreadPoolProfileBuilder(filewatcherThreadPool).poolSize(5).maxPoolSize(20).maxQueueSize(-1).build();
ModelCamelContext context = getContext();
   
context.getExecutorServiceManager().registerThreadPoolProfile(customThreadPoolProfile);

Please help me.





--
View this message in context: 
http://camel.465427.n5.nabble.com/File-Component-scheduledExecutorService-throwing-Error-tp5767814.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Failed to load type converters because of: Cannot find any type converter classes org.apache.camel.component.jetty.JettyConverter

2015-06-02 Thread cloud
hi all,

I want to know , which jar or project include the class:
org.apache.camel.component.jetty.JettyConverter . 

cause Exception show that I need this class ( the wired is that not the
ClassNotFind Error  ).

Failed to load type converters because of: Cannot find any type converter
classes from the following packages:
[org.apache.camel.component.jetty.JettyConverter]


my maven pom file :

camel.version2.15.2/camel.version

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-jetty8/artifactId

version${camel.version}/version
/dependency




/opt/usr/apache-tomcat-7.0.59/bin/catalina.sh run
Jun 03, 2015 11:14:29 AM org.springframework.web.context.ContextLoader
initWebApplicationContext
SEVERE: Context initialization failed
org.apache.camel.RuntimeCamelException:
org.apache.camel.TypeConverterLoaderException: Failed to load type
converters because of: Cannot find any type converter classes from the
following packages: [org.apache.camel.component.jetty.JettyConverter]
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
at
org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1979)
at
org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:2000)
at
org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:3220)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2579)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load
type converters because of: Cannot find any type converter classes from the
following packages: [org.apache.camel.component.jetty.JettyConverter]
at
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:119)
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:544)
at
org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:53)





thanks in advance .





--
View this message in context: 
http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-because-of-Cannot-find-any-type-converter-classes-org-apache-camel-cor-tp5767819.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Failed to load type converters because of: Cannot find any type converter classes org.apache.camel.component.jetty.JettyConverter

2015-06-02 Thread Willem Jiang
You need to put the camel-jetty-common jar in your war as well.


Willem Jiang

Red Hat, Inc.

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

On Wed, Jun 3, 2015 at 11:27 AM, cloud cl...@domolo.com wrote:

 hi all,

 I want to know , which jar or project include the class:
 org.apache.camel.component.jetty.JettyConverter .

 cause Exception show that I need this class ( the wired is that not the
 ClassNotFind Error  ).

 Failed to load type converters because of: Cannot find any type converter
 classes from the following packages:
 [org.apache.camel.component.jetty.JettyConverter]


 my maven pom file :

 camel.version2.15.2/camel.version

 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-jetty8/artifactId

 version${camel.version}/version
 /dependency




 /opt/usr/apache-tomcat-7.0.59/bin/catalina.sh run
 Jun 03, 2015 11:14:29 AM org.springframework.web.context.ContextLoader
 initWebApplicationContext
 SEVERE: Context initialization failed
 org.apache.camel.RuntimeCamelException:
 org.apache.camel.TypeConverterLoaderException: Failed to load type
 converters because of: Cannot find any type converter classes from the
 following packages: [org.apache.camel.component.jetty.JettyConverter]
 at

 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
 at

 org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1979)
 at

 org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:2000)
 at

 org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:3220)
 at

 org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2579)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

 Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load
 type converters because of: Cannot find any type converter classes from the
 following packages: [org.apache.camel.component.jetty.JettyConverter]
 at

 org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:119)
 at

 org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:544)
 at

 org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:53)





 thanks in advance .





 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-because-of-Cannot-find-any-type-converter-classes-org-apache-camel-cor-tp5767819.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: No component found with scheme: jetty in Intellij IDEA

2015-06-02 Thread Willem Jiang
It’s a common issue of Camel, you need to make sure the camel-jetty or 
camel-jetty{8|9}(if you uses Camel 2.15.x)  is in your class path from IDEA.

Reimport the project from the pom module could help you with that. 

--  
Willem Jiang

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



On June 3, 2015 at 9:35:18 AM, chunfeng tian (tianyunqu...@gmail.com) wrote:
 hi all,
  
 We recently made a decision that use Camel in our project .
  
 We should integrate the camel with springframework , and use servlet to
 redirect http rest querst to background inner-firewall server.
  
 I use camel-jetty as servlet server , the problem what I meet is that :
  
 when use console command : mvn camel:run , all works well ; but when I
 debug under IDE, there is a error message that : No component found with
 scheme: jetty .
  
 Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
 resolve endpoint: jetty://
 http://0.0.0.0:8199/test?chunked=falsematchOnUriPrefix=true due to: No
 component found with scheme: jetty
 at
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:584)
   
 at
 org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)
   
 at
 org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:200)
   
 at
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
   
 at
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
   
 at
 org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:70) 
  
 at
 org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)
   
 at
 org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1008)  
 at
 org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)  
 ... 64 more
  
  
  
 my camel version is : 2.15.2 .
  
 I can not find any solution about this issue , so , I request for help on
 mail list .
  
 thanks.
  
 tian
  



No component found with scheme: jetty in Intellij IDEA

2015-06-02 Thread chunfeng tian
hi all,

We recently made a decision that use Camel in our project .

We should integrate the camel with springframework  , and use servlet to
redirect http rest querst to background inner-firewall server.

I use camel-jetty as servlet server , the problem what I meet is that :

when use console command : mvn camel:run , all works well ; but when I
debug under IDE, there is a error message that : No component found with
scheme: jetty .

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: jetty://
http://0.0.0.0:8199/test?chunked=falsematchOnUriPrefix=true due to: No
component found with scheme: jetty
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:584)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)
at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:200)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
at
org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:70)
at
org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1008)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)
... 64 more



my camel version is : 2.15.2 .

I can not find any solution about this issue , so , I request for help on
mail list .

thanks.

tian


Re: Caching the upstream queue

2015-06-02 Thread Ravindra Godbole
Camel stores information in various headers and information related to
original queue can be captured from the same. Based on the scenario/use
case this information can be used dynamically as well to route the message
[ Routing slip EIP ]. Is this what you are looking for ?  It will be great
if you can explain your use case with respect to camel in detail.



On Tue, Jun 2, 2015 at 3:41 PM, mohanradhakrishnan 
mohan.radhakrish...@cognizant.com wrote:

 I am new to EIP. Recently I came across code that serializes
 com.ibm.mq.jms.MQQueue. This is done in order to remember which queue to
 post to when the downstream queues - there are multiple layers of queues -
 respond later.

 Can someone help me understand how an integration framework caches or
 figures out which queue originated the message ? This message is passed on
 to another queue and so on. Later we receive the response and post it back
 to the originating queue.

 What EIP pattern covers this ? Any Camel sample ?

 Thanks,
 Mohan



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




-- 
- Ravi

*[ View My Youtube Channel
https://www.youtube.com/playlist?list=PL5Y_TlNjh0D59A4K3yQQR7gNAslnxDmRB
]*

Phone: +91 *98 509 760 91*


Caching the upstream queue

2015-06-02 Thread mohanradhakrishnan
I am new to EIP. Recently I came across code that serializes
com.ibm.mq.jms.MQQueue. This is done in order to remember which queue to
post to when the downstream queues - there are multiple layers of queues -
respond later. 

Can someone help me understand how an integration framework caches or
figures out which queue originated the message ? This message is passed on
to another queue and so on. Later we receive the response and post it back
to the originating queue.

What EIP pattern covers this ? Any Camel sample ?

Thanks,
Mohan



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


When I use Xquery in Camel Route getting No script engine could be created for: xquery

2015-06-02 Thread MadhuB
Hi ,

please any one have idea on below error.I am using xquery inside camel
route.xml as below:

?xml version=1.0 encoding=ASCII?
routes xmlns=http://camel.apache.org/schema/spring;
  route xmlns:tns=urn:switchyard-quickstart:camel-saxon:0.1.0
from uri=switchyard://RoutingService/
log message=GreetingService - message received: ${body}/
choice
  when
xquery//tns:greet=Garfield/xquery
setBody
  xpath//tns:greet/text()/xpath
/setBody
to uri=switchyard://GoodbyeService/
  /when
  otherwise
setBody
  xpath//tns:greet/text()/xpath
/setBody
to uri=switchyard://HelloService/
  /otherwise
/choice
  /route
/routes


After deploying into ther server getting below error:

No script engine could be created for: xquery:
java.lang.IllegalArgumentException: No script engine could be created for:
xquery
at
org.apache.camel.builder.script.ScriptBuilder.createScriptEngine(ScriptBuilder.java:287)
[camel-script-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.builder.script.ScriptBuilder.getEngine(ScriptBuilder.java:197)
[camel-script-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.builder.script.ScriptBuilder.getScriptContext(ScriptBuilder.java:244)
[camel-script-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.builder.script.ScriptBuilder.evaluateScript(ScriptBuilder.java:337)
[camel-script-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.builder.script.ScriptBuilder.matches(ScriptBuilder.java:100)
[camel-script-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:66)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]



--
View this message in context: 
http://camel.465427.n5.nabble.com/When-I-use-Xquery-in-Camel-Route-getting-No-script-engine-could-be-created-for-xquery-tp5767795.html
Sent from the Camel - Users mailing list archive at Nabble.com.


IBM MQ putAsyncAllowed=1 is not valid

2015-06-02 Thread infopad
I have a Camel route that listens to a Queue where a C++/MQ client
application publishes messages. The client application sets a parameter on
the destination resulting that results in the following exception as listed
below. Is there a way to get around this? A JMS listener application
processes the same message on the Queue without error.

[org.apache.camel.RuntimeCamelException -
com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSCMQ0005: The
destination name 'queue://MY.QUEUE?putAsyncAllowed=1' was not valid.
The destination name specified does not conform to published destination
syntax.
Correct the specified destination name and try again.]
at
org.apache.camel.component.jms.JmsBinding.extractHeadersFromJms(JmsBinding.java:175)
~[camel-jms-2.12.2.jar:2.12.2]
at
org.apache.camel.component.jms.JmsMessage.populateInitialHeaders(JmsMessage.java:222)
~[camel-jms-2.12.2.jar:2.12.2]
at
org.apache.camel.impl.DefaultMessage.createHeaders(DefaultMessage.java:196)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.component.jms.JmsMessage.ensureInitialHeaders(JmsMessage.java:207)
~[camel-jms-2.12.2.jar:2.12.2]
at
org.apache.camel.component.jms.JmsMessage.getHeaders(JmsMessage.java:165)
~[camel-jms-2.12.2.jar:2.12.2]
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:89)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.util.UnitOfWorkHelper.createUoW(UnitOfWorkHelper.java:52)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.createUnitOfWork(CamelInternalProcessor.java:618)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.before(CamelInternalProcessor.java:600)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.before(CamelInternalProcessor.java:581)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:139)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
~[camel-core-2.12.2.jar:2.12.2]
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)
~[camel-jms-2.12.2.jar:2.12.2]
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
~[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
~[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
~[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103)
[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1095)
[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)
[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_45]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
Caused by: com.ibm.msg.client.jms.DetailedInvalidDestinationException:
JMSCMQ0005: The destination name
'queue://PORTIA.MDS.QUEUE.PROD.2?putAsyncAllowed=1' was not valid.
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
~[na:1.7.0_45]
at

Re: Tip: speed up camel-ftp download/upload by setting bufferSize on the FTPClient

2015-06-02 Thread Claus Ibsen
Hi

Thanks for the tip. What Camel version do you use?

I think we have fixed setting the default receive buffer size to 32kb
in Camel 2.15.1 onwards.


On Tue, Jun 2, 2015 at 3:51 PM, rwijngaa rino.van.wijngaar...@gmail.com wrote:
 Just a tip for those experiencing performance problems using ftp download
 with the localWorkDirectory option.

 We've got a camel route that downloads a file via ftp and upload this file
 to another ftp server.
 Since the files grew big, we added the localWorkDirectory option.
 The performance was extremely slow, order of bytes / kbytes per second.

 Camel-ftp uses the org.apache.commons.net.ftp.FTPClient for it's ftp
 communication,
 but the default buffersize seems to be 0 (!), causing -in our case- dramatic
 slow transfer speeds!

 We sped things up by creating our own ftpclient instance with a bigger
 buffersize


 And, in your route, add ftpClient option like this:


 and things were very fast again ;-)

 Regards
 Rino




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Tip-speed-up-camel-ftp-download-upload-by-setting-bufferSize-on-the-FTPClient-tp5767800.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


why should I modify jre.properties to run camel osgi example in fuseesb

2015-06-02 Thread nono
to run camel-example-cxf-osgi\2.9.0 example on on Apache ServiceMix 4.x or
Apache Karaf 2.2.x. it is required to do below change. why should I do this?

  a) edit the etc/jre.properties file to add the following packages to be
exported
  jre-1.6=, \
  com.sun.org.apache.xerces.internal.dom, \
  com.sun.org.apache.xerces.internal.jaxp, \

  b) from the same file comment out the following exports already provided
by the bundles
  that will be imported next: javax.xml.bind*, javax.jws*, javax.xml.soap*,
javax.xml.ws*, 
  javax.activation, javax.annotation, javax.xml.stream*.




--
View this message in context: 
http://camel.465427.n5.nabble.com/why-should-I-modify-jre-properties-to-run-camel-osgi-example-in-fuseesb-tp5767789.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel approach pipeinputstream Aggregator

2015-06-02 Thread Nicolas Palumbo
Hello,
I need to aggregate content and write to a pipe because that's the way I do
a streamed Mysql bulk load. I've done this in a very dirty approach, I'd
like to hear how can I implement this in a more Camelish way:

https://gist.github.com/npalumbo/a972a504bc8e7fff6ccc

Thanks,
Nico


Re: Caching the upstream queue

2015-06-02 Thread Claus Ibsen
Hi

The JMS spec has standard set of headers for the destination and reply-to etc.

On Tue, Jun 2, 2015 at 1:05 PM, Ravindra Godbole godbol...@gmail.com wrote:
 Camel stores information in various headers and information related to
 original queue can be captured from the same. Based on the scenario/use
 case this information can be used dynamically as well to route the message
 [ Routing slip EIP ]. Is this what you are looking for ?  It will be great
 if you can explain your use case with respect to camel in detail.



 On Tue, Jun 2, 2015 at 3:41 PM, mohanradhakrishnan 
 mohan.radhakrish...@cognizant.com wrote:

 I am new to EIP. Recently I came across code that serializes
 com.ibm.mq.jms.MQQueue. This is done in order to remember which queue to
 post to when the downstream queues - there are multiple layers of queues -
 respond later.

 Can someone help me understand how an integration framework caches or
 figures out which queue originated the message ? This message is passed on
 to another queue and so on. Later we receive the response and post it back
 to the originating queue.

 What EIP pattern covers this ? Any Camel sample ?

 Thanks,
 Mohan



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




 --
 - Ravi

 *[ View My Youtube Channel
 https://www.youtube.com/playlist?list=PL5Y_TlNjh0D59A4K3yQQR7gNAslnxDmRB
 ]*

 Phone: +91 *98 509 760 91*



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


Tip: speed up camel-ftp download/upload by setting bufferSize on the FTPClient

2015-06-02 Thread rwijngaa
Just a tip for those experiencing performance problems using ftp download
with the localWorkDirectory option.

We've got a camel route that downloads a file via ftp and upload this file
to another ftp server.
Since the files grew big, we added the localWorkDirectory option.
The performance was extremely slow, order of bytes / kbytes per second.

Camel-ftp uses the org.apache.commons.net.ftp.FTPClient for it's ftp
communication,
but the default buffersize seems to be 0 (!), causing -in our case- dramatic
slow transfer speeds!

We sped things up by creating our own ftpclient instance with a bigger
buffersize 


And, in your route, add ftpClient option like this:


and things were very fast again ;-)

Regards
Rino




--
View this message in context: 
http://camel.465427.n5.nabble.com/Tip-speed-up-camel-ftp-download-upload-by-setting-bufferSize-on-the-FTPClient-tp5767800.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel-fop does not work properly with ServiceMix 5.4.0 - error creating XSL-FO

2015-06-02 Thread vladimir
Hi! I try to use camel-fop with ServiceMix.
I made a route in Eclipse, test it in Eclipse - everything is Ok.

But after deploying it in ServiceMix I've got the error:
*javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Element fo:simple-page-master is
missing required property master-name
*

*Here is the part of xsl-fo (from ServiceMix log) - incorrect one:*

?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
xmlns:fox=http://xml.apache.org/fop/extensions;
fo:layout-master-set

fo:simple-page-master
fo:region-body/
/fo:simple-page-master

fo:simple-page-master
fo:region-body/
/fo:simple-page-master

fo:page-sequence-master
fo:repeatable-page-master-alternatives
fo:conditional-page-master-reference/
fo:conditional-page-master-reference/
/fo:repeatable-page-master-alternatives
/fo:page-sequence-master
/fo:layout-master-set
fo:page-sequence
fo:flow
fo:block
fo:block
fo:inline/
/fo:block
/fo:block
fo:block
.

fo:table
fo:table-column/
fo:table-column/
fo:table-column/
fo:table-column/
fo:table-column/
fo:table-column/
fo:table-column/
fo:table-body
fo:table-row
fo:table-cell
fo:block
fo:inline/
/fo:block
/fo:table-cell
fo:table-cell
fo:blockDoc №/fo:block
/fo:table-cell
fo:table-cell
fo:block12-5789/fo:block
/fo:table-cell
fo:table-cell
fo:block
fo:inline/
/fo:block
/fo:table-cell
fo:table-cell
fo:blockCod/fo:block
/fo:table-cell
/fo:table-row
fo:table-row
fo:table-cell
fo:block/
/fo:table-cell


As you see - many is lost.


*And this is the correct one, when I try and get it by Eclipse:*

?xml version=1.0 encoding=UTF-8?fo:root
xmlns:fox=http://xml.apache.org/fop/extensions;
xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master master-name=first margin-right=0.8cm
margin-left=0.8cm margin-bottom=1.0cm margin-top=1.5cm
page-width=29.7cm page-height=21cm
fo:region-body margin-bottom=0.5cm margin-top=0cm/
/fo:simple-page-master
fo:simple-page-master master-name=rest margin-right=0.8cm
margin-left=0.8cm margin-bottom=1.0cm margin-top=1.5cm
page-width=29.7cm page-height=21cm
fo:region-body margin-bottom=0.5cm margin-top=0cm/
/fo:simple-page-master
fo:page-sequence-master master-name=document
fo:repeatable-page-master-alternatives
fo:conditional-page-master-reference page-position=first
master-reference=first/
fo:conditional-page-master-reference page-position=rest
master-reference=rest/
/fo:repeatable-page-master-alternatives
/fo:page-sequence-master
/fo:layout-master-set
fo:page-sequence master-reference=document language=ru
hyphenate=true
fo:flow flow-name=xsl-region-body
fo:block
fo:block space-before.optimum=1.5pt space-after.optimum=1.5pt
keep-together=always line-height=100% margin-bottom=0cm
fo:inline white-space-collapse=false/
/fo:block
/fo:block
...

Any help is very appreciated!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-fop-does-not-work-properly-with-ServiceMix-5-4-0-error-creating-XSL-FO-tp5767810.html
Sent from the Camel - Users mailing list archive at Nabble.com.