Re: oracle.jms.AQjmsFactory and javax.sql.DataSource

2013-03-20 Thread jinaLu
If I don't use datasource and specify like this:

bean id=connectionFactoryOracleAQQueue class=oracle.jms.AQjmsFactory
factory-method=getQueueConnectionFactory
constructor-arg index=0

valuejdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=mydb)))/value
/constructor-arg
constructor-arg index=1 type=java.util.Properties
value/value
/constructor-arg
/bean

bean id=oracleQueueCredentials

class=org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter
property name=targetConnectionFactory
ref bean=connectionFactoryOracleAQQueue /
/property
property name=username
valuedb/value
/property
property name=password
valuepassword/value
/property
/bean

bean id=oracleQueue 
class=org.apache.camel.component.jms.JmsComponent
property name=connectionFactory ref=oracleQueueCredentials 
/
/bean

Then it works, but I have a restriction, that I have to use datasource. Any
ideas?



--
View this message in context: 
http://camel.465427.n5.nabble.com/oracle-jms-AQjmsFactory-and-javax-sql-DataSource-tp5729223p5729471.html
Sent from the Camel - Users mailing list archive at Nabble.com.


sftp not throwing exception

2013-03-20 Thread sarfaraj
Hi,

I am using the sftp component(2.8.5). When I passed wrong credential or
invalid IP, it doesn't throws any exception. That is why I could not
recognized is connection established or not. Could someone tell me how to
throw exception in such case.

FYI: the route is 

camel:camelContext xmlns=http://camel.apache.org/schema/spring;

onException
exceptionjava.lang.Exception/exception
redeliveryPolicy maximumRedeliveries=1
redeliveryDelay=0 /
continued
constanttrue/constant
/continued
log message=I am in exception./
/onException

route id=test1

from
uri=sftp://root@10.0.0.1//temp?password=test123amp;throwExceptionOnConnectFailed=trueamp;noop=true;
/

to uri=file:src/temp /
/route
/camel:camelContext



--
View this message in context: 
http://camel.465427.n5.nabble.com/sftp-not-throwing-exception-tp5729470.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: sftp not throwing exception

2013-03-20 Thread Claus Ibsen
Its the chicken and egg. The Camel error handler does normally only
trigger if a message has been consumed.
Now you have the consumer fail before it can route a message into the
Camel route.

You can use a custom poll strategy, see details here
http://camel.apache.org/file2

And from Camel 2.10 onwards you can enable this option on the consumer
consumer.bridgeErrorHandler

And then it allows to trigger the Camel error handler.


On Wed, Mar 20, 2013 at 7:20 AM, sarfaraj sarfarajsay...@gmail.com wrote:
 Hi,

 I am using the sftp component(2.8.5). When I passed wrong credential or
 invalid IP, it doesn't throws any exception. That is why I could not
 recognized is connection established or not. Could someone tell me how to
 throw exception in such case.

 FYI: the route is

 camel:camelContext xmlns=http://camel.apache.org/schema/spring;

 onException
 exceptionjava.lang.Exception/exception
 redeliveryPolicy maximumRedeliveries=1
 redeliveryDelay=0 /
 continued
 constanttrue/constant
 /continued
 log message=I am in exception./
 /onException

 route id=test1

 from
 uri=sftp://root@10.0.0.1//temp?password=test123amp;throwExceptionOnConnectFailed=trueamp;noop=true;
 /

 to uri=file:src/temp /
 /route
 /camel:camelContext



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/sftp-not-throwing-exception-tp5729470.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel FTP is not consuming large files

2013-03-20 Thread Claus Ibsen
Hi

Check the logs what is happening. You can enable DEBUG logging on the
org.apache.camel.component.file.remote package to see what goes on.
Also if you download big files, use the localWorkDirectory option so
you wont read the files into memory. As 500 MB may affect your
ServiceMix server.

And is there anything odd with the file name of the 500MB file. The
consumer may skip the file if the name starts with a dot or something.

And what version of ServiceMix / Camel are you using? And what OS are
the FTP server and ServiceMix running on?


On Tue, Mar 19, 2013 at 11:14 PM, akcameluser ayache.khet...@gmail.com wrote:
 Hi

 I have an OSGI Bundle deployed on ServiceMix. Currently it's consuming files
 from a remote FTP server up to 300 MB of size. If I drop a 500 MB file (zip
 file) it doesn't get picked up and I can't see anything on the log. I have
 also noticed that if I drop a small file while the big file is still there,
 the smaller file gets consumed. This seems to show that Camel FTP is
 ignoring large files.

 Any idea how to consume large files? And how best to consume them?

 Many thanks in advance.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-FTP-is-not-consuming-large-files-tp5729459.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel receipient list with interceptor

2013-03-20 Thread Claus Ibsen
Hi

Maybe take a look at interceptors
http://camel.apache.org/intercept


On Wed, Mar 20, 2013 at 1:28 AM, santhosh ramukhsohtna...@gmail.com wrote:
 My architecture needs to multicast to multiple endpoints which will be
 constructed dynamically and before the message is sent to end point it needs
 to be customized.Now its like

   multicast parallelProcessing=true streaming=true
 id=staticrecipient  
 strategyRef=StringAggregationStrategy
 timeout=2500 
 onPrepareRef=StringDeepClonePrepare

 to uri=direct:A /
 to uri=direct:B /

  /multicast

   route id=AClient
 from uri=direct:A /
 camel:setHeader headerName=A!- some endpoint specific 
 manipulation
 similar to this--
 camel:constant Sending to A/camel:constant !- some endpoint 
 specific
 manipulation similar to this--
 /camel:setHeader
 to uri=http://A.com;/to
   /route

 Now we are moving away from static recipient list  list to dynamic recipient
 list

 recipientList  parallelProcessing=true streaming=true
 id=dyanmicrecipient  
 strategyRef=StringAggregationStrategy
 timeout=3000 
 onPrepareRef=StringDeepClonePrepare


 what should come here for spring DSL.cant find it in doc.I can use Header
 based receipient list but just asking
 *method(MessageRouter.class, 
 quot;routeToquot;)*

  /recipientList 

 The method routeTo will return url like A.com,B.com(left out http protocal
 due to hyperlink issues) ... depending upon incoming message.i am  assuming
 camel-http will automatically take care of endpoint creation.correct me if i
 am wrong.

 Everything is same as previous but except i am trying to do everything
 within multicast /recipientList  list without defining additional routes
 because i dont know the routes during compile time.
 1)Can i use onPrep processor in some way.cant think of it because i dont
 know which exchange is used for which endpoint.If i know endpointin
 exchange properties , then i think i can manipulate it

 very high level of something what i think

 public class OnPrepare   implements Processor {
   public void process(Exchange exchange) throws Exception {
 //i know this function doesnt exist
String toURI=exchange.getTOUri()
   //then perform endpoint based manipulation of message


 }

 }

 Can opPrep be used for this.is it only for things like clone.

 2)Can i use intercept only for receipient list only.
  Problems:
 1)i dont want to use intercept for whole route and filter based on
 predicate.
 2)I cant use interceptToSendEndpoint because i dont know endpoint at compile
 time.
 3)In short,i want to intercept the message. In multicast ,say if its sent to
 Endpoint A then add header A in intercept bean.In multicast ,say if its sent
 to Endpoint B then add header B in intercept bean.Noting Endpoint A  and
 Endpoint B will be constructed dynamically and will be in multicast as
 probably receipient list.

 Can this be done.

 3)Whats the best way of doing it.I dont want to move away from Spring DSL.I
 know i can mix  spring DSL and java DSL.DO you guys think i should
 dynamically construct routes/Endpoints using java DSL and invoke them in
 multicast/recipientList in spring DSL.Rewrite Entire code in java DSL is the
 last option.

 Thanks for reading such a long post.Much appreciated.Please let me know if
 its confusing. It would be nice if you can answer all three or whichever you
 know.






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



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Unmarshal CSV but continue route with unaltered message

2013-03-20 Thread Claus Ibsen
On Tue, Mar 19, 2013 at 9:13 PM, mdo manfred.doh...@gmail.com wrote:
 Hello,

 I'm looking for a solution for processing (CSV) files with this flow:
  * consume a list of CSV files (file:///incoming/)
  * unmarshal the CSV contents of each file and process it with a bean
  * if the processing was successful move the corresponding file to directory
 A
  * otherwise move it to B


The file component has move and moveFailed options where you can
specify the directories to move the file.
http://camel.apache.org/file2


 When I unmarshal the CSV the in-message gets altered. I could reassemble the
 CSV in the end but I doubt that this is the most effective way. Another
 solution was to apply some sort of claim check EIP in order to restore the
 in-message after the processing.

 Is there a more straightforward way of doing this?

 Thanks, mdo.




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Unmarshal-CSV-but-continue-route-with-unaltered-message-tp5729446.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Unmarshal CSV but continue route with unaltered message

2013-03-20 Thread mdo
Claus Ibsen-2 wrote
 The file component has move and moveFailed options where you can
 specify the directories to move the file.

Sorry, I think I missed to describe a detail. The route should be more like
this:

1. from: file:///incoming/?moveFailed=B
2. somehow filter/process the unmarshalled data for validation
3. to some destination A, maybe a remote FTP site or a local directory

A file that failed to validate should be moved into a failed-directory on
the source side. My question is how can I use the original file
content/in-message in my to()?

Best regards, mdo.





--
View this message in context: 
http://camel.465427.n5.nabble.com/Unmarshal-CSV-but-continue-route-with-unaltered-message-tp5729446p5729477.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to schedule FTP with quartz?

2013-03-20 Thread Pontus Ullgren
Hello,

On Tue, Mar 19, 2013 at 11:22 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 On Mon, Mar 18, 2013 at 4:57 PM, Pontus Ullgren ullg...@gmail.com wrote:
 Hello Chris,

 On Mon, Mar 18, 2013 at 8:54 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Claus,

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

 Depending on your needs you could enable sendEmptyMessageWhenIdle on
 the endpoint and then suspend the route when you receive a empty
 message. Which means that there is no more files to poll at the
 moment.
 You can use the content based route EIP for this.

 That is interesting to know, thanks.  In my case, the files at the
 remote end are themselves deposited at an irregular rate, but within a
 defined time window, so during that time window, there will be
 intermittent idleness...

 Another solution would be to write your own RoutePolicy to take care
 of your needs.

 Yes, this sounds like the best approach...



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

 Also I see that CronScheduledRoutePolicy has setRouteResumeTime,
 setRouteSuspendTime such that for my FTP poll window, I could either
 do start/stop or resume/suspend - which is recommended?

 I would highly recommend resume/suspend.
 I've had some thread leak problem with the file component when it was
 repetitively started/stopped.

 Ok, but I guess the first policy callback with be onStart since the
 route will be
 configured with noAutoStartup(), so upon that first onStart, I'll
 suspend then toggle
 between onSuspend/onResume...

Yes this is what I do. We have a route that should start 06:30 each
day and then poll all files that are in the folder at that time.
After that it should suspend.

Here is some pseudo code.
SuspendRouteProcessor is a processor that suspends the route based on route id.
---
String cronStr = * 30 6 * * * ?;
String input = 
ftp://user@remotehost/inbox?sendEmptyMessageWhenIdle=truepassword=secret;;
CronScheduledRoutePolicy scheduledRP = new CronScheduledRoutePolicy();
scheduledRoutePolicy.setRouteStartTime(cronStr);
scheduledRoutePolicy.setRouteResumeTime(cronStr);

from(input)
.routeId(input1)
.routePolicy(versionPolicy, scheduledRoutePolicy)
.noAutoStartup()
 .choice()
.when(body().isNotNull())
   .to(direct:processFiles)
.end()
.log(LoggingLevel.DEBUG, All files processed, suspend route)
.process(new SuspendRouteProcessor(input1))
;
--

The only downside with this is that after the initial start we get a
WARN log message that the route can not be started since it is in
suspend state.
But as long as you can live with the WARN log it works.


 // Pontus

 Thanks,

 Chris

 On Sat, Mar 2, 2013 at 1:43 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 See about route policy
 http://camel.apache.org/routepolicy

 And the scheduled route policy
 http://camel.apache.org/scheduledroutepolicy.html

 On Sat, Mar 2, 2013 at 12:15 AM, Chris Wolf cwolf.a...@gmail.com wrote:
 I have a requirement to download files via FTP during a certain time
 window and according to a schedule. e.g. Only on trading days between
 6:30AM and 7:00AM.  The FTP component, alone, seems to just do
 indefinite polling according to delay/initialDelay.

 From the Camel In Action book, chapter 7, I see some examples of
 sending a text message with the Timer and Quartz components, but I
 can't quite see how to put that together to implement kicking off
 routes at specified intervals, mentioned in the best practices list
 at the end of that chapter.  How would I use quartz to stop/start the
 FTP component, or the route that it's in?

 Thanks,

 Chris



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Email: cib...@redhat.com
 Web: http://fusesource.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen


CamelSpringJUnit4ClassRunner vs CamelSpringTestSupport

2013-03-20 Thread scottj
hello,
I would like to use the CamelSpringJUnit4ClassRunner annotations on my
tests. I've read the instructions on
http://camel.apache.org/spring-testing.html, which says Using
CamelSpringJUnit4ClassRunner runner with the @RunWith annotation [..]
provides the full feature set of Spring Test with support for the feature
set provided in the CamelTestSupport classes

I am would like to access the CamelTestSupport-methods in my tests (e.g.
CamelTestSupport.createExchangeWithBody()), but how do I accomplish that
using the CamelSpringJUnit4ClassRunner annotation? I do not have access to
the CamelTestSupport-methods then



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


Re: Unmarshal CSV but continue route with unaltered message

2013-03-20 Thread Claus Ibsen
On Wed, Mar 20, 2013 at 9:29 AM, mdo manfred.doh...@gmail.com wrote:
 Claus Ibsen-2 wrote
 The file component has move and moveFailed options where you can
 specify the directories to move the file.

 Sorry, I think I missed to describe a detail. The route should be more like
 this:

 1. from: file:///incoming/?moveFailed=B
 2. somehow filter/process the unmarshalled data for validation
 3. to some destination A, maybe a remote FTP site or a local directory

 A file that failed to validate should be moved into a failed-directory on
 the source side. My question is how can I use the original file
 content/in-message in my to()?


You can store it on a property on the exchange and access that at any time

from(file:)
.setProperty(OriginalFile, simple(${body})

// and then you can transform the message to the original message,
later when needed
.setBody(property(OriginalFile))

Though in the Camel API there is also a method to access the incoming
message with
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/UnitOfWork.html#getOriginalInMessage()





 Best regards, mdo.





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Unmarshal-CSV-but-continue-route-with-unaltered-message-tp5729446p5729477.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: sftp not throwing exception

2013-03-20 Thread sarfaraj
I just reversed the *from*and *to* still don't see any exception 

from uri=file:src/temp /
to
uri=sftp://root@10.0.0.1//temp?password=test123amp;throwExceptionOnConnectFailed=trueamp;noop=true/




--
View this message in context: 
http://camel.465427.n5.nabble.com/sftp-not-throwing-exception-tp5729470p5729481.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel SQL component - How configure sql component to doesn't try read the body?

2013-03-20 Thread Claus Ibsen
Hi

Yeah that seems like a good improvement. Feel free to log a JIRA ticket
http://camel.apache.org/contributing.html

And patches is of course welcome.


On Tue, Mar 19, 2013 at 6:31 PM, Gardella juan
gardellajuanpa...@gmail.com wrote:
 Hi,

 I have a route that is processing a file. So the body is an input stream. I
 want in some part of the route do two sequential operations. So I am using
 something like that:

 from(direct:foo).multicast().to(
 sql:truncate table X,
 direct:continue);

 If I do that, sql read a portion of the input stream. I can solve if I
 change the route to

 from(direct:foo).streamCaching().multicast().to(
 sql:truncate table X,
 direct:continue);

 But I do not want add streamCaching() only for the reason that sql component
 can not configure to do not read the body. Is it possible configure sql
 component to does not read message body?

 Thanks,
 Juan



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-SQL-component-How-configure-sql-component-to-doesn-t-try-read-the-body-tp5729434.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel cache: CamelCacheCheck and expiry on cached elements

2013-03-20 Thread Claus Ibsen
On Tue, Mar 19, 2013 at 11:47 AM, hefiso
henrik.filtenborg.soren...@gmail.com wrote:
 Hi

 I am using the Cache component where the elements are set to expire after,
 say, 5 minutes.

 However, when the component receives the operation CamelCacheCheck it does
 *not* check for expiry of the element but only checks if the element
 (expired or not) is in the cache before setting the header
 CamelCacheElementWasFound. This happens even if i specify a very low setting
 for diskExpiryThreadIntervalSeconds (say, 5 seconds).

 Is this design intentionally? I would assume that the TTL of the elements
 are considered when invoking CamelCacheCheck.

 I have solved this quirk by implementing a CacheEventListener acting on
 notifyElementExpired, deleting expired elements from the cache (so
 CamelCacheChec works as I expected). The CacheEventListener is then added to
 the eventListenerRegistry. Perhaps this quirk exists due to the way EHCache
 works?


Yeah IMHO this seems reasonable that if a cache element is expired it
should not be regarded as in the cache.

As we love contributions, then fell free to log a JIRA and provide a
patch (we prefer unit tests included)
http://camel.apache.org/contributing.html

 Best regards
 Henrik



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-cache-CamelCacheCheck-and-expiry-on-cached-elements-tp5729404.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: sftp not throwing exception

2013-03-20 Thread Claus Ibsen
On Wed, Mar 20, 2013 at 10:07 AM, sarfaraj sarfarajsay...@gmail.com wrote:
 I just reversed the *from*and *to* still don't see any exception

 from uri=file:src/temp /
 to
 uri=sftp://root@10.0.0.1//temp?password=test123amp;throwExceptionOnConnectFailed=trueamp;noop=true/



Check the logs what happens, could be sftp does not throw any
exception for invalid login.




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/sftp-not-throwing-exception-tp5729470p5729481.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel Aggregator Strategy Question

2013-03-20 Thread Jothi
Thanks for the reply. 

Would I be able to do the following? The 3 CSV files will contain different
information. I need to poll for these 3 files and get 3 Map objects out of
those 3 CSV files. I've seen the aggregation examples from the Camel
documentation, but there we combine the old and the new exchange. If I had
to do that, I will end up with one Map object which is not what I want. If I
use the headers to store the Map, am I exploiting the very purpose of Camel
headers? Is there a better way to do this?

Regards,
Joe



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


Re: Camel Aggregator Strategy Question

2013-03-20 Thread Pontus Ullgren
Add a transformation from CSV to Map object before the aggregator.

Then let the aggregator store a list of maps, or a map of maps, in the
exchange body.

You can then use this list in any subsequent transformation.

It all depends on what it is you intend to do with the data after it
has been aggregated.

// Pontus

On Wed, Mar 20, 2013 at 10:48 AM, Jothi codeintheo...@gmail.com wrote:
 Thanks for the reply.

 Would I be able to do the following? The 3 CSV files will contain different
 information. I need to poll for these 3 files and get 3 Map objects out of
 those 3 CSV files. I've seen the aggregation examples from the Camel
 documentation, but there we combine the old and the new exchange. If I had
 to do that, I will end up with one Map object which is not what I want. If I
 use the headers to store the Map, am I exploiting the very purpose of Camel
 headers? Is there a better way to do this?

 Regards,
 Joe



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


Re: Camel SQL component - How configure sql component to doesn't try read the body?

2013-03-20 Thread Gardella juan
Oki, thanks Claus for answer. I 've created the jira
https://issues.apache.org/jira/browse/CAMEL-6186.


2013/3/20 Claus Ibsen-2 [via Camel] 
ml-node+s465427n5729482...@n5.nabble.com

 Hi

 Yeah that seems like a good improvement. Feel free to log a JIRA ticket
 http://camel.apache.org/contributing.html

 And patches is of course welcome.


 On Tue, Mar 19, 2013 at 6:31 PM, Gardella juan
 [hidden email] http://user/SendEmail.jtp?type=nodenode=5729482i=0
 wrote:

  Hi,
 
  I have a route that is processing a file. So the body is an input
 stream. I
  want in some part of the route do two sequential operations. So I am
 using
  something like that:
 
  from(direct:foo).multicast().to(
  sql:truncate table X,
  direct:continue);
 
  If I do that, sql read a portion of the input stream. I can solve if I
  change the route to
 
  from(direct:foo).streamCaching().multicast().to(
  sql:truncate table X,
  direct:continue);
 
  But I do not want add streamCaching() only for the reason that sql
 component
  can not configure to do not read the body. Is it possible configure sql
  component to does not read message body?
 
  Thanks,
  Juan
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Camel-SQL-component-How-configure-sql-component-to-doesn-t-try-read-the-body-tp5729434.html
  Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Email: [hidden email]http://user/SendEmail.jtp?type=nodenode=5729482i=1
 Web: http://fusesource.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen


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

 http://camel.465427.n5.nabble.com/Camel-SQL-component-How-configure-sql-component-to-doesn-t-try-read-the-body-tp5729434p5729482.html
  To unsubscribe from Camel SQL component - How configure sql component to
 doesn't try read the body?, click 
 herehttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5729434code=Z2FyZGVsbGFqdWFucGFibG9AZ21haWwuY29tfDU3Mjk0MzR8LTE1MjMxMTI5MDU=
 .
 NAMLhttp://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/Camel-SQL-component-How-configure-sql-component-to-doesn-t-try-read-the-body-tp5729434p5729492.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Warning being thrown after setting preserveMessageQos=true

2013-03-20 Thread wxkevin
I am using Camel 2.9.1 and Java DSL.

I attempted to setup an expiration time for my custom message being sent to
a queue such as:

.from()
   
   // DO some processing and create message

   .setHeader(JMSExpiration, constant(System.currentTimeMillis() + 3000))
   .setHeader(JMSDeliveryMode, constant(DeliveryMode.NON_PERSISTENT))
   .to(jms.queue.myQueue?preserverMessageQos=true)
   .end();

As soon as this was set up I started to receive warnings in the consumer of
these messages:

WARN | org.springframework.jms.connection.CachingConnectionFactory |
Encountered a JMSException = resetting the underlying JMS Connection
javax.jms.JMSException: Could not correlate acknowledgement with dispatched
message: MessageAck {}
 at
org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:324)
 at 
 
WARN | org.apache.camel.component.jms.DefaultJmsMessageListenerContainer |
Setup of JMS message listener invoker failed for destination 'myQueue' -
trying to recover. Cause: Could not commit JMS transaction; nested exception
is havax.jms.IllegalStateException: The Session is closed.

Any ideas?







--
View this message in context: 
http://camel.465427.n5.nabble.com/Warning-being-thrown-after-setting-preserveMessageQos-true-tp5729498.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Files cannot be moved on FTP

2013-03-20 Thread Claus Ibsen
Hi

So what is the status of your test. Can you break it down more clearly
what works and doesn't work for you?
Also can you post how you have configured the Camel ftp endpoints.



On Wed, Mar 20, 2013 at 11:42 AM, Lutter, Robin
robin.lut...@t-systems.com wrote:
 Hi Claus,

 Sorry for late response. Yes, I have successfully tested the patch in our 
 environment. Thanks for applying it.
 Yesterday exception was gone but files where not moved using both SNAPSHOT 
 versions
 Today my experience is, that using 2.10.5-SNAPSHOT with windows client and 
 ftp server running on Linux or windows files will be moved.
 But with 2.11-SNAPSHOT using it with Linux ftp server - the exception is back 
 again:

 org.apache.camel.component.file.GenericFileOperationFailedException: File 
 operation failed: 550 Failed to change directory.
 Cannot change directory to: /. Code: 550]
 org.apache.camel.component.file.GenericFileOperationFailedException: File 
 operation failed: 550 Failed to change directory.
  Cannot change directory to: /. Code: 550
 at 
 org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:748)
 at 
 org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:704)
 at 
 org.apache.camel.component.file.remote.FtpOperations.buildDirectory(FtpOperations.java:285)
 at 
 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:103)
 at 
 org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:86)
 at 
 org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:144)
 at 
 org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)
 at 
 org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:53)

 Regards Robin
 Tests using: camel-ftp-2.10.5-20130315.195903-8 and 
 camel-ftp-2.11-20130320.060217-416

 -Ursprüngliche Nachricht-
 Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Gesendet: Freitag, 15. März 2013 09:59
 An: users@camel.apache.org
 Betreff: Re: Files cannot be moved on FTP

 On Thu, Mar 14, 2013 at 8:31 PM, Lutter, Robin robin.lut...@t-systems.com 
 wrote:
 Hi Claus and Filippo,

 Christian Schäfer had already filled a bug for this issue
 https://issues.apache.org/jira/browse/CAMEL-6056

 I attached a patch at it.

 Regards Robin


 Thanks for the patch. I am looking in that now.
 I assume you have tested the patch on your system and have it working?


 -Ursprüngliche Nachricht-
 Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Gesendet: Mittwoch, 13. März 2013 08:11
 An: users@camel.apache.org
 Betreff: Re: Files cannot be moved on FTP

 On Tue, Mar 12, 2013 at 8:36 PM, Lutter, Robin robin.lut...@t-systems.com 
 wrote:
 Hi Claus,

 i think the error is in method  FileUtil.isWindows() because it determines 
 the separator char for client os and not for server os. The given setting 
 for separator is ignored at this place.
 I would suggest to change FtpOperations line 656  to path =
 FileUtil.compactPath(path,
 endpoint.getConfiguration().getSeparator());

 Should I fill an jira ticket for 2.11?


 Yeah this sounds right, that if you have configured an separator as wither 
 unix or windows then we should use that from the configuration.
 If its AUTO we should not use any separator but leave the path slashes as is.

 Fell free to log a JIRA and attach a proposed patch.

 Regards Robin
 I think there is an similar thread from xuloo 'camel-ftp 2.10.4 fails to 
 connect on windows'

 -Ursprüngliche Nachricht-
 Von: Lutter, Robin
 Gesendet: Montag, 11. März 2013 15:57
 An: users@camel.apache.org
 Betreff: AW: Files cannot be moved on FTP

 Hi Claus,

 We are already using stepwise=false.
 This is the ftp-uri I have in my testcase:
 from(ftp://; + getFTPServerAddress() +
 /test?password=secret +
 ftpClient.dataTimeout=3stepwise=false +
 passiveMode=truebinary=true +
 move=successseparator=UNIX +
 antInclude=FILE.TXT)
 .log(${body});

 Tracing file.remote turns out, that  FileUtil normalizePath is using
 File.separator from local system and not the separator setting TRACE
 org.apache.camel.component.file.remote.FtpOperations -
 changeCurrentDirectory(/)
 TRACE org.apache.camel.component.file.remote.FtpOperations - Changing
 directory: \\

 With stepwise=true the extra escaped backslash is away:
 TRACE org.apache.camel.component.file.remote.FtpOperations -
 changeCurrentDirectory(/)
 TRACE org.apache.camel.component.file.remote.FtpOperations - Changing
 directory: \

 Regards Robin

 On Thu, Mar 7, 2013 at 12:04 AM, Claus Ibsen claus.ib...@gmail.com
 

Re: Integration of LMAX disruptor as a CAMEL endpoint

2013-03-20 Thread Claus Ibsen
Hi

Yeah this can be a good idea. I added a comment on that JIRA.
Just keep on hacking on it and make it mature and ready for donation.


On Mon, Mar 18, 2013 at 1:55 PM, ladoe00 lado...@yahoo.com wrote:
 Hi,

   I've created a JIRA issue a few weeks ago on this topic and I would like
 to know if this could be on the books for a future release.
 https://issues.apache.org/jira/browse/CAMEL-5828

 As pointed out in the JIRA task, there is a Github project that already
 started the endpoint code (I've been using it and it works.  Endpoint is not
 complete, but there is enough to use it).  I think it would be a great
 addition to CAMEL for cases like mine where performance is critical.  LMAX
 disruptor is pretty good when dealing with multiple producers/multiple
 consumers.  I've been using this as a replacement for SEDA queues when I
 need something that is non-blocking.

 Thanks!



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Integration-of-LMAX-disruptor-as-a-CAMEL-endpoint-tp5729343.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Files cannot be moved on FTP

2013-03-20 Thread Jean Francois LE BESCONT
Hi all !

I have the same problem with ftp transfert ( 550 Failed to change
directory.)

I am working with the 2.10.5-SNAPSHOT

An anonymous transfert from public ftp like :

from(
ftp://ftp.mozilla.org/pub/mozilla.org/b2g/manifests/1.0.0/2012/08/2012-08-15?stepwise=false
)
  .to(file://C:/temp/)
  .log(Download = ${file:name})
.end();

2013-03-20 14:24:55 - [fests/1.0.0/2012/08/2012-08-15] FtpConsumer
   INFO  Connected and logged in to:
ftp://anonym...@ftp.mozilla.org:21
2013-03-20 14:24:57 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
  INFO  Download = source_emulator-arm_2012-08-15.xml
2013-03-20 14:24:58 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
  INFO  Download = source_nexus-s_2012-08-15.xml
2013-03-20 14:24:59 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
  INFO  Download = source_otoro_2012-08-15.xml
2013-03-20 14:24:59 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
  INFO  Download = source_sgs2_2012-08-15.xml

Works good but when I try with my development ftp server ( solaris
accessible with winscp and which contains data ) a route :

from(ftp://devcyp05@192.168.0.203/tmp/JFL; + ?password=secret +
separator=UNIX + stepwise=false) .to(file://C:/temp/)
.log(Download = ${file:name}) .end();

No transfert are started, I just have :

2013-03-20 14:30:05 - [devcyp05@192.168.0.203/tmp/JFL] FtpConsumer
   INFO  Connected and logged in to: ftp://devcyp05@192.168.0.203:21

I have files in my /tmp/JFL directory :)

Any idea ?

Thanks


JF



2013/3/20 Claus Ibsen claus.ib...@gmail.com

 Hi

 So what is the status of your test. Can you break it down more clearly
 what works and doesn't work for you?
 Also can you post how you have configured the Camel ftp endpoints.



 On Wed, Mar 20, 2013 at 11:42 AM, Lutter, Robin
 robin.lut...@t-systems.com wrote:
  Hi Claus,
 
  Sorry for late response. Yes, I have successfully tested the patch in
 our environment. Thanks for applying it.
  Yesterday exception was gone but files where not moved using both
 SNAPSHOT versions
  Today my experience is, that using 2.10.5-SNAPSHOT with windows client
 and ftp server running on Linux or windows files will be moved.
  But with 2.11-SNAPSHOT using it with Linux ftp server - the exception is
 back again:
 
  org.apache.camel.component.file.GenericFileOperationFailedException:
 File operation failed: 550 Failed to change directory.
  Cannot change directory to: /. Code: 550]
  org.apache.camel.component.file.GenericFileOperationFailedException:
 File operation failed: 550 Failed to change directory.
   Cannot change directory to: /. Code: 550
  at
 org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:748)
  at
 org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:704)
  at
 org.apache.camel.component.file.remote.FtpOperations.buildDirectory(FtpOperations.java:285)
  at
 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:103)
  at
 org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:86)
  at
 org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:144)
  at
 org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)
  at
 org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:53)
 
  Regards Robin
  Tests using: camel-ftp-2.10.5-20130315.195903-8 and
 camel-ftp-2.11-20130320.060217-416
 
  -Ursprüngliche Nachricht-
  Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
  Gesendet: Freitag, 15. März 2013 09:59
  An: users@camel.apache.org
  Betreff: Re: Files cannot be moved on FTP
 
  On Thu, Mar 14, 2013 at 8:31 PM, Lutter, Robin 
 robin.lut...@t-systems.com wrote:
  Hi Claus and Filippo,
 
  Christian Schäfer had already filled a bug for this issue
  https://issues.apache.org/jira/browse/CAMEL-6056
 
  I attached a patch at it.
 
  Regards Robin
 
 
  Thanks for the patch. I am looking in that now.
  I assume you have tested the patch on your system and have it working?
 
 
  -Ursprüngliche Nachricht-
  Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
  Gesendet: Mittwoch, 13. März 2013 08:11
  An: users@camel.apache.org
  Betreff: Re: Files cannot be moved on FTP
 
  On Tue, Mar 12, 2013 at 8:36 PM, Lutter, Robin 
 robin.lut...@t-systems.com wrote:
  Hi Claus,
 
  i think the error is in method  FileUtil.isWindows() because it
 determines the separator char for client os and not for server os. The
 given setting for separator is ignored at this place.
  I would suggest to change FtpOperations line 656  to path =
  FileUtil.compactPath(path,
  endpoint.getConfiguration().getSeparator());
 
  Should I fill an jira ticket for 2.11?
 

Re: Files cannot be moved on FTP

2013-03-20 Thread Jean Francois LE BESCONT
In trace mode:

2013-03-20 14:37:01 - [devcyp05@192.168.0.203/tmp/JFL] FtpConsumer
   INFO  Connected and logged in to: ftp://devcyp05@192.168.0.203:21
2013-03-20 14:37:01 - [devcyp05@192.168.0.203/tmp/JFL] FtpConsumer
   TRACE doPollDirectory from absolutePath: tmp/JFL, dirName: null
2013-03-20 14:37:01 - [devcyp05@192.168.0.203/tmp/JFL] FtpConsumer
   TRACE Polling directory: tmp/JFL
2013-03-20 14:37:01 - [devcyp05@192.168.0.203/tmp/JFL] FtpOperations
   TRACE listFiles(tmp/JFL)
2013-03-20 14:37:01 - [devcyp05@192.168.0.203/tmp/JFL] FtpConsumer
   TRACE No files found in directory: tmp/JFL

No files are found, I also try with from(
ftp://devcyp05@192.168.0.203//tmp/JFL; ( double quote to do the tricks )
but it doesn't work to :

2013-03-20 14:39:56 - [vcyp05@192.168.0.203//tmp/JFL/] FtpConsumer
   TRACE Polling directory: /tmp/JFL
2013-03-20 14:39:56 - [vcyp05@192.168.0.203//tmp/JFL/] FtpOperations
   TRACE listFiles(/tmp/JFL)
2013-03-20 14:39:56 - [vcyp05@192.168.0.203//tmp/JFL/] FtpConsumer
   TRACE No files found in directory: /tmp/JFL
2013-03-20 14:39:56 - [vcyp05@192.168.0.203//tmp/JFL/] FtpConsumer
   DEBUG Took 0.247 seconds to poll: /tmp/JFL/
2013-03-20 14:39:56 - [vcyp05@192.168.0.203//tmp/JFL/] FtpConsumer
   TRACE postPollCheck on ftp://devcyp05@192.168.0.203:21
2013-03-20 14:39:56 - [vcyp05@192.168.0.203//tmp/JFL/] FtpConsumer
   TRACE prePollCheck on ftp://devcyp05@192.168.0.203:21

Strange no ?





2013/3/20 Jean Francois LE BESCONT jflebesc...@gmail.com

 Hi all !

 I have the same problem with ftp transfert ( 550 Failed to change
 directory.)

 I am working with the 2.10.5-SNAPSHOT

 An anonymous transfert from public ftp like :

 from(
 ftp://ftp.mozilla.org/pub/mozilla.org/b2g/manifests/1.0.0/2012/08/2012-08-15?stepwise=false
 )
   .to(file://C:/temp/)
   .log(Download = ${file:name})
 .end();

 2013-03-20 14:24:55 - [fests/1.0.0/2012/08/2012-08-15] FtpConsumer
INFO  Connected and logged in to:
 ftp://anonym...@ftp.mozilla.org:21
 2013-03-20 14:24:57 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
 INFO  Download = source_emulator-arm_2012-08-15.xml
 2013-03-20 14:24:58 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
 INFO  Download = source_nexus-s_2012-08-15.xml
 2013-03-20 14:24:59 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
 INFO  Download = source_otoro_2012-08-15.xml
 2013-03-20 14:24:59 - [fests/1.0.0/2012/08/2012-08-15] MED_DOWNLOAD_CDR
 INFO  Download = source_sgs2_2012-08-15.xml

 Works good but when I try with my development ftp server ( solaris
 accessible with winscp and which contains data ) a route :

 from(ftp://devcyp05@192.168.0.203/tmp/JFL; + ?password=secret +
 separator=UNIX + stepwise=false) .to(file://C:/temp/)
 .log(Download = ${file:name}) .end();

 No transfert are started, I just have :

 2013-03-20 14:30:05 - [devcyp05@192.168.0.203/tmp/JFL] FtpConsumer
  INFO  Connected and logged in to:
 ftp://devcyp05@192.168.0.203:21

 I have files in my /tmp/JFL directory :)

 Any idea ?

 Thanks


 JF



 2013/3/20 Claus Ibsen claus.ib...@gmail.com

 Hi

 So what is the status of your test. Can you break it down more clearly
 what works and doesn't work for you?
 Also can you post how you have configured the Camel ftp endpoints.



 On Wed, Mar 20, 2013 at 11:42 AM, Lutter, Robin
 robin.lut...@t-systems.com wrote:
  Hi Claus,
 
  Sorry for late response. Yes, I have successfully tested the patch in
 our environment. Thanks for applying it.
  Yesterday exception was gone but files where not moved using both
 SNAPSHOT versions
  Today my experience is, that using 2.10.5-SNAPSHOT with windows client
 and ftp server running on Linux or windows files will be moved.
  But with 2.11-SNAPSHOT using it with Linux ftp server - the exception
 is back again:
 
  org.apache.camel.component.file.GenericFileOperationFailedException:
 File operation failed: 550 Failed to change directory.
  Cannot change directory to: /. Code: 550]
  org.apache.camel.component.file.GenericFileOperationFailedException:
 File operation failed: 550 Failed to change directory.
   Cannot change directory to: /. Code: 550
  at
 org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:748)
  at
 org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:704)
  at
 org.apache.camel.component.file.remote.FtpOperations.buildDirectory(FtpOperations.java:285)
  at
 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:103)
  at
 org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:86)
  at
 

bean dont work

2013-03-20 Thread takidean
i use to extract some information from an xml file to insert them into a jdbc
data base this is what i did and it doesn't work 

**main*** 
public class Cntx { 

/** 
 * @param args 
 * @throws Exception 
 */ 
public static void main(String[] args) throws Exception { 
// TODO Auto-generated method stub 
CamelContext context = new DefaultCamelContext(); 
context.addRoutes(new MyRouteBuilder()); 
context.start(); 
Thread.sleep(3000); 
context.stop(); 
} 

} 
***MyrouteBuilder*** 
public class MyRouteBuilder extends RouteBuilder { 

/** 
 * Let's configure the Camel routing rules using Java code... 
 */ 
public void configure() { 

// here is a sample which processes the input files 
// (leaving them in place - see the 'noop' flag) 
// then performs content based routing on the message using XPath 
from(file:src/data) 
.choice() 
.when(xpath(/person/user = 'SFIN')) 
.to(bean:OrderToSql).to(bean:SfinPull); 
} 

} 
*OrderToSqlBean** 
public class OrderToSql { 

   public String toSql(@XPath(order/@firstName) String name, 
   @XPath(order/@lastName) int amount, 
   @XPath(order/@city) String customer) { 
StringBuilder sb = new StringBuilder(); 
sb.append(insert into examen.user ); 
sb.append((name, lastname, city) values (); 
sb.append(').append(name).append(', ); 
sb.append(').append(amount).append(', ); 
sb.append(').append(customer).append(') ); 
return sb.toString(); 
} 
} 
**SfinPull***/ 
public class SfinPull { 

public void Pull(String s) throws SQLException,
ClassNotFoundException{ 

 String url = jdbc:mysql://localhost:3306/examen; 
 String login = root; 
 String pass = ; 
 Class.forName(com.mysql.jdbc.Driver); 
 Connection connection = DriverManager.getConnection(url, login,
pass); 
 PreparedStatement ps=connection.prepareStatement(s); 
ps.executeUpdate(); 

} 

}



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


Re: Stream Caching Kills my Routes

2013-03-20 Thread Claus Ibsen
On Wed, Mar 20, 2013 at 2:10 PM, rouble r.ou...@gmail.com wrote:
 Camel aficionados,

 I have a simple http proxy route in Camel 2.8:
 from(servlet:///proxyWebService/api/?matchOnUriPrefix=true)
 .process(preprocessor)
 
 .recepientlist(https4://realWebService:8443/api/?bridgeEndpoint=truethrowExceptionOnFailure=false)
 .process(postprocessor)

 Now, if I enable stream caching with:
 getContext().setStreamCaching(true);
 I notice that larger messages are not making it back to the client.

 If I disable spooling to disk with:
 getContext().getProperties().put(CachedOutputStream.THRESHOLD, 
 0);

 The messages pass through fine. Is this a known issue?


Yeah could be since you are using an old Camel version.

You can try with the latest release to see if that works without
disabling that spool to disk.

Though the default threshold of 64KB may be low in todays servers. So
we should consider bumping that up.
And also Camel should IMHO log this threads-hold if its in use, so
people can notice it.

Let me log a JIRA

 tia,
 rouble



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Multiple guava-event-bus consumers issue

2013-03-20 Thread Claus Ibsen
Hi

Yeah I am not sure with the nature of guava eventbus. If its pub/sub
based then yeah it could make sense to allow 2+ consumers on the same
topic name.

For that to happen, the endpoint need to implement, then Camel knows its allowed
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/MultipleConsumersSupport.html

I think it was Henryk or someone else from the community who created
this component. He may be able to provide more information.

Also feel free to figure this out as well. And if its possible, then
we love contributions.
http://camel.apache.org/contributing.html

And patches is welcome and all that.



On Tue, Mar 12, 2013 at 1:32 PM, wpaciorkowski wpaciorkow...@pl.sii.eu wrote:


 Hi everyone,

 Just tried to use guava eventBus (11.0.2) with camel
 2.10.3 and found following issue:

 When consuming messages from more
 than one route with the same endpoint URI (lets say:
 guava-eventbus:eventBus), context doesn't start and throws exception:


 Caused by: org.apache.camel.FailedToStartRouteException: Failed to
 start route saveEvents-2 because of Multiple consumers for the same
 endpoint is not allowed: Endpoint[guava-eventbus://eventBus]

  at
 org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:2019)

 at
 org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:1995)

 at
 org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1923)

 at
 org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1702)

 at
 org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1583)

 at
 org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1444)

 at
 org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)

 at
 org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)

 at
 org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1412)

 at
 org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)

 at
 org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)

 ... 38 more

 My context is more or less like:

 Simple adding parameter
 to second endpoint URI makes the problem go away:

 But it's not a
 solution, just workaround. Shouldn't it just work with same endpoint
 URI?
 I'm not even sure if this is a guava related problem.
 Thanx in
 advance,
 Wojtek
 --

 WOJCIECH PACIORKOWSKI
 Architekt Integracji

 SII
 SP. Z O. O.
  +48 22 486 37 37 office
  Al. Niepodległości 69 | 02-626
 Warsaw | Poland

 www.pl.sii.eu [1]

 _Sii Sp. z o.o. z siedzibą w
 Warszawie, wpisany pod numerem KRS: 249203 do Rejestru
 Przedsiębiorców, prowadzonego przez Sąd Rejonowy dla miasta stołecznego
 Warszawy, XIII Wydział Gospodarczy Krajowego Rejestru Sądowego; wysokość
 kapitału zakładowego i kapitału wpłaconego: 40 PLN. __NIP: 525 23 52
 907; REGON: 140381516_

 Links:
 --
 [1] http://www.pl.sii.eu



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: ClassNotFoundException: org.apache.xalan.xsltc.trax.DOM2SAX

2013-03-20 Thread Smith-John
I replaced the old 2.10.3 camel bundles with the new 2.10.4 ones.

But now camel somehow even can't start because of not finding its
components:

e.g.

Failed to resolve endpoint: stream://out due to: No component found with
scheme: stream
or 
Failed to resolve endpoint: direct://WS due to: No component found with
scheme: direct


ss on console says that all camel and needed bundles are active.




--
View this message in context: 
http://camel.465427.n5.nabble.com/ClassNotFoundException-org-apache-xalan-xsltc-trax-DOM2SAX-tp5728455p5729521.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Couchdb peer not authenticated exception

2013-03-20 Thread Claus Ibsen
Hi

Not sure, I am afraid you may need to debug the code a bit or check
the logs etc.

Did you find out more about this?


On Sun, Mar 17, 2013 at 10:17 PM, hangstrap hangst...@gmail.com wrote:
 Hi

 I have been trying to use camel-couchdb to send data to a couchDb datastore


 My code looks like

 .to(
 couchdb:https://hangstrap.iriscouch.com/test?username=hangstrappassword=;);

 When the code runs a get a  javax.net.ssl.SSLPeerUnverifiedException: peer
 not authenticated exception
 from the CouchDbClientBase.executeRequest method.

 However, when I past the url
 https://hangstrap.iriscouch.com/test?username=hangstrappassword= into
 my browser I can connect to my couchDB without problems.

 Any ideas what I am missing out?

 Thanks





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Couchdb-peer-not-authenticated-exception-tp5729323.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: HTTP Basic Authentication

2013-03-20 Thread Claus Ibsen
Hi

Not sure if you can configure the http client to follow redirects,
that may allow the http client
to detect the redirect and provide the credentials for basic auth
after the redirect.



On Wed, Mar 20, 2013 at 1:37 PM, cgsk karthik2...@gmail.com wrote:
 Hi There,

 I am using Jetty endpoint exposed which invokes a external service using
 HTTP component and the external service requires a Basic Auth. So I am
 passing the query parameters as below:

 bridgeEndpoint=trueauthMethod=BasicthrowExceptionOnFailure=falseauthUsername=usernameauthPassword=authPassword

 It works fine in Firefox, but when invoked using Chrome, it discards the
 Basic auth params and it does a retry again with Basic Auth params added in
 the retry call. Any idea about why there is difference in Chrome compared to
 Firefox? Do we need add any additional param in camel http call to handle
 this?



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



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: How to escape commas(,) in CSV file

2013-03-20 Thread sarfaraj
In our input csv I am getting the data with double quotes ( ). like below

ID,NAME,ADDR 
1,Sarfaraj Sayyad,Pune,India 

but camel csv component created without double quotes.  (1,Sarfaraj
Sayyad,Pune,India )

How do we create the csv with double quotes using camel csv component ? is
it possible ?

/Sarfaraj



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


AW: Files cannot be moved on FTP

2013-03-20 Thread Lutter, Robin
Hi Claus,

sorry for being unclear.
My Testroute running on Windows7 client is following;

from(ftp://; + getFTPServerAddress() +
/test/ftpmove +
?password=top_secret +
ftpClient.dataTimeout=3 +
stepwise=false +
passiveMode=true +
binary=true +
move=success +
separator=UNIX +
antInclude=TestFile*.xyz)
.log(${body});

I run this against RHEL linux ftp server 
With 2.10.5-SNAPSHOT it works as expected
With 2.11-SNAPSHOT I got exception descriped earlier. Files are consumed but 
not moved after route completion.

Robin

-Ursprüngliche Nachricht-
Von: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Gesendet: Mittwoch, 20. März 2013 14:04
An: users@camel.apache.org
Betreff: Re: Files cannot be moved on FTP

Hi

So what is the status of your test. Can you break it down more clearly what 
works and doesn't work for you?
Also can you post how you have configured the Camel ftp endpoints.



On Wed, Mar 20, 2013 at 11:42 AM, Lutter, Robin robin.lut...@t-systems.com 
wrote:
 Hi Claus,

 Sorry for late response. Yes, I have successfully tested the patch in our 
 environment. Thanks for applying it.
 Yesterday exception was gone but files where not moved using both 
 SNAPSHOT versions Today my experience is, that using 2.10.5-SNAPSHOT with 
 windows client and ftp server running on Linux or windows files will be moved.
 But with 2.11-SNAPSHOT using it with Linux ftp server - the exception is back 
 again:

 org.apache.camel.component.file.GenericFileOperationFailedException: File 
 operation failed: 550 Failed to change directory.
 Cannot change directory to: /. Code: 550]
 org.apache.camel.component.file.GenericFileOperationFailedException: File 
 operation failed: 550 Failed to change directory.
  Cannot change directory to: /. Code: 550
 at 
 org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:748)
 at 
 org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:704)
 at 
 org.apache.camel.component.file.remote.FtpOperations.buildDirectory(FtpOperations.java:285)
 at 
 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:103)
 at 
 org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:86)
 at 
 org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:144)
 at 
 org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)
 at 
 org.apache.camel.component.file.GenericFileOnCompletion.onComplete(Gen
 ericFileOnCompletion.java:53)

 Regards Robin
 Tests using: camel-ftp-2.10.5-20130315.195903-8 and 
 camel-ftp-2.11-20130320.060217-416

 -Ursprüngliche Nachricht-
 Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Gesendet: Freitag, 15. März 2013 09:59
 An: users@camel.apache.org
 Betreff: Re: Files cannot be moved on FTP

 On Thu, Mar 14, 2013 at 8:31 PM, Lutter, Robin robin.lut...@t-systems.com 
 wrote:
 Hi Claus and Filippo,

 Christian Schäfer had already filled a bug for this issue
 https://issues.apache.org/jira/browse/CAMEL-6056

 I attached a patch at it.

 Regards Robin


 Thanks for the patch. I am looking in that now.
 I assume you have tested the patch on your system and have it working?


 -Ursprüngliche Nachricht-
 Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Gesendet: Mittwoch, 13. März 2013 08:11
 An: users@camel.apache.org
 Betreff: Re: Files cannot be moved on FTP

 On Tue, Mar 12, 2013 at 8:36 PM, Lutter, Robin robin.lut...@t-systems.com 
 wrote:
 Hi Claus,

 i think the error is in method  FileUtil.isWindows() because it determines 
 the separator char for client os and not for server os. The given setting 
 for separator is ignored at this place.
 I would suggest to change FtpOperations line 656  to path = 
 FileUtil.compactPath(path, 
 endpoint.getConfiguration().getSeparator());

 Should I fill an jira ticket for 2.11?


 Yeah this sounds right, that if you have configured an separator as wither 
 unix or windows then we should use that from the configuration.
 If its AUTO we should not use any separator but leave the path slashes as is.

 Fell free to log a JIRA and attach a proposed patch.

 Regards Robin
 I think there is an similar thread from xuloo 'camel-ftp 2.10.4 fails to 
 connect on windows'

 -Ursprüngliche Nachricht-
 Von: Lutter, Robin
 Gesendet: Montag, 11. März 2013 15:57
 An: users@camel.apache.org
 Betreff: AW: Files cannot be moved on FTP

 Hi Claus,

 We are already using stepwise=false.
 This is the ftp-uri I have in my testcase:
 from(ftp://; + 

Re: How to escape commas(,) in CSV file

2013-03-20 Thread Henryk Konsek
 How do we create the csv with double quotes using camel csv component ? is
 it possible ?

Actually I've already explained this in my previous post. Please do
kindly refer to it. :)

Best regards.

--
Henryk Konsek
http://henryk-konsek.blogspot.com


High accuracy scheduler

2013-03-20 Thread Gert Villemos
I need to create a schedule, i.e. a list of messages with a specific delivery
time, with 100s of milliseconds accuracy. The route has only one recipent.

Currently I have implemented it using ActiveMQ and the AMY_SCHEDULED_DELAY.
The scheduling is working, but the accuracy is poor; the messages get
delivered out of order (not much, but sometimes upto a few seconds, which is
enough to upset my schedule).

I have checked my code and it seem ok. The list gets generated with the
right timestamps. The AMY_SCHEDULED_DELAY get set correctly.

Before I go an implement my own bean for this; Is there another way way to
schedule messages for delivery?

What I need is a single route where;
0. From an activemq with an event.
1. One split bean/method will generate a List (the schedule). Each element
will have a time for delivery.
2. The messages thereafter get parsed on in the route at their scheduled
delivery time.



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


Re: ClassNotFoundException: org.apache.xalan.xsltc.trax.DOM2SAX

2013-03-20 Thread Smith-John
Mhhh... lowering the Start Level of camel-stream and camel-core bundle
fixed this exceptions of not finding the components .

But now I'm getting:

17:54:07.812  ERROR  o.a.camel.processor.DefaultErrorHandler:215Failed
delivery for (MessageId: ID-54038-1363798294273-1-2 on ExchangeId:
ID-54038-1363798294273-1-1). Exhausted after delivery attempt: 1 caught:
org.apache.camel.NoSuchBeanException: No bean could be found in the registry
for: myBeanInterface.MyBeanInterface
org.apache.camel.NoSuchBeanException: No bean could be found in the registry
for: myBeanInterface.MyBeanInterface
at
org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:77)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:67)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:101)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)
~[camel-core-2.10.4.jar:2.10.4]
at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
~[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
[camel-core-2.10.4.jar:2.10.4]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
[camel-core-2.10.4.jar:2.10.4]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
[camel-core-2.10.4.jar:2.10.4]
at

Re: camel http- to call https service does not import certificates automatically

2013-03-20 Thread santhosh
I think the previous post is the way to do.We/I dont automatically import
certs.That said i dont your requirements.I have a post explaining the way
httpClient should be used in camel in camel user forums.Search for all my
post you will have the full working code.That should use your trust store
instead of cacert. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-http-to-call-https-service-does-not-import-certificates-automatically-tp5729413p5729537.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Couchdb peer not authenticated exception

2013-03-20 Thread santhosh
Whatever server you are using, turn on SSL logs. 
http://docs.oracle.com/javase/1.5.0/docs/guide/security/jsse/ReadDebug.html
. it usually lands up on console and not file atleast in karaf/smx. i mean
the SSL logs not your custom logging.It will tell you all steps in cert
exchange.The link  explains how to interpret SSL logs.If you do that it
should be pretty straight forward. 

or just run a unit test with just SSL logs turned on.No appl server .This is
pretty much a cert exchange problem.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Couchdb-peer-not-authenticated-exception-tp5729323p5729541.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel receipient list with interceptor

2013-03-20 Thread santhosh
I have read through it and i couldnt figure anything out for reasons i
mentioned in previous post.Rephrasing my questions  short

1)Is there a property in exchange which says the which endpoint the message
is intended for??Can i use it in multicast for identifying the endpoint for
which exchange will be used.
2)Is there a way to intercept message to dynamic endpoint.Endpoint that will
be available only in runtime.



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


Re: camel http- to call https service does not import certificates automatically

2013-03-20 Thread santhosh
i went through my post and got the code :)

public void configureHttpClient(org.apache.http.client.HttpClient
httpClient) {
   
try {
   
final BasicHttpParams httpParams = new
BasicHttpParams();

//if you want all host be rcognised irrespective of
ones in cert
HostnameVerifier hostnameVerifier =
org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;

// load the keystore containing the client
certificate - keystore
// type is probably jks or pkcs12
final KeyStore keystore =
KeyStore.getInstance(jks);
InputStream keystoreInput = new FileInputStream(new
File(
sslcerts/keystore.jks));
   
keystore.load(keystoreInput,
yourpassword.toCharArray());

// load the trustore, leave it null to rely on
cacerts distributed
// with the JVM - truststore type is probably jks or
pkcs12
KeyStore truststore = KeyStore.getInstance(jks);
InputStream truststoreInput = new
FileInputStream(new File(
sslcerts/truststore.jks));
   
truststore.load(truststoreInput,
password.toCharArray());

   
SSLSocketFactory socketFactory = new
SSLSocketFactory(keystore,
store password, truststore);
socketFactory
   
.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier);
   
   
httpClient.getConnectionManager().getSchemeRegistry().register(new
Scheme(https, socketFactory, 443));

} catch (Exception e) {
// TODO remove and add log into DB
e.printStackTrace();
}

}
}

useful debugging info if you are using karaf/smx
For turning on the ssl log in karaf which is mighty helpful i did add this
in java options section in karaf.bat
-Djavax.net.debug=all .This  might not be correct way but it works and this
is the only way i could figure from internet :)

of course you have to modify this code and i neither approve/dissaprove the
use of your own trust store.





--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-http-to-call-https-service-does-not-import-certificates-automatically-tp5729413p5729552.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Aggregator Strategy Question

2013-03-20 Thread Jothi
I have tried the following to achieve what I want. But I ran into some
errors:

My Route:

from(file:C:\\Users\\joe\\Desktop\\csv?noop=true).
unmarshal().csv().process(new
RefDataProcessor()).to(direct:Process);

from(file:C:\\Users\\joe\\Desktop\\csv2?noop=true).
 unmarshal().csv().process(new
RefDataProcessor()).to(direct:Process);

from(direct:Process).aggregate(header(id), new
RefDataAggregationStrategy()).completionTimeout(3000).to(direct:Processed);

The error that I get is the following:

[Users%5Cjoe%5CDesktop%5Ccsv] DefaultErrorHandlerERROR Failed
delivery for (MessageId: ID-HP10007131-52648-1363799287926-0-1 on
ExchangeId: ID-HP10007131-52648-1363799287926-0-3). Exhausted after delivery
attempt: 1 caught: org.apache.camel.CamelExchangeException: Invalid
correlation key. Exchange[null]

What should I understand from the invalid correlation key error message?



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


Re: Camel Aggregator Strategy Question

2013-03-20 Thread Jothi
I modified my route to look like below:

   
from(file:C:\\Users\\joe\\Desktop\\csv?noop=true).setHeader(isBuToPf,
simple(true)).
unmarshal().csv().process(new
RefDataProcessor()).to(direct:Process);

   
from(file:C:\\Users\\joe\\Desktop\\csv2?noop=true).setHeader(isBuToPf,
simple(true)).
 unmarshal().csv().process(new
RefDataProcessor()).to(direct:Process);

from(direct:Process).aggregate(header(isBuToPf), new
RefDataAggregationStrategy()).completionTimeout(3000).to(direct:Processed);

Now I get a NullPointerException in my aggregator. My aggregator looks like:

@Override
public Exchange aggregate(Exchange exchange, Exchange exchange2) {

final StringBuilder sb = new StringBuilder();

final Map  String, List  String   buToPf =
exchange.getIn().getBody(Map.class); // NullPointer here...

final Map  String, List  String   pfToUser =
exchange2.getIn().getBody(Map.class);

for (Map.Entry  String, List  String   entry :
buToPf.entrySet()) {
for (String pf : entry.getValue()) {
List  String  userList = pfToUser.get(pf);
for (String user : userList) {
sb.append(entry.getKey() + , + pf + , + user +
GO);
}
}
}
System.out.println(sb);

exchange.getIn().setBody(sb);
return exchange;
}

What I do in my RefDataProcessor.java is the following:

@Override
public void process(Exchange exchange) throws Exception {

final Map  String, List  String   buToPfMap = new HashMap 
String, List  String   ();

final List  List  String   data = (List  List  String   )
exchange.getIn().getBody();
for (List  String  line : data) {
putToMap(line.get(0), line.get(1), buToPfMap);
}

System.out.println(buToPfMap);

exchange.getIn().setBody(buToPfMap);
}

Why is there nothing in exchange?



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


Re: Camel Aggregator Strategy Question

2013-03-20 Thread Claus Ibsen
Hi

Please read the documentation and research a bit first yourself.

For example with Java code there is javadoc that documents the API.
So if you read the API of the aggregate method, you will find about the null.

http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html


On Wed, Mar 20, 2013 at 6:42 PM, Jothi codeintheo...@gmail.com wrote:
 I modified my route to look like below:


 from(file:C:\\Users\\joe\\Desktop\\csv?noop=true).setHeader(isBuToPf,
 simple(true)).
 unmarshal().csv().process(new
 RefDataProcessor()).to(direct:Process);


 from(file:C:\\Users\\joe\\Desktop\\csv2?noop=true).setHeader(isBuToPf,
 simple(true)).
  unmarshal().csv().process(new
 RefDataProcessor()).to(direct:Process);

 from(direct:Process).aggregate(header(isBuToPf), new
 RefDataAggregationStrategy()).completionTimeout(3000).to(direct:Processed);

 Now I get a NullPointerException in my aggregator. My aggregator looks like:

 @Override
 public Exchange aggregate(Exchange exchange, Exchange exchange2) {

 final StringBuilder sb = new StringBuilder();

 final Map  String, List  String   buToPf =
 exchange.getIn().getBody(Map.class); // NullPointer here...

 final Map  String, List  String   pfToUser =
 exchange2.getIn().getBody(Map.class);

 for (Map.Entry  String, List  String   entry :
 buToPf.entrySet()) {
 for (String pf : entry.getValue()) {
 List  String  userList = pfToUser.get(pf);
 for (String user : userList) {
 sb.append(entry.getKey() + , + pf + , + user +
 GO);
 }
 }
 }
 System.out.println(sb);

 exchange.getIn().setBody(sb);
 return exchange;
 }

 What I do in my RefDataProcessor.java is the following:

 @Override
 public void process(Exchange exchange) throws Exception {

 final Map  String, List  String   buToPfMap = new HashMap 
 String, List  String   ();

 final List  List  String   data = (List  List  String   )
 exchange.getIn().getBody();
 for (List  String  line : data) {
 putToMap(line.get(0), line.get(1), buToPfMap);
 }

 System.out.println(buToPfMap);

 exchange.getIn().setBody(buToPfMap);
 }

 Why is there nothing in exchange?



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



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Zookeeper read all child nodes

2013-03-20 Thread bhcohen
I'm probably missing something obvious but I'm struggling with what seems
like a simple Camel/Zookeeper problem.

I have a zookeeper tree like:

/parent
/parent/child1
/parent/child2
/parent/child3

where the child nodes are ephemeral nodes so I don't know ahead of time what
or how many children I will have.

I'd like to be able to generate a message containing the data for each child
node when my Camel application starts and generate a message containing the
data for new child nodes as they are added.

I started with an route like:

   from
uri=zookeeper:host:port/parent?listChildren=trueamp;repeate=true/
   split
  simple${body}/simple
  to ..
   /split

but that is just giving me the child node names.  I'm not sure how I can
take the output of this route to subsequently retrieve the data for each
node.

Is this possible? 

Thanks in advance,
   Bruce








--
View this message in context: 
http://camel.465427.n5.nabble.com/Zookeeper-read-all-child-nodes-tp5729557.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Configure clientConnectionManager endpoint option in camel hhtp4

2013-03-20 Thread Guillermo
Hi,

I'm writting because I'm trying to configure the clientConnectionManager
httpEndpoint Option using camel-http4 but I'm having some problems. 

In my endpoint definition (same endpoint, different configs each time) I'm
adding the option ?clientConnectionManager=XXX where XXX is a reference to a
custom org.apache.http.conn.ClientConnectionManager in the registry (a new
SingleClientConnManager in my case). In my route, I retrieve an HttpEndpoint
like this:

HttpEndpoint httpEndpoint = (HttpEndpoint)
CamelContextHelper.getMandatoryEndpoint(camelContext, endpointUri); 

And after that, an exception is thrown:

Failed to resolve endpoint:
https4://hostname?clientConnectionManager=XXXhttpClient.soTimeout=6httpClientConfigurer=YYY
due to: Could not find a suitable setter for property:
clientConnectionManager 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:
org.apache.http.conn.ClientConnectionManager with value XXX

My question is: What is the correct way to configure this option? I need
that to use a different connection manager when I'm configuring each
httpClient with the option httpClientConfigurer (in this case the appropiate
configuration is set and registered and I'm using the same way to do that
but with the other option is not working).

Thanks in advance.

Guillermo.

Additional info:
Using camel version 2.9.1 





--
View this message in context: 
http://camel.465427.n5.nabble.com/Configure-clientConnectionManager-endpoint-option-in-camel-hhtp4-tp5729558.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multiple guava-event-bus consumers issue

2013-03-20 Thread Henryk Konsek
Hi Wojtek,

 When consuming messages from more
 than one route with the same endpoint URI (lets say:
 guava-eventbus:eventBus), context doesn't start and throws exception

Actually I used multicast EIP to copy message from the given event bus
to multiple destination...

from(guava-eventbus:myBus).multicast(seda:queue1, seda:queue2)

But indeed, Guava EventBus component should support multiple consumers
out-of-the-box as well. Thank you for pointing this out.

I've committed the fix in the SVN revision 1458998. The fix will be
included in the next version of Camel (2.10.5 or 2.11.0). I don't
create backport fixes as this issue can be easily workarounded with
multicast or just by adding parameter to the endpoint URI (just as you
did).

Best regards.

--
Henryk Konsek
http://henryk-konsek.blogspot.com


When are @Consumed methods called by the JPA component?

2013-03-20 Thread moxximus
I've ran into a bit of odd behavior from the JPA component. I've configured a
JPA consumption route as follows:

from(jpa:com.models.MyRecord?consumeDelete=falseconsumer.query=select r
from com.models.MyRecord r where r.batchID = NULL).to(direct:jpaOut);

The model contains the following update function:

@Consumed
public void consume() {
batchID = MyNewBatch;
}

This updates the database perfectly fine, as expected. My issue comes in
when attempting to use the batchID further down the route. I thought that
the @Consumed function would be executed before the message is passed out of
the JPA component. I've tried synchronizing all functions that interact with
the batchID field but this doesn't resolve the issue. This leads me to
believe that the @Consumed function isn't guaranteed to be executed before
the message is passed out of the JPA component.

Can any confirm or deny this? I can put together a unit test from my code if
someone can confirm this is unexpected behavior.



--
View this message in context: 
http://camel.465427.n5.nabble.com/When-are-Consumed-methods-called-by-the-JPA-component-tp5729562.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel receipient list with interceptor

2013-03-20 Thread santhosh
I will answer this question myself .You can find the endpoint which the
exchange is used by using

exchange.getProperty(CamelToEndpoint) .



To answer the overall question - how to manipulate the message in
recipient/multicast according to endpoint keeping in mind the endpoint list
will be created dynamically at runtime.What it means is we would know which
endpoints the message needs to be mulitcasted only at runtime and before it
gets sent we need to perform endpoint specific message manipulation.

recipientList 
parallelProcessing=true streaming=true
id=recipientList 
strategyRef=StringAggregationStrategy
timeout=2500 
onPrepareRef=CustomExchangeMessage  delimiter=,
ignoreInvalidEndpoints=true

headerendpointList/header

/recipientList

The below class is just an idea out of my mind.in real use case the
recipient list will be populated dynamically and the exchange body
manipulation will be dynamic.I dont know if this is the recommended way but
i think it  will work .Please let me know if see any obvious problems

public class  CustomExchangeMessage  implements Processor {
  public void process(Exchange exchange) throws Exception {
String body = exchange.getIn().getBody(String.class);
String toEndpoint=exchange.getProperty(CamelToEndpoint);
 //this is a simple if now .but this will be where the dynamic 
part
willl kick in.
 if(toEndpoint.equalsIgnoreCase(A))
 {
   //manipulate the body for endpoint A 
 }
 if(toEndpoint.equalsIgnoreCase(B))
 {
 //manipulate the body for endpoint B
 }


}

}


This question has been answered and can be closed.




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


Camel-Spring Application Start and Stop

2013-03-20 Thread ganeshkumar.kanagavel
Hi,
Have got a basic question.

I would like to understand the prescribed method of starting and stopping the 
Camel-spring application?

We are planning to have this application on the standalone, so need to 
understand how to start and stop after deploying into the server.

Any model script will help us.

Thanks
Ganesh

___

This message may contain information that is confidential or privileged. If you 
are not an intended recipient of this message, please delete it and any 
attachments, and notify the sender that you have received it in error. Unless 
specifically stated in the message or otherwise indicated, you may not 
uplicate, redistribute or forward this message or any portion thereof, 
including any attachments, by any means to any other person, including any 
retail investor or customer. This message is not a recommendation, advice, 
offer or solicitation, to buy/sell any product or service, and is not an 
official confirmation of any transaction. Any opinions presented are solely 
those of the author and do not necessarily represent those of Barclays.

This message is subject to terms available at: www.barclays.com/emaildisclaimer 
and, if received from Barclays' Sales or Trading desk, the terms available at: 
www.barclays.com/salesandtradingdisclaimer/. By messaging with Barclays you 
consent to the foregoing. Barclays Bank PLC is a company registered in England 
(number 1026167) with its registered office at 1 Churchill Place, London, E14 
5HP. This email may relate to or be sent from other members of the Barclays 
group.

___


Re: Quartz and jdbc

2013-03-20 Thread Christian Müller
I recommend to use the CamelTestSupport base class for your unit tests.
Have a look at the following tests:
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/

Best,
Christian

On Thu, Mar 14, 2013 at 10:16 AM, uzairkamal uzair.ka...@iacgrp.com wrote:

 Hello Camel Community,

 I am new to Apache camel, this might be a very basic issue, but i am unable
 to figure it out.
  I am having some problem while making calls from jdc component to database
 while having schedular on.

 I am getting an exception  like as follow

 INFO: Job execution threads will use class loader of thread: main
 Mar 14, 2013 1:14:20 PM org.quartz.simpl.RAMJobStore initialize
 INFO: RAMJobStore initialized.
 Mar 14, 2013 1:14:20 PM org.quartz.impl.StdSchedulerFactory instantiate
 INFO: Quartz scheduler 'DefaultQuartzScheduler-camel-1' initialized from an
 externally provided properties instance.
 Mar 14, 2013 1:14:20 PM org.quartz.impl.StdSchedulerFactory instantiate
 INFO: Quartz scheduler version: 1.4.4
 Mar 14, 2013 1:14:23 PM org.quartz.core.QuartzScheduler shutdown
 INFO: Scheduler DefaultQuartzScheduler-camel-1_$_NON_CLUSTERED shutting
 down.
 Mar 14, 2013 1:14:23 PM org.quartz.core.QuartzScheduler pause
 INFO: Scheduler DefaultQuartzScheduler-camel-1_$_NON_CLUSTERED paused.
 Mar 14, 2013 1:14:23 PM org.quartz.core.QuartzScheduler shutdown
 INFO: Scheduler DefaultQuartzScheduler-camel-1_$_NON_CLUSTERED shutdown
 complete.
 java.lang.UnsupportedOperationException: Not supported
 at

 org.apache.camel.component.jdbc.JdbcEndpoint.createConsumer(JdbcEndpoint.java:52)
 at

 org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
 at
 org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:80)
 at org.apache.camel.impl.RouteService.warmUp(RouteService.java:133)
 at

 org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1986)
 at

 org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1914)
 at

 org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1702)
 at

 org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1583)
 at

 org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1444)
 at
 org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
 at

 org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1412)
 at CamelTests.test(CamelTests.java:99)
 at abc.main(abc.java:17)


 I am also pasting my calling code


 import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
 import java.util.List;
 import java.util.Map;

 import org.apache.camel.*;

 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.jdbc.JdbcEndpoint;
 import org.apache.camel.component.mock.MockComponent;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.component.quartz.QuartzComponent;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.impl.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.camel.util.jndi.JndiContext;


 /*
  * To change this template, choose Tools | Templates and open the template
 in
  * the editor.
  */
 /**
  *
  * @author Uzair
  */
 public class CamelTests {

 public void test() throws Exception {

 JndiRegistry registry = new JndiRegistry(new JndiContext());
 final CamelContext camelCtxt = new DefaultCamelContext(registry);
 MysqlDataSource datasource = getDataSource();
final JdbcEndpoint endpoint = getJDBCEndPoint(datasource,
 camelCtxt);

 registry.bind(intuira, getDataSource());

 camelCtxt.addEndpoint(direct:start, endpoint);
 QuartzComponent quartz = new QuartzComponent(camelCtxt);
 MockComponent mockComponent = new MockComponent();
 mockComponent.setCamelContext(camelCtxt);
 Endpoint mockEndPoint =
 mockComponent.createEndpoint(mock:results);
 camelCtxt.addEndpoint(mock:results, mockEndPoint);

RouteBuilder myRoute = new RouteBuilder(camelCtxt) {


 @Override
 public void configure() throws Exception {



 ProducerTemplate producerTemplate =
 camelCtxt.createProducerTemplate();


 Endpoint jdbcEndpoint = camelCtxt.getEndpoint(direct:start);

 MyProcessor routeProcessor = new MyProcessor
 (producerTemplate,jdbcEndpoint ,camelCtxt);

 from(direct:start).process(routeProcessor).to(jdbc:intuira);


 }
 };
 camelCtxt.addRoutes(myRoute);
  camelCtxt.addRoutes(new RouteBuilder() {

 @Override
 public void configure() throws Exception {
  QuartzComponent quartz = 

Re: dynamic properties

2013-03-20 Thread Christian Müller
I think you are looking for a template engine like [1], [2] or [3].

[1] http://camel.apache.org/freemarker.html
[2] http://camel.apache.org/velocity.html
[3] http://camel.apache.org/stringtemplate.html

Best,
Christian

On Tue, Mar 19, 2013 at 7:29 AM, jinaLu jina...@yahoo.com wrote:

 I use camel 2.8 according my serviceMix server.
 In cfg I have:
 message=My message ${property.type} is for user ${property.user}
 messageSubject.invoice=Invoice message

 I use Java DSL to define route and osgi blueprint for other purposes. My
 route looks like:
 from(direct:start)
 .to(bean:FindXML)
 .setProperty(type, xpath(/message/@Type))
 .setProperty(user, xpath(/message/@To))
 .to(bean:SomeActions)
  .setHeader(messageText, simple({{message}}))
  .setHeader(messageSubject,
 simple({{messageSubject.${property.type}}}))

 None of this header setters work.



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




--


Re: Unexpected behavior of LoggingErrorHandler in Camel

2013-03-20 Thread Christian Müller
Use the defaultErrorHandler if you want handle the exception (not
rethrowing the exception).

Using the following test, the exception is logged at level WARN (using
Camel 2.11-SNAPSHOT):

package org.apache.camel.builder;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.LoggingLevel;

public class LoggingErrorHandlerTest extends ContextTestSupport {

public void testLoggingErrorHandler() throws Exception {
getMockEndpoint(mock:end).expectedMessageCount(1);

template.sendBody(direct:start, foo);

assertMockEndpointsSatisfied();
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from(direct:start)

.errorHandler(loggingErrorHandler(com.mycompany.foo).level(LoggingLevel.WARN))
.to(mock:end)
.throwException(new Exception(forced exception for
test));
}
};
}
}

Log:
2013-03-20 23:48:21,404 [main   ] WARN
foo- Failed delivery for (MessageId:
ID-Christians-MacBook-Pro-local-53438-1363819701117-0-1 on ExchangeId:
ID-Christians-MacBook-Pro-local-53438-1363819701117-0-2). Exhausted after
delivery attempt: 1 caught: java.lang.Exception: forced exception for test
java.lang.Exception: forced exception for test
at
org.apache.camel.builder.LoggingErrorHandlerTest$1.configure(LoggingErrorHandlerTest.java:39)[file:/Users/cmueller/workspaceCamel/camel/camel-core/target/test-classes/:]
at
org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:322)[file:/Users/cmueller/workspaceCamel/camel/camel-core/target/classes/:]
at
org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:276)[file:/Users/cmueller/workspaceCamel/camel/camel-core/target/classes/:]
at
org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:262)[file:/Users/cmueller/workspaceCamel/camel/camel-core/target/classes/:]
at
org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:648)[file:/Users/cmueller/workspaceCamel/camel/camel-core/target/classes/:]
at
org.apache.camel.ContextTestSupport.setUp(ContextTestSupport.java:115)[file:/Users/cmueller/workspaceCamel/camel/camel-core/target/test-classes/:]
at junit.framework.TestCase.runBare(TestCase.java:139)[junit-4.11.jar:]
at
org.apache.camel.TestSupport.runBare(TestSupport.java:58)[file:/Users/cmueller/workspaceCamel/camel/camel-core/target/test-classes/:]
at
junit.framework.TestResult$1.protect(TestResult.java:122)[junit-4.11.jar:]
at
junit.framework.TestResult.runProtected(TestResult.java:142)[junit-4.11.jar:]
at junit.framework.TestResult.run(TestResult.java:125)[junit-4.11.jar:]
at junit.framework.TestCase.run(TestCase.java:129)[junit-4.11.jar:]
at
junit.framework.TestSuite.runTest(TestSuite.java:255)[junit-4.11.jar:]
at junit.framework.TestSuite.run(TestSuite.java:250)[junit-4.11.jar:]
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)[junit-4.11.jar:]
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)[file:/Applications/eclipse-4.2.2/configuration/org.eclipse.osgi/bundles/350/1/.cp/:]
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)[file:/Applications/eclipse-4.2.2/configuration/org.eclipse.osgi/bundles/349/1/.cp/:]
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)[file:/Applications/eclipse-4.2.2/configuration/org.eclipse.osgi/bundles/349/1/.cp/:]
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)[file:/Applications/eclipse-4.2.2/configuration/org.eclipse.osgi/bundles/349/1/.cp/:]
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)[file:/Applications/eclipse-4.2.2/configuration/org.eclipse.osgi/bundles/349/1/.cp/:]
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)[file:/Applications/eclipse-4.2.2/configuration/org.eclipse.osgi/bundles/349/1/.cp/:]

Best,
Christian

On Thu, Mar 14, 2013 at 12:54 PM, dancerjohn winddancerj...@gmail.comwrote:

 So, I have a camel context that has a DeadLetterChannel with no
 redeliveries
 at the context level. Within the context I have a route:

 from(direct:input)
  .routeId(enrichHeader)
  .setHeader(myHeader).constant(someValue)
  .to(direct:output);

 I have a unit test in which I interceptSendToEndpoint(direct:output) and
 cause an exception to be thrown.

 Then in the unit test I do producerTemplate.sendBody(theBody).

 Now, as configured above on exception the message gets sent to the dead
 letter channel. All's well. However, if I configure a loggingErrorHandler I
 get odd behavior. So if I update the above route as follows:

 from(direct:input)
  

Re: Enable wire logs on Camel HTTP Proxy

2013-03-20 Thread santhosh
try cxf intercptors -input and output interceptors if its cxf service.It
gives wire incoming msg and wire outgoing msg



--
View this message in context: 
http://camel.465427.n5.nabble.com/Enable-wire-logs-on-Camel-HTTP-Proxy-tp5723675p5729577.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Enable wire logs on Camel HTTP Proxy

2013-03-20 Thread Raul Kripalani
Can you show us exactly where you are inserting your log statements?

A log statement between the servlet endpoint and the http4 one should
display what you're after.

Sent while on the move
On 7 Mar 2013 18:36, rouble r.ou...@gmail.com wrote:

 Willem, Scott, Claus et al,

 Appreciate all your input. So, is there no camel way to get the logs
 from the client to the camel proxy? Or do I have to look at the web
 container (tomcat or Jetty) logs?

 Here is my topology:
 ClientCamel ProxyRemote Endpoint

 And my simple route:
 from(servlet:///proxyWebService/api/?matchOnUriPrefix=true)

 .to(https4://realWebService:8443/api/?bridgeEndpoint=truethrowExceptionOnFailure=false);

 Adding .log() statements will get me the logs from camel proxy to the
 remote endpoint. But not from the Client to the Camel Proxy.

 I would really like to generate all the wire HTTP logs within the
 camel proxy itself. On the topic of stream caching, I want to be able
 to turn on these wire HTTP logs at DEBUG level. Is it possibly to
 programmatically enable stream caching and logging?

 Cheers
 Rouble

 On Mon, Mar 4, 2013 at 8:47 PM, Willem jiang willem.ji...@gmail.com
 wrote:
  If you are using Jetty, I think you can find out the HTTP log somewhere.
  And Scott just show you how to log the request and response message in
 the camel route.
 
 
  --
  Willem Jiang
 
  Red Hat, Inc.
  FuseSource is now part of Red Hat
  Web: http://www.fusesource.com | http://www.redhat.com
  Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
 (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
  Twitter: willemjiang
  Weibo: 姜宁willem
 
 
 
 
  On Tuesday, March 5, 2013 at 4:49 AM, rouble wrote:
 
  [Re-viving old thread]
 
  So this shows the communication between the camel proxy box and the
  remote endpoint.
 
  How do I see the HTTP logs between the client and the camel proxy box?
 
  Basically, the network topology is Client=Camel
  Proxy===Remote Endpoint
 
  tia,
  rouble
 
   The following should allow you to see both:
  
  
   from(servlet:///proxyWebService/api/?matchOnUriPrefix=true)
   .log(Request message: ${body})
  
  
 .to(https4://realWebService:8443/api/?bridgeEndpoint=truethrowExceptionOnFailure=false)
   .log(Response message: ${body});
  
   Hope this helps.
  
   Best Regards,
   Scott ES
  
   On Wed, Dec 5, 2012 at 4:38 PM, rouble r.ou...@gmail.com (mailto:
 r.ou...@gmail.com) wrote:
  
I have a camel route setup to proxy a web service as follows:
   
from(servlet:///proxyWebService/api/?matchOnUriPrefix=true)
   
   
 .to(https4://realWebService:8443/api/?bridgeEndpoint=truethrowExceptionOnFailure=false);
   
How can I see the inbound and outbound HTTP Requests and Responses?
 I
don't need any other camel logs for my purpose just the wire logs.
   
tia,
rouble
  
  
  
  
  
   --
   --
   Scott England-Sullivan
   Apache Camel Committer
   Principal Consultant / Sr. Architect | Red Hat, Inc.
   FuseSource is now part of Red Hat
   Web: fusesource.com http://www.fusesource.com |
   redhat.comhttp://www.redhat.com
   Blog: sully6768.blogspot.com (http://sully6768.blogspot.com)
   Twitter: sully6768
 
 
 
 



Camel velocity template internationalization

2013-03-20 Thread paramjyotsingh
I have a scenario where I need to pick velocity based on locale. I have two
problems for this.

Do we any option in velocity endpoint to provide locale information? if not,
do we have option in camel to set some header property in Exchange message
so that velocity template gets picked up automatically for that locale.

For example, suppose we have following velocity template files:
 - email.vm
 - en_email.vm
 - cn_email.vm
 - fr_email.vm

if locale/language code is set to 'fr' then velocity should pick fr_email.vm
and another question how to set this locale/language code in Camel
springDSL.

Please help, i am stuck on this issue, i was not able to find anything in
camel user guide about this.
There is something about IRI, but not sure how that works.

Thanks and Regards.
Paramjyot



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


Re: Camel Aggregator Strategy Question

2013-03-20 Thread Jothi
Claus,

Thanks for pointing to the Javadoc. In fact, I started out blind with a very
little idea on how an aggregation would work. But after working my way
through the above exercise, I got a good hold of it. In fact, I made the
mistake of having my aggregation logic in a processor. I moved them to my
aggregator and bang it worked the way I wanted.



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


Processing Simple expressions in a Component Endpoint URL

2013-03-20 Thread Bazzer
Hi,

I'm writing my own component and I wondered if it was possible for the
Endpoint URL to be able to contain a Simple expression.

For example:

to uri=mycomp://start-server?name=${body[svr]} /

or

to uri=mycomp://start-server/${body[svr]} /

I thought that perhaps Camel would process the URL before it was passed to
the Component object, but I'm happy to invoke Simple myself if necessary.

Any assistance would be appreciated! Thanks!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Processing-Simple-expressions-in-a-Component-Endpoint-URL-tp5729580.html
Sent from the Camel - Users mailing list archive at Nabble.com.