Re: Set body to length of header string in Spring DSL?

2012-11-27 Thread Claus Ibsen
Hi Your header is some sort of hbase type. So you need to check its API how to convert that type to a String, or some other way of getting the length of it. As every Object in Java, has a .toString() method due its on java.lang.Object, then invoking .toString() may not in this case return the con

Re: Intercepting message for testing not working

2012-11-27 Thread Claus Ibsen
On Wed, Nov 28, 2012 at 2:29 AM, lleclerc wrote: > Any idea ? > As said I suspect a NPE is thrown somewhere. Don't you see more in the logs? What version of Camel do you use? > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Intercepting-message-for-testing-not-worki

Releasing CXF-endpoint port on context shutdown

2012-11-27 Thread Urppa
I have a programmatic CamelContext and route configuration inside an OSGi-bundle that I deploy on Karaf 2.3.0. There are no Blueprint/Spring XML-files, this is all done programmatically because I need some programmatic stuff before the route setup. The route has a CXF-endpoint offering a SOAP-webs

Re: Simple HTTP proxy

2012-11-27 Thread Matt Cheers
i tried https in the 'to' address and also 2.9.3 and 2.10.1 versions of camel and same malformed url was produced. On 28/11/2012, at 3:42 PM, Matt Cheers wrote: > Thanks again. > > No success yet. I tried that route with my spring app and got > org.apache.camel.component.http.HttpOperation

Re: Simple HTTP proxy

2012-11-27 Thread Matt Cheers
Thanks again. No success yet. I tried that route with my spring app and got org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http//www.facebook.com:80/?amp%3BthrowExceptionOnFailure=false with statusCode: 500 very odd the url isn't correctly formed

Re: Simple HTTP proxy

2012-11-27 Thread Matt Cheers
Thanks. I also tried something similar setting the HTTP_URL and HTTP_URI. I can't reference details of full urls in my proxy since it is quite large and not constant.

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(

Simple HTTP proxy

2012-11-27 Thread Matt Cheers
Camel: 2.10.2 Tomcat: 7.0.32 JVM 1.7 I am a new Camel user wanting to initially create a simple server that acts as a front-end to an existing service. So: http://newserver/proxy goes to http://oldserver http://newserver/proxy/x/y/z goes to http://oldserver/x/y/z The "from" prefix matching work

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

Re: OSGI dependencies with camel

2012-11-27 Thread Christian Müller
What's your issue? Can you share your stack trace? Which version of Geronimo/Camel do you use? As far as I know, Geronimo is based on Karaf. An Camel is shiped with a feature file for Karaf to install all the dependencies - and it works. Best, Christian Sent from a mobile device Am 27.11.2012 22:

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: Set body to length of header string in Spring DSL?

2012-11-27 Thread dunnlow
Thanks, I have some reading up to do on OGNL (and file language). To my initial question, sorry, I'm still not able to get my test working. Basically, nothing is output if I put a value in the name with the expression you provided. When I put a value in the name, I get the following output depen

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: LDAP connection via SSL

2012-11-27 Thread martin11
If you don't want to explicitly set javax.net.ssl in Java command line, you can set it in applicationContext file in the fashion of Spring. /path/trusted.jks @see spring forum

Re: Set body to length of header string in Spring DSL?

2012-11-27 Thread Claus Ibsen
On Tue, Nov 27, 2012 at 4:22 PM, dunnlow wrote: > Thank you both, huge help. > > Claus, question for you in the, "teach a man to fish.." category. What is > the best way to see all of the methods that simple provides? For example, I > had no idea about the Length() method - is that method inheri

Re: Set body to length of header string in Spring DSL?

2012-11-27 Thread dunnlow
Thank you both, huge help. Claus, question for you in the, "teach a man to fish.." category. What is the best way to see all of the methods that simple provides? For example, I had no idea about the Length() method - is that method inherited? Thank you again, -J -- View this message in co

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 Claus Ibsen
On Tue, Nov 27, 2012 at 3:44 PM, lleclerc wrote: > 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 :

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

Re: How to avoid starting a route multiple times?

2012-11-27 Thread klauss42
Hi again I just tried "stateful" in my quartz component and it looks fine so far. For the test I made my route running longer than the schedule interval (using Thread.sleep()) and the next execution of the route is then delayed, as described in the quartz docs: /... The other difference is that st

Re: How to avoid starting a route multiple times?

2012-11-27 Thread klauss42
Claus Ibsen-2 wrote > On Tue, Nov 27, 2012 at 11:15 AM, Babak Vahdat > < > babak.vahdat@ > > wrote: >> Hi >> >> I'm not a Quartz expert but think (if I understand your question >> correctly) >> you could make use of the "stateful" option in your URI: >> >> http://camel.apache.org/quartz >> >> And

Re: Camel for Rest Service

2012-11-27 Thread Bala
Sorry,  I Can't understand your reply. Can you please be more specific.  If you look at what am trying, I try to use the Configuration file for invoking a uri and from the configuration file, am trying to call a rest service, from which am getting the response in JSON which am trying to read. Pl

Speed up marshalling objects to XML by explicitly loading classes

2012-11-27 Thread Ben V
I have lots of xsd and create java classes from them (~1000 classes) using xjc and deployed them to Servicemix4 as an OSGI bundle. Then I have application where I process the request and set exchange body to some object from generated classes. The problem is when it processes the first request - it

Re: Camel for Rest Service

2012-11-27 Thread Bala
Sorry, I Can't understand your reply. Can you please be more specific. If you look at what am trying, I try to use the Configuration file for invoking a uri and from the configuration file, am trying to call a rest service, from which am getting the response in JSON which am trying to read. Plea

Re: How to avoid starting a route multiple times?

2012-11-27 Thread Claus Ibsen
On Tue, Nov 27, 2012 at 11:15 AM, Babak Vahdat wrote: > Hi > > I'm not a Quartz expert but think (if I understand your question correctly) > you could make use of the "stateful" option in your URI: > > http://camel.apache.org/quartz > > And then according what the Javadoc says, the required behavi

Re: Camel for Rest Service

2012-11-27 Thread Sergey Beryozkin
On 27/11/12 07:56, Willem jiang wrote: What's invocation looks like, you should get a Response object from the message body. If you are using camel-cxfrs you will not see the under layer response (XML or JSON). After upgrade to CXF 2.7.1 it will be possible to do Response response = ... MyT

Re: How to avoid starting a route multiple times?

2012-11-27 Thread Claus Ibsen
On Mon, Nov 26, 2012 at 5:26 PM, klauss42 wrote: > I use the Quartz component: > > > > > > > This route runs every 30 seconds which is the desired behavior. > Ah yeah I guess thats the current correct behavior. I think what would be needed is to add new functionality to ca

Re: Websphere JMS Queue Message Consumer

2012-11-27 Thread Claus Ibsen
Hi You have many ClassNotFoundExceptions from the log java.lang.NoClassDefFoundError: org.springframework.xml.transform.StringSource It seems that you do not have all the needed JARs in your application that you deploy in WAS. Make sure to include the needed JARs. On Tue, Nov 27, 2012 at 8:29 A

Re: File generation and FTP

2012-11-27 Thread Claus Ibsen
On Mon, Nov 26, 2012 at 4:25 PM, anu_cameluser wrote: > Claus, > > Thanks for your suggestion - adding noop=true to the file endoint URI > resolved the issue with original file being deleted. > > The first issue with the file received at ftp destination being empty turned > out to be more interest

Re: [camel-bindy] Handle implied decimal field

2012-11-27 Thread Claus Ibsen
On Tue, Nov 27, 2012 at 9:00 AM, lb wrote: > > In org.apache.camel.dataformat.bindy.FormatFactory for non "BigNumbers" the > Format object is chosen as follow: > > if (clazz == float.class || clazz == Float.class) { > return pattern != null ? new FloatPatternFormat(pattern, > getLocale(locale)

Jackson custom configuration

2012-11-27 Thread Martin Stiborský
Hello guys, how it's possible configure in general Jackson in Camel? For example, I need to use indentation/DefaultPrettyPrinter for all marshalled POJO classes by default. I found this thread: http://mail-archives.apache.org/mod_mbox/camel-users/201112.mbox/%3ccapipqn6+vdftwavka7odowxb_nnheutreys

Re: Camel for Rest Service

2012-11-27 Thread Bala
I am getting the InOut in the response. If you look at my example closely, I am sending InOut using the below line template.sendBody("direct:cafe", ExchangePattern.InOut); And, this is wat am getting in the response and not the actual JSON Object. My Response handler code is as below.  Syste

Re: [camel-bindy] Handle implied decimal field

2012-11-27 Thread lb
In org.apache.camel.dataformat.bindy.FormatFactory for non "BigNumbers" the Format object is chosen as follow: if (clazz == float.class || clazz == Float.class) { return pattern != null ? new FloatPatternFormat(pattern, getLocale(locale)) : new FloatFormat(); } I've noticed that the DataFi