Re: Forcefully shutting down routes...

2013-05-07 Thread lleclerc
I just got this problem and found the solution with this line : Camelcontext.stopRoute(routeId, 1, TimeUnit.SECONDS, false); You want false to force the shutdown and you need 1 to prevent the following problem : [org.apache.camel.impl.DefaultShutdownStrategy] : Waiting as there are still 3 inf

Re: Ambiguity in DefaultCamelContext with TypeConverter

2013-04-26 Thread lleclerc
JIRA : https://issues.apache.org/jira/browse/CAMEL-6321 -- View this message in context: http://camel.465427.n5.nabble.com/Ambiguity-in-DefaultCamelContext-with-TypeConverter-tp5731480p5731634.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Ambiguity in DefaultCamelContext with TypeConverter

2013-04-25 Thread lleclerc
I have picked the code from OsgiCamelContextHelper to set the osgi parts, but this helper do not apply for TypeConverter. Here is the code for OsgiDefaultCamelContext : It override the createTypeConverter() and addService is done while using a getter from DefaultCamelContext (see my first post).

Re: Bug in DefaultCamelContext with TypeConverter

2013-04-24 Thread lleclerc
I was wondering why OsgiDefaultCamelContext wasn't setting directly the TypeConverter and went for overwritting the createTypeConverter method. I think it's a work around because it was never added as a service. Here is my GuiceOsgiTypeConverter : -- View this message in context: http://came

Bug in DefaultCamelContext with TypeConverter

2013-04-24 Thread lleclerc
Hi, I am fusing OsgiDefaultCamelContext with GuiceCamelContext by doing the "Guicyfication" of all osgi resolvers to be injected of BundleContext, which is injected in GuiceCamelContext. The only problem is TypeConverter, because if it is set manually this method : It will never be added with

Testing camel component resolving in OSGI with Pax Exam

2013-04-23 Thread lleclerc
Here is my complete test class : http://pastie.org/private/19vmbn8hb3sdwxawy5qxg My test consist of creating a quartz endpoint. All my bundle are state 32 (Started) Bundle 0 org.eclipse.osgi State is 32 Bundle 1 org.ops4j.pax.exam State is 32 Bundle 2 org.ops4j.pax.exam.inject State is 32 Bundl

Re: camel headers issue

2013-04-23 Thread lleclerc
You can add a processor .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { exchange.getOut().setHeaders(exchange.getIn().getHeaders()); } }) -- View thi

Camel using Guice and OSGI together and test with Pax Exam

2013-04-22 Thread lleclerc
Hi, Am I using the right strategy ? So far I have created wrap for all osgi resolvers, like this (note: default resolver can be bind() directly) : TypeConverter is a little bit more complex : I have then 2 modules, one which bind all interface to OSGI impl : and one for the default : In a

Re: Insane logs about RouteContextProcessor

2013-04-17 Thread lleclerc
Thank you! Adding the link to JIRA : https://issues.apache.org/jira/browse/CAMEL-6220 -- View this message in context: http://camel.465427.n5.nabble.com/Insane-logs-about-RouteContextProcessor-tp5731023p5731041.html Sent from the Camel - Users mailing list archive at Nabble.com.

Insane logs about RouteContextProcessor

2013-04-17 Thread lleclerc
Hello, I am using camel 2.10.3 and I try to send files at a scheduled time or by call. Everything works, but after a day, I get this INSANE log : http://pastie.org/7630667 Here is my routes : The exceptionHandlingProcessor only do logging, and uploadProcessor save files on hard drive and star

Re: How to use quartz to schedule a file transfer ?

2013-04-11 Thread lleclerc
Thanks ! Exactly what I was searching for ! What is different between the previous route I wrote and this : from(timerUri).to(http4Uri).process(...) <-- This one does the job -- View this message in context: http://camel.465427.n5.nabble.com/How-to-use-quartz-to-schedule-a-file-transfer-tp5

How to use quartz to schedule a file transfer ?

2013-04-10 Thread lleclerc
Hi, How to use quartz to schedule a file transfer ? from(quartzUri).to(fileUri1).to(fileUri2); doesn't seems to work. Thanks, -- View this message in context: http://camel.465427.n5.nabble.com/How-to-use-quartz-to-schedule-a-file-transfer-tp5730696.html Sent from the Camel - Users mailing lis

Re: Simple case of multithreading with camel and wildcard.

2013-04-10 Thread lleclerc
Here is more details of what I am trying to do. In an osgi framework, I resolve everything that implements IMyService. Which have the method putDocuments(String path) I want to call this method for those X services and then transfer the files from hard drive. context.addRoutes(new RouteBu

Re: Simple case of multithreading with camel and wildcard.

2013-04-09 Thread lleclerc
Do this X times : Thread t = new MyThread() t.start(); list.add(t); Then : for(Thread t2 : list) { t2.join(); } Continue process. As you can see, this can lock and there is no error handling, I want to do that using camel. -- View this message in context: http://camel.465427.n5.nabble.co

Simple case of multithreading with camel and wildcard.

2013-04-08 Thread lleclerc
Hi, I have a dynamic list of process to do and want to end it with an aggregation strategy. What is the approach I should be taking ? I tried to use direct and the wildcard endpoint, but I am getting this exception : Caused by: org.apache.camel.CamelExchangeException: No consumers available on

Permission denied with Camel-FTP when configuring jail+chroot+sftp only with openssh

2013-04-02 Thread lleclerc
Hi, I am using camel 2.10.3, I can get this route from(direct).to(sftp) to work using openssh as server. There is no problem. I am now adding this to my server config (sshd_config) : Match User myuser ChrootDirectory /home AllowTCPForwarding no X11Forwarding no ForceCommand intern

Re: Ciphers with camel-sftp

2013-04-01 Thread lleclerc
Is my question too vague ? Not related to camel ? -- View this message in context: http://camel.465427.n5.nabble.com/Ciphers-with-camel-sftp-tp5730052p5730171.html Sent from the Camel - Users mailing list archive at Nabble.com.

Ciphers with camel-sftp

2013-03-28 Thread lleclerc
Hi, How can I have access to more ciphers with camel-sftp ? Here is some log of it working displaying the available ciphers : 2013-03-28 14:49:04,619 INFO [SftpOperations] JSCH -> kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1 2013-03-28 14:49:04,619 INFO [SftpOper

How to drop messages using throttle ?

2013-02-21 Thread lleclerc
Hi, I am trying to limit the amount of message to 2 per second and drop all others. (I don't want to delay, only dropping them, the most recent is the needed one, but not too many) from("seda:a").throttle(2).timePeriodMillis(1000).to("seda:b") .process(new Processor() {...System.out.println("OUT

Re: Can't do redelivery past 10 seconds

2013-01-29 Thread lleclerc
Thanks for quick response. I updated the code in my first post, the tests are still failing :( -- View this message in context: http://camel.465427.n5.nabble.com/Can-t-do-redelivery-past-10-seconds-tp5726491p5726495.html Sent from the Camel - Users mailing list archive at Nabble.com.

Can't do redelivery past 10 seconds

2013-01-29 Thread lleclerc
Hi, Using camel 2.11-SNAPSHOT. I don't what wrong I am doing in this test, but it won't allow me to last more than 12 sec. I want to use allowRedeliveryWhileStopping(false), it is not used right now, but it might be the source of my problem. Is this a a bug, or I am doing something wrong ? Tha

Re: Custom interceptors and finding the first and last camel route

2013-01-25 Thread lleclerc
I don`t understand what you are asking. Usually you can just add a ".to(somethingElse)" at the end of your route. Or you can add some http://camel.apache.org/predicate.html to check if your request was succesful first. If your 2 routes should be in sync, why aren`t they on the same route ? Else y

Endpoint Uri not recognized but functional, possible bug.

2013-01-25 Thread lleclerc
Hello, Using camel 2.10.3 Here is the test case : http://pastie.org/5865294 Both test are success, but it doesn`t seem right. Both Endpoint are used and working but I can`t get it back from the CamelContext if I don`t add it directly to the CamelContext. Thanks for your time. -- View this me

Wrong test for allowRedeliveryWhileStopping, possible bug.

2013-01-24 Thread lleclerc
Hi, There is a problem that invalidate the test for allowRedeliveryWhileStopping. I am using 2.11-SNAPSHOT and have been looking at the test located in : org.apache.camel.processor.RedeliveryErrorHandlerNoRedeliveryOnShutdownTest I think that right from the start, the test can't last for 20 seco

Re: Found a bug in overriding URI using camel-http4 + documentation problem

2013-01-23 Thread lleclerc
Thanks for the quick responses, the modified unit test and the update in the doc ! I would add a sentence in the wiki to say the Exchange.HTTP_URI exclude any CAMEL_URI. Because the current example can be counter intuitive since there is a camel component called "http" too. Thanks again ! -- V

Found a bug in overriding URI using camel-http4 + documentation problem

2013-01-22 Thread lleclerc
Hi, >From the documentation : http://camel.apache.org/http4.html *** You can override the HTTP endpoint URI by adding a header with the key, HttpConstants.HTTP_URI, on the message. from("direct:start") .setHeader(HttpConstants.HTTP_URI, constant("http:

Re: camel-guice

2012-12-21 Thread lleclerc
I removed reference to com.google.inject.internal here : http://speedy.sh/NqCJ3/Removed-reference-to-com-google-inject-internal.patch , this patch include Josep code. I removed some functionality while doing so, that might lead to strange behavior. But the current tests in camel-guice are running w

Re: camel-guice

2012-12-20 Thread lleclerc
I tried the patch https://issues.apache.org/jira/secure/attachment/12561884/camel_guice_3.0.diff A pom.xml had problems, I simply removed the lines and build it and tried the camel-guice in an OSGI container. I could not get it to be active, needing com.google.common.collect and com.google.inject.

Bug : AdviceWith not working with weaveAddFirst() weaveAddLast().

2012-12-13 Thread lleclerc
Here is the source code that test the 2 functions (org.apache.camel.processor.interceptor.AdviceWithWeaveFirstLastTest.java) The modified version : http://pastebin.com/RiKfzTfs The only change been that I used the function @Override public boolean isUseAdviceWith() { return tru

Re: Test Intercept with adviceWith and http

2012-12-13 Thread lleclerc
Thanks! Updated my pom file with org.apache.camel camel-core 2.10.4-SNAPSHOT apache.snapshots Apache Development Snapshot Repository https://repository.apache.org/content/repositories/snapshots

Re: Removing invalid endpoints from recipientList

2012-12-11 Thread lleclerc
How can aggregationStrategy help me if the fake endpoint never get to create an Exchange ? Here is the test I did : http://pastebin.com/ZTJzxS64 My fake endpoint will fail because it will return null as a producer (FailedToCreateProducerException). That is probably too heavy of an error. What I w

Removing invalid endpoints from recipientList

2012-12-10 Thread lleclerc
Hi, How can I remove invalid endpoints from a recipientList ? If I use the route from(direct).doTry().recipientList(..).doCatch(). Using the line exchange.getProperty(Exchange.FAILURE_ENDPOINT, String.class); will return me the 'direct' uri and not the failure recipient. Like shown in this sc

Found a bug with camel-http4 !

2012-12-06 Thread lleclerc
Hi, Here is the TestClass exposing the working and the problematic test : http://pastebin.com/8VunWZgt Some optional parameters from camel-http4 will prevent the intercept from working correctly. Or is it just me not using the right tools to test my production route offline. Thanks, -- View

Re: Multicast or pipeline? Newbie question

2012-12-06 Thread lleclerc
A multicast would send the same Exchange to both. My guess is pipeline. -- View this message in context: http://camel.465427.n5.nabble.com/Multicast-or-pipeline-Newbie-question-tp5723711p5723712.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process message on Endpoint using recipientList.

2012-12-06 Thread lleclerc
Thanks! What is the nabble link ? I was missing the start(). I got another problem but I could fix it. It was a NullPointerException, caused by not setting the CamelContext of my Endpoint. I used the debugger and found it in SedaConsumer.setupTasks() on getCamelContext(). Thanks again ! --

ContextTestSupport vs CamelTestSupport

2012-12-05 Thread lleclerc
Hi, Can someone give an answer about the difference between the 2 ? Or a link to the documented page. I have been having problems with my testing and I started looking into camel-core source code to learn with the tests done there, and all I see is ContextTestSupport. Why should I be using Camel

Dynamic endpoint using Recipient, ExchangeTimedOutException

2012-12-04 Thread lleclerc
Hi, I got 2 separate projects, the project1 is an osgi component that start a CamelContext with routes and use a dynamic recipientList(). On project2, I call addRecipient(Endpoint endpoint) from project1's exported service. In project1, my route is like this : from(sedaEndPointURI

Re: Test Intercept with adviceWith and http

2012-12-03 Thread lleclerc
The message "INTERCEPTED" is never printed and the request is not intercepted, nor skipped, it is still sent over internet and we see the content of "http://stackoverflow.com"; through [httpclient.wire.content] messages. -- View this message in context: http://camel.465427.n5.nabble.com/Test-In

Test Intercept with adviceWith and http

2012-11-30 Thread lleclerc
; import org.apache.camel.builder.AdviceWithRouteBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; /** * Created with IntelliJ IDEA. * User: lleclerc * Date: 12-11-28 * Time: 16:34 * To change this template use File

Problem with isUseAdviceWith() and Intercept.

2012-11-29 Thread lleclerc
Hi, I am trying to intercept a message to skip the Http request and proceed with my route. Here is the class you can copy/paste to try it out. Return false in isUseAdviceWith() : The test is success but the message is never intercepted. Return true in isUseAdviceWith() : I get this exception : o

Re: Intercepting message for testing not working

2012-11-29 Thread lleclerc
Using 2.10.2 -- View this message in context: http://camel.465427.n5.nabble.com/Intercepting-message-for-testing-not-working-tp5723257p5723400.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: OSGI dependencies with camel

2012-11-28 Thread lleclerc
In the end, we use @Inject to be able to access the ComponentResolver available from the dependency and then resolve the component and add it to the camelContext. @Inject .multiple() Iterable resolvers; Component comp = resolver.resolveComponent(CAMEL_HTTP4, camelContext); camelContext.addCompone

Re: Intercepting message for testing not working

2012-11-28 Thread lleclerc
Here is the code http://pastebin.com/kkVVb22x Here is the logs http://pastebin.com/CYPzBB8Q I see the EndPoint is null, but it is on the camel side. Seems that setting isUseAdviceWith to return true, prevent the creation of the endPoint, and then I can't use advice on them, even though the rout

Re: Simple HTTP proxy

2012-11-27 Thread lleclerc
I am new to camel too, but maybe this can give you ideas. public class RequestHandler extends RouteBuilder { @Override public void configure() throws Exception { from("timer:myTimer?delay=1000&period=5000) .setHeader(Exchange.HTTP_BASE_URI, "something") .to(

Re: OSGI dependencies with camel

2012-11-27 Thread lleclerc
The error is "No component found with scheme http4". I think I could fix it. What I think is like this : > What happens in IDE : > MyProject depends {camel-core, camel-http4} > > What happens using OSGI : > MyProject depends {camel-core}, {camel-http4} and camel-core can't find > camel-http4 eve

OSGI dependencies with camel

2012-11-27 Thread lleclerc
Hi, I got a maven project that use camel-core and camel-http4. The project works having both dependency. Now I want to load this project into my OSGI container (I use Apache Geronimo 3.0). While running on the IDE, all the classes are loaded in the same classLoader, so camel-core is able to find

Re: Camel for Rest Service

2012-11-27 Thread lleclerc
Not sure, but I think you should try something like this : (InputStream) is = exchange.getIn().getBody(); Read the byte array into a string and then convert jsonstring to your object. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-for-Rest-Service-tp5723267p5723311.h

Re: Intercepting message for testing not working

2012-11-27 Thread lleclerc
I do have it. Removing http4 from classhpath give me this error instead : org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[http4:google.com] <<< in route: Route[[From[direct:test]] -> [SetHeader[CamelHttpQuery, {usr... because of Failed to resolve endpoint:

Re: Intercepting message for testing not working

2012-11-27 Thread lleclerc
Thanks for the answer ! I missed that box ! I got a second problem now.. My application fail in the testMethod() onthis line : context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() { I get this error : org.apache.camel.FailedToCreateRouteException: Failed to create

Intercepting message for testing not working

2012-11-26 Thread lleclerc
Hi, I am trying to do testing on a route, but I can't see what I am doing wrong. I have this method from MyClass : public RouteBuilder createRoute(...) { ... from(timer).setHeader(Exchange.HTTP_QUERY, ...) .to(http4) .to(seda); from(seda).unmarshal(..).process(); ... } Now I want to test the ro

Basic question about synchronous queues and pipes..

2012-11-19 Thread lleclerc
Hi, I looked into documentations/questions and I am not sure about the responses I seen. I want to send an http request at each 5 seconds and delay the response by 3 minutes before processing it. The http request time can vary a lot before getting a response, but I want to keep the order intact,