Re: Unicode characters not recognizing when reading file

2016-04-13 Thread Ioannis Mavroukakis
Try, file(from).split(body(String.class).tokenize("\r\n")).streaming().to(file) I'm not sure why it doesn't work for you, not having a relevant input file to test makes it a little bit of guesswork..alternatively you could scrub all \r\n to become \n before processing? patelp7 wrote: Not t

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread patelp7
Not true exactly. It has to do with some camel component. I tried few things. 1) Route: file(from).split(body()).streaming().to(file) /This scenario preserves the character./ 2) Route: file(from).convertBodyTo(String.class,"UTF-8").split(body()).streaming().to(file) /This scenario converts the cha

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread Ioannis Mavroukakis
So whatever it is you're streaming to, doesn't handle UTF8 then? patelp7 13 April 2016 at 20:26 I changed my route to from(file).to("file:/?fileName=out.csv&fileExist=Append") It preserved the character. -- View this message in context: http://ca

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread patelp7
I changed my route to from(file).to("file:/?fileName=out.csv&fileExist=Append") It preserved the character. -- View this message in context: http://camel.465427.n5.nabble.com/Unicode-characters-not-recognizing-when-reading-file-tp5781028p5781036.html Sent from the Camel - Users mailing list ar

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread Ioannis Mavroukakis
Are you sure your terminal encoding is UTF-8 capable? How about if you tried to simply redirect the contents to another file and opened that afterwards to verify? patelp7 wrote: I guess my assumption was wrong. I removed tokenizing and its still not working :( -- View this message in conte

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread patelp7
I guess my assumption was wrong. I removed tokenizing and its still not working :( -- View this message in context: http://camel.465427.n5.nabble.com/Unicode-characters-not-recognizing-when-reading-file-tp5781028p5781032.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread Ioannis Mavroukakis
If you remove tokenizing does it print it out the character correctly? patelp7 wrote: Hi, I tried both solutions. My JVM default encoding is already set to UTF-8. I confirmed by printing System.getProperty("file.encoding"). I also changed my route to: from(file).marshal().string("UTF-8").split(

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread patelp7
Hi, I tried both solutions. My JVM default encoding is already set to UTF-8. I confirmed by printing System.getProperty("file.encoding"). I also changed my route to: from(file).marshal().string("UTF-8").split(body().tokenize("\r\n|\n|\r")).streaming() It's still converting the character to "?".

Re: Unicode characters not recognizing when reading file

2016-04-13 Thread Ioannis Mavroukakis
Try from(file).marshal().string("UTF-8") etc. or force your JVM to use UTF-8 as the default charset with -Dfile.encoding=UTF-8 patelp7 wrote: Hi, I have defined my file URI as file:///?charset=UTF-8 and my route looks like below: from(file) .convertBodyTo(String.class,"UTF-8") .split(b

Unicode characters not recognizing when reading file

2016-04-13 Thread patelp7
Hi, I have defined my file URI as file:///?charset=UTF-8 and my route looks like below: from(file) .convertBodyTo(String.class,"UTF-8") .split(body().tokenize("\r\n|\n|\r")).streaming() .process(test) .en

Re: Camel Hbase

2016-04-13 Thread VinothKR
I tried exploring the code and what I found was, The HBaseData from mappingStrategy is not having column name, column family details in HRow CellMappingStrategy mappingStrategy = endpoint.getCellMappingStrategyFactory().getStrategy(exchange.getIn()); HBaseData data = mappingStrategy.resolveModel

RE: Best Strategy to process a large number of rows in File

2016-04-13 Thread Michele
Hi, With Memory Analyzer but also with Visual VM, problems suspect found: The thread java.lang.Thread @ 0x783481d90 Camel (IF_CBIKIT-Inbound-Context) thread #28 - seda://processAndStoreInQueue keeps local variables with total size 54.615.096 (11,93%) byte 1.212 instances of "byte[]", loaded by "

Re: Controlling Bucket size for camel aggregator

2016-04-13 Thread Ioannis Mavroukakis
You're very welcome :) - ioannis contactreji wrote: Wow. Thanks Mavr. completionTimeout was the perfect option. - Reji Mathews Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel& Jboss Fuse ESB | Mule ESB ) LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9

Re: Camel bindy not working in Spring boot

2016-04-13 Thread Charles Moulliard
In order to help you, a test case will be required with the code reproducing the issue. On Wed, Apr 13, 2016 at 5:47 PM, cgsk wrote: > I dont have a test case, but below is the route where I pass a List of Map > of > my model class. > > from(Constants.ROUTE_CONVERT_TO_CSV) >

Re: Controlling Bucket size for camel aggregator

2016-04-13 Thread contactreji
Wow. Thanks Mavr. completionTimeout was the perfect option. - Reji Mathews Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB ) LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a Twitter - reji_mathews -- View this message in con

Re: Camel bindy not working in Spring boot

2016-04-13 Thread cgsk
I dont have a test case, but below is the route where I pass a List of Map of my model class. from(Constants.ROUTE_CONVERT_TO_CSV) .log("Received request for S3 upload") .marshal().bindy(BindyType.Csv, "com.domain") .setHeader

Re: Controlling Bucket size for camel aggregator

2016-04-13 Thread Ioannis Mavroukakis
You can use batchTimeout to control when the aggregator will finish. Alternatively a completionPredicate can accomplish the same thing. Bear in mind that they are mutually exclusive. contactreji wrote: Hey guys My downstream system doesn't take more than 1000 records in one go. I am using ag

Controlling Bucket size for camel aggregator

2016-04-13 Thread contactreji
Hey guys My downstream system doesn't take more than 1000 records in one go. I am using aggregator to create batch composed from 1000 exchanges. Now if my upstream system sends 8020 messages, the aggregator collects 8 batches of 1000 each. And the last 20 remains in the aggregator waiting for res

Re: Camel bindy not working in Spring boot

2016-04-13 Thread Charles Moulliard
Hi, Do you have a test case to reproduce the error ? Regards, On Wed, Apr 13, 2016 at 5:18 PM, cgsk wrote: > Could someone help with the below issue? Below is the custom > packageresolver: > > import java.io.IOException; > import java.net.URL; > import java.util.Enumeration; > > import org.apa

Re: Camel bindy not working in Spring boot

2016-04-13 Thread cgsk
Could someone help with the below issue? Below is the custom packageresolver: import java.io.IOException; import java.net.URL; import java.util.Enumeration; import org.apache.camel.impl.DefaultPackageScanClassResolver; import org.springframework.stereotype.Component; @Component public class Sprin

RE: Best Strategy to process a large number of rows in File

2016-04-13 Thread Siano, Stephan
Hi, The camel-csv component converts the file into a List, Therefore your 20 MB file is taking up 40 MB as a String. The List will take up a little more than another 40 MB (so you will need 80 MB during the conversion). This lists lives throughout your split process... What you could do to red

Re: database is locked

2016-04-13 Thread Anton
On Wed, Apr 13, 2016 at 3:28 PM, John D. Ament wrote: > I'll try to see if I can come up > with an example on how to configure this for h2 > I found a solution. The connection string needs to be setup in server mode, eg, jdbc:h2:tcp://localhost/~/home/mydb;AUTO_SERVER=TRUE"

Re: database is locked

2016-04-13 Thread John D. Ament
The problem is that both sqlite and h2 are single user databases. I suspect whats happening is that the EMF is being created multiple times and trying to consume multiple connections. I'll try to see if I can come up with an example on how to configure this for h2, but I don't have sqlite local.

RE: Best Strategy to process a large number of rows in File

2016-04-13 Thread Michele
Hi, In this case file size is 20.424KB and it contains about 4 lines. I used the convertTo to avoid Rollback on rename file (GenericFileOperationFailedException - only Windows). The File is a cvs and so I defined CSV Data format like this (Transforms each line in a map key-value)

Re: Guaranteed file processing - JMS and file producer

2016-04-13 Thread glenn
Hi I'm supplying a simplified route to assist. I didn't consider using the persistent aggregation strategy here in that a single message is being transformed into a single file - I hope that's clearer now with the example route. The FileIdempotentRepository provides sufficient persistence needed p

Re: database is locked

2016-04-13 Thread Anton
On Wed, Apr 13, 2016 at 12:44 PM, John D. Ament wrote: > Just wondering, does this happen the first time the route gets hit or > subsequent times? > Yes, it appears to happen the first time. > > Have you tried providing an explicit EntityManagerFactory bean to the > endpoint? > I havent tried th

Re: Clarification on how Converters work with CDI

2016-04-13 Thread Anton
On Wed, Apr 13, 2016 at 1:58 PM, John D. Ament wrote: > The JPA component doesn't do any type conversion (based on code > inspection). It assumes the object coming in is the right type. Good > catch on adding the converter to the body. > Thanks John I think it would be good to have some consi

Re: Clarification on how Converters work with CDI

2016-04-13 Thread John D. Ament
The JPA component doesn't do any type conversion (based on code inspection). It assumes the object coming in is the right type. Good catch on adding the converter to the body. John On Wed, Apr 13, 2016 at 7:18 AM Antonin Stefanutti wrote: > Yes, I haven’t checked the code though I guess the J

Re: Changing header value

2016-04-13 Thread Claus Ibsen
Or use an AtomicInteger or some other pojo to hold the value as a reference. Java is copy by value http://stackoverflow.com/questions/40480/is-java-pass-by-reference-or-pass-by-value On Wed, Apr 13, 2016 at 12:57 PM, Siano, Stephan wrote: > Hi, > > If you manage to access your variable with a s

Camel bindy not working in Spring boot

2016-04-13 Thread cgsk
Hi There, I am using Bindy csv format to marshal to csv file. Everything works fine if i run from ecplise, but fails with the below exception if ran as a spring boot jar from command line. I tried creating custom PackageScanClassResolver extending DefaultPackageScanClassResolver, but no luck. I a

Re: Clarification on how Converters work with CDI

2016-04-13 Thread Antonin Stefanutti
Yes, I haven’t checked the code though I guess the JPA component isn’t doing the conversion automatically. Maybe that could be an enhancement to the JPA component. Antonin > On 13 Apr 2016, at 13:15, Anton wrote: > > When I add the following it works > On Wed, Apr 13, 2016 at 1:04 PM, Antonin

Re: Clarification on how Converters work with CDI

2016-04-13 Thread Anton
When I add the following it works On Wed, Apr 13, 2016 at 1:04 PM, Antonin Stefanutti wrote: > .convertBodyTo(SupportRequest.class) > And it doesnt when this is not included.

RE: Best Strategy to process a large number of rows in File

2016-04-13 Thread Siano, Stephan
Hi, How big is your document? You are converting that thing into a String, which is generally unadvisable for large content (as it will consume twice the file size in memory). The second question is what your ReaderDataFormat does with the data. Does it copy it again or does it support streami

Re: Clarification on how Converters work with CDI

2016-04-13 Thread Antonin Stefanutti
Hi Anton, And just to be sure this is a Camel CDI problem, could you add a: convertBodyTo(SupportRequest.class) in your Camel route, like: public void configure() { from(ticketEndpoint) // returns a Ticket .convertBodyTo(SupportRequest.class) .to("jpa:my.domain.SupportRequest&persiste

Re: Clarification on how Converters work with CDI

2016-04-13 Thread Antonin Stefanutti
Hi Anto, Type converter annotated with @Converter are automatically discovered by Camel CDI and added to the Camel context. You can find an example here: https://github.com/apache/camel/blob/337a6756480354afea7531a1a4216de9d232f211/components/camel-cdi/src/test/java/org/apache/camel/cdi/convert

RE: Changing header value

2016-04-13 Thread Siano, Stephan
Hi, If you manage to access your variable with a simple expression this should work (e.g. if a is a static field of YourRouteBuilder class, you might be able to access it as ${your.package.YourRouteBuilderClass.a}), though I have never tried that. A processor might be easier. Best regards Step

Re: Clarification on how Converters work with CDI

2016-04-13 Thread Anton
Hi John Thanks for your reply. Im using Weld. Im using Camel 2.17.0 My beans.xml looks like this: I tried adding AppScoped, but it did not make any difference.

Re: Clarification on how Converters work with CDI

2016-04-13 Thread John D. Ament
Hi Anton, Just wondering, what does your deployment look like? Weld? OWB? Versions? Does your beans.xml use default discovery mode? Is it empty? Are you using all? If you're not sure f these, could you try adding a scope, e.g. @ApplicationScoped to the converter and try again? John On Wed, Apr

Clarification on how Converters work with CDI

2016-04-13 Thread Anton
Hello Im trying to use a camel type converter with Camel CDI. My converter looks like the following: @Converter @SuppressWarnings("all") public class TicketConverter { @Converter public SupportRequest convertToSupportRequest(final Ticket ticket) { SupportRequest sr = new SupportRequest(

Re: database is locked

2016-04-13 Thread John D. Ament
Hi Anton, Just wondering, does this happen the first time the route gets hit or subsequent times? Have you tried providing an explicit EntityManagerFactory bean to the endpoint? John On Wed, Apr 13, 2016 at 6:24 AM Anton wrote: > Hi > > I tried changing this from sqlite to h2, and now I get a

Re: database is locked

2016-04-13 Thread Anton
Hi I tried changing this from sqlite to h2, and now I get a similar error: Caused by: java.lang.IllegalStateException: The file is locked: nio:/home/anton/twdb.mv.db [1.4.191/7] at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773) at org.h2.mvstore.FileStore.open(FileStore.java

RE: Changing header value

2016-04-13 Thread Kasim Sert (Ibtech-Software Infrastructure)
Hi, You mean since its a constant expression it is evaluated at the beginning and not changed after as far as I understand. So can I do it with simple expression instead of constant or should I introduce new processor to make it read current value of variable a. Thank you. -Original Messa

Re: Best Strategy to process a large number of rows in File

2016-04-13 Thread Michele
Hi, I'm here again because I don't resolved my problem. After several checks, I noticed this: memory-usage.png Why does thread related to seda://processAndStoreInQueue consume much memory? How to optimize memory usage? This

RE: Changing header value

2016-04-13 Thread Siano, Stephan
Hi, At the beginning of the route you are setting the header to the value a has when the route is started (it's a constant expression). In the processor you are incrementing the value and are then setting the header to the current value of the variable a, so the route behaves as one would expec

Changing header value

2016-04-13 Thread Kasim Sert (Ibtech-Software Infrastructure)
Hi, Can somebody please explain, why header value for starting always remains same although its changed in processor ? Route: İnt a=1 from("timer://myTimer2?period=1000") .setHeader("myheader", constant(a)) .log("starting...${header[myhea

Re: Guaranteed file processing - JMS and file producer

2016-04-13 Thread Andrea Tarocchi
Hi Glen, do you have a way to make the writing of the file itself idempotent? i.e. you might use a unique id in the file name tush writing it a second time would alter only the timestamp. Is that doable? In this way you can put aside the idempotent repository and overcome your issue. Regards, An

Re: Camel MQTT Endpoint reconnect on transport failure

2016-04-13 Thread nvbabu
Hi, Is this issue got fixed? i am facing similar problem with MQTT and Stomp. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-MQTT-Endpoint-reconnect-on-transport-failure-tp5757564p5780960.html Sent from the Camel - Users mailing list archive at Nabble.com.

Camel-Jetty http proxy + large response data casue issue: Buffering capacity exceeded(camel version: 2.17.0)

2016-04-13 Thread LoriSun
Hi expert, I got "buffering capacity exceeded" issue when getting back large data via camel-jetty as http proxy, how to increase the buffer size? I have tried many ways, but still not working... any experience/idea/suggestion are welcome. from("servlet:balancer?matchOnUriPrefix=true").to("jetty:htt