Re: Loadbalancer for consuming?

2010-10-08 Thread Markus Wolf
Hi. If you want to read from multiple sources, where do you know from which source to read a pending message in case of a loadbalancer? Or are there always messages you want to consume. I would recommend to create a consumer for each source uri and push all messages into a common queue and then yo

Charset conversion issue.

2010-10-08 Thread Andreas A.
Hi I'm interacting with a system that inputs and outputs textfiles in charset Cp865. I want to fetchs files from the system and convert them to Cp1252 locally. I want to convert outgoing files from Cp1252 to Cp865. I'm trying to use a combination of setting CamelCharsetName on the exchange and

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
Maybe the "charset" option on the File/FTP endpoint from 2.5 is what I want. Use the Cp865 as on the consumer and Cp1252 on the producer and vice versa? -- View this message in context: http://camel.465427.n5.nabble.com/Charset-conversion-issue-tp3204282p3204293.html Sent from the Camel - Users

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
Hi I'm doing as below now which works ok - but isn't this what is supposed to do for me? @Override public void process(Exchange exchange) throws Exception { String converted = new String(exchange.getIn().getBody(String.class).getBytes("Cp1252"));

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
Is it correct that setting "org.apache.camel.default.charset" is the only way to make Camel 2.4 read a file in a specific charset? -- View this message in context: http://camel.465427.n5.nabble.com/Charset-conversion-issue-tp3204282p3204315.html Sent from the Camel - Users mailing list archive a

Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Ade
I've never been a fan of Java serialization; however, I've been working with a Camel user who wants to be able to serialize an exchange and place the whole thing on a JMS queue. The motivation is that they want to set the exchange up to be subsequently persisted in a database for audit purposes, b

Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Ade
Is it possible to give an anonymous inline Processor an identity using a Java annotation? Am thinking that this would be great for trace or audit purposes, where you want a tracer or interceptor to log/audit that a particular processor on the route has been invoked. I'm not sure if you can put a

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Claus Ibsen
Hi There is a transferExchange option on the JMS component On Fri, Oct 8, 2010 at 12:21 PM, Ade wrote: > > I've never been a fan of Java serialization; however, I've been working with > a Camel user who wants to be able to serialize an exchange and place the > whole thing on a JMS queue. The m

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Claus Ibsen
On Fri, Oct 8, 2010 at 12:21 PM, Ade wrote: > > I've never been a fan of Java serialization; however, I've been working with > a Camel user who wants to be able to serialize an exchange and place the > whole thing on a JMS queue. The motivation is that they want to set the > exchange up to be subs

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
After a lot of trial and error I can see that the files are only read correctly as Cp865 if I set the system property "org.apache.camel.default.charset" to Cp865. If I try anything else I get ? ? ? for characters such as æ ø å. Can someone explain the mechanics behind this? I thought that the body

Re: Charset conversion issue.

2010-10-08 Thread Claus Ibsen
Hi Create a small project / unit test and attach it to a JIRA ticket. And make sure those txt files is saved in that encoding your expect. Then we can do a test on windows to ensure it works as expected. On Fri, Oct 8, 2010 at 10:59 AM, Andreas A. wrote: > > Hi > > I'm interacting with a syst

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
Hi Ok I will make a sample later, I needed a solution urgently though :) I just tested this: And this results in the conversion being correct *shrugs*. -- View this message in context: http://camel.465427.n5.nabble.com/Charset-conversion-issue-tp3204282p3204461.html Sent from the Camel -

Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Claus Ibsen
Hi Maybe we should make sure you can use .id("xxx") as the rest of the DSL with an inlined anonym as well. I actually don't know if you can do that. But I can check it out :) On Fri, Oct 8, 2010 at 12:31 PM, Ade wrote: > > Is it possible to give an anonymous inline Processor an identity using

Re: Charset conversion issue.

2010-10-08 Thread Willem Jiang
On 10/8/10 7:41 PM, Andreas A. wrote: Hi Ok I will make a sample later, I needed a solution urgently though :) I just tested this: And this results in the conversion being correct *shrugs*. I think this solution is making sense. If you don't like this, you can do it in your customer pro

Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Claus Ibsen
On Fri, Oct 8, 2010 at 1:45 PM, Claus Ibsen wrote: > Hi > > Maybe we should make sure you can use .id("xxx") as the rest of the > DSL with an inlined anonym as well. > I actually don't know if you can do that. But I can check it out :) > Works fine see http://svn.apache.org/viewvc?rev=1005791&vie

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Adrian Trenaman
Thanks Claus for the quick response! Will propose the 'transferExchange' approach. Cheers, Ade. On 08/10/2010 12:02, Claus Ibsen wrote: Hi There is a transferExchange option on the JMS component On Fri, Oct 8, 2010 at 12:21 PM, Ade wrote: I've never been a fan of Java serialization; how

Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Adrian Trenaman
Sweet! Very, very nice. Thanks Claus! Am now compelled to buy you a beer at the FUSE Community Day in Paris next week :) On 08/10/2010 12:59, Claus Ibsen wrote: On Fri, Oct 8, 2010 at 1:45 PM, Claus Ibsen wrote: Hi Maybe we should make sure you can use .id("xxx") as the rest of the DSL wi

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
Hi Willem Can you explain why you think it makes sense? - Andreas -- View this message in context: http://camel.465427.n5.nabble.com/Charset-conversion-issue-tp3204282p3204490.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Claus Ibsen
On Fri, Oct 8, 2010 at 2:01 PM, Adrian Trenaman wrote: >  Sweet! > > Very, very nice. Thanks Claus! Am now compelled to buy you a beer at the > FUSE Community Day in Paris next week :) > Cool didn't you bring back some Victorian Bitters from down under ? But hey I bet everybody got reasons to bu

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
Where can I see what convertBodyTo translates to in Java code? I would like to see what it does. -- View this message in context: http://camel.465427.n5.nabble.com/Charset-conversion-issue-tp3204282p3204502.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Adrian Trenaman
Any Victorian Bitters I encountered, I swiftly quaffed ;) On 08/10/2010 13:05, Claus Ibsen wrote: On Fri, Oct 8, 2010 at 2:01 PM, Adrian Trenaman wrote: Sweet! Very, very nice. Thanks Claus! Am now compelled to buy you a beer at the FUSE Community Day in Paris next week :) Cool didn't yo

Re: Charset conversion issue.

2010-10-08 Thread Andreas A.
I have made this class to subsitute the tags. public class CharsetConverter { public void toInternalCharset(Exchange exchange) throws Exception { String internalCharset = Charset.defaultCharset().name(); String converted = new String(exchange.getIn()

Re: Charset conversion issue.

2010-10-08 Thread Claus Ibsen
On Fri, Oct 8, 2010 at 2:13 PM, Andreas A. wrote: > > Where can I see what convertBodyTo translates to in Java code? I would like > to see what it does. Every EIP has a xxxDefintion in the model package. So go find ConvertBodyDefinition and go from there. > -- > View this message in context:

Re: Charset conversion issue.

2010-10-08 Thread Willem Jiang
On 10/8/10 8:03 PM, Andreas A. wrote: Hi Willem Can you explain why you think it makes sense? - Andreas The message body is an InputStream, with this convert, the body is changed to String with the charset Cp865. The message body is not change yet, and it set the exchange property wi

Re: Charset conversion issue.

2010-10-08 Thread Willem Jiang
On 10/8/10 8:13 PM, Andreas A. wrote: Where can I see what convertBodyTo translates to in Java code? I would like to see what it does. You can find the code here[1] [1]https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java -

Re: Charset conversion issue.

2010-10-08 Thread Willem Jiang
On 10/8/10 8:36 PM, Andreas A. wrote: I have made this class to subsitute the tags. public class CharsetConverter { public void toInternalCharset(Exchange exchange) throws Exception { String internalCharset = Charset.defaultCharset().name(); you need to set the ex

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Hadrian Zbarcea
+1 fwiw, Hadrian On Oct 8, 2010, at 7:05 AM, Claus Ibsen wrote: > On Fri, Oct 8, 2010 at 12:21 PM, Ade wrote: >> >> I've never been a fan of Java serialization; however, I've been working with >> a Camel user who wants to be able to serialize an exchange and place the >> whole thing on a JMS qu

Re: [Hookpoint] Extensible routes ?

2010-10-08 Thread James Strachan
On 8 October 2010 05:26, Ashwin Karpe wrote: > > Hi, > > You can use "vm:..." provided there are multiple Camel contexts with routes > running in the same VM It actually has to be the same class loader. If you're not very careful with OSGi, you can have different bundles using different class loa

Re: [Hookpoint] Extensible routes ?

2010-10-08 Thread James Strachan
On 6 October 2010 13:02, Olivier.Roger wrote: > Hello Camel! > > I was wondering how routes could be extensible. > > I thougth I could use the following idea to do it but I appears to be > otherwise: > > The route I created is pretty simple: It picks up message from A, transform > it then send it

Re: [Hookpoint] Extensible routes ?

2010-10-08 Thread Olivier.Roger
jstrachan wrote: > > On 6 October 2010 13:02, Olivier.Roger wrote: >> Hello Camel! >> >> I was wondering how routes could be extensible. >> >> I thougth I could use the following idea to do it but I appears to be >> otherwise: >> >> The route I created is pretty simple: It picks up message from

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Björn Bength
On a related issue regarding Serializable that occured to me: We recently made a Wicket GUI interface for traced routes using org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage do store event messages. We wanted to use this class directly in dao methods, for searching, listing and di

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Hadrian Zbarcea
It's ok for Messages to be Serializable. The Exchange imho should not. So sure, wanna raise a jira? Thanks Hadrian On Oct 8, 2010, at 10:51 AM, Björn Bength wrote: > On a related issue regarding Serializable that occured to me: > > We recently made a Wicket GUI interface for traced routes using

Re: The semantics of getIn and getOut (was: message not getting delivered)

2010-10-08 Thread Claus Ibsen
On Thu, Oct 7, 2010 at 3:51 PM, Hadrian Zbarcea wrote: > As promised, here's my take [1] on the getIn()/getOut() confusion. > In a few days, when the dust will settle I'll take what's relevant from the > post, and the comments that will follow and update the wiki page. > > I hope that clarifies t

Re: Loadbalancer for consuming?

2010-10-08 Thread tide08
I think sticky loadbalancer with failover will work in this case. It is a custom endpoint but over http. It is custom queueing system (similar to memcached) and end clients enqueue message based upon geographic proximity or fastest route. And I want to consume from each of these nodes and than

Re: Loadbalancer for consuming?

2010-10-08 Thread tide08
You are right Ashwin about design patterns, and that is why exactly I posted here. It is typically not a load balancer scenario, I can create "n" routes one each per uri but something similar to loadbalancer might have served better. Thanks! -- View this message in context: http://camel.465427.

Re: Loadbalancer for consuming?

2010-10-08 Thread Claus Ibsen
On Fri, Oct 8, 2010 at 6:25 PM, tide08 wrote: > > You are right Ashwin about design patterns, and that is why exactly I posted > here. It is typically not a load balancer scenario, I can create "n" routes > one each per uri but something similar to loadbalancer might have served > better. > I wou

Re: Loadbalancer for consuming?

2010-10-08 Thread tide08
Creating route per uri does not feel right to me as it will be wastage of resources i.e. threadpool for ex: there can be thousands of message coming to one node where as others might just be idle. In this scenario threadpool on the other nodes are wasted. Something similar to Loadbalancer might h

Re: Loadbalancer for consuming?

2010-10-08 Thread Claus Ibsen
On Fri, Oct 8, 2010 at 6:43 PM, tide08 wrote: > > Creating route per uri does not feel right to me as it will be wastage of > resources i.e. threadpool for ex: there can be thousands of message coming > to one node where as others might just be idle. In this scenario threadpool > on the other node

Re: The semantics of getIn and getOut (was: message not getting delivered)

2010-10-08 Thread Hadrian Zbarcea
Thanks Claus, will do. I think there's a lot to do to improve documentation and I want to make that one of my priorities. I hope the whole community will join :). Cheers, Hadrian On Oct 8, 2010, at 12:10 PM, Claus Ibsen wrote: > On Thu, Oct 7, 2010 at 3:51 PM, Hadrian Zbarcea wrote: >> As pr

Re: Loadbalancer for consuming?

2010-10-08 Thread tide08
Thanks Claus! But looks like routePolicy gets triggered onExchange but in my scenario consumer itself is first step in route. Or may be I mis-misunderstood what you said? -- View this message in context: http://camel.465427.n5.nabble.com/Loadbalancer-for-consuming-tp3203497p3205168.html Sent

Re: Loadbalancer for consuming?

2010-10-08 Thread Ashwin Karpe
Hi, Please check out the following Camel Documentation http://camel.apache.org/scheduledroutepolicy.html http://camel.apache.org/scheduledroutepolicy.html or my blog article ( http://opensourceknowledge.blogspot.com/2010/09/developed-capability-in-camel-to.html http://opensourceknowledge.blogs

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Christian Müller
I'm the camel user Ade is working with. :o) If I understood correct, we should code something like this on the sender side (we use Camel 2.2): Serializable holder = DefaultExchangeHolder.marshal(exchange); exchange.getIn().setBody(holder); and on the receiver side: holder = exchange.getIn().getB

Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Christian Müller
Hello Claus, hello Ade! I modified the test a bit on my machine. I added the following two lines to enable the default tracer: {code:java} context.setTracing(true); context.getInterceptStrategies().add(new Tracer()); {code} I received the following log statements:

Re: Loadbalancer for consuming?

2010-10-08 Thread Willem Jiang
On 10/8/10 2:36 AM, tide08 wrote: Not sure if it make sense to use loadbalancer in such context but I need to consume message from external system which has multiple nodes i.e. multiple uri's to consume from. I was wondering if camel loadbalancer can be used in such context.

Re: Should we (could we?) make Exchanges serializable?

2010-10-08 Thread Hadrian Zbarcea
Christian, That's the gist of it, yes. You have to decide if you want to marshal the properties as well. You are correct. The problem (stated another way) is that the exchange itself has no semantic outside of it's context, so what the holder does is to extract from the exchange the elements t

Re: Giving anonymous processors an identity - is there an annoation for that?

2010-10-08 Thread Claus Ibsen
Hi Its a known issue with the tracer when it gets a bit more complex when using interceptors etc. Its listed in the known issue section in the release notes. And we got a couple of JIRA tickets about this. A rework on internals in Camel 3 should help us make this work better than we currently can

Re: Could UnitOfWork support a customed transaction-like processs?

2010-10-08 Thread Claus Ibsen
Hi See chapter 9 in the Camel in action book which talks about "compensations" It shows how you can rollback/commit a file etc. And lays out how you can do this as well for custom endpoints / components etc. On Fri, Oct 8, 2010 at 6:56 AM, ext2 wrote: > Hi: >        Only transactional resource

Re: Error parsing simple/properties in ?

2010-10-08 Thread Claus Ibsen
On Tue, Oct 5, 2010 at 3:35 PM, Ashwin Karpe wrote: > > Looks like Claus has already answered this issue. > > Claus, do you think we should capture this requirement for future > enhancement or do you think this is overkill? > I have created a ticket to look into a general solution for the EIPs ht