Re: Reading from the Stream component and unmarshalling with Bindy

2010-12-14 Thread davsclaus
Your Java beans must be annotated with Bindy annotations. See the bindy documentation, or chapter 3 in the Camel in Action book which has examples with Bindy. -- View this message in context: http://camel.465427.n5.nabble.com/Reading-from-the-Stream-component-and-unmarshalling-with-Bindy-tp3305

Re: file to oneway cxf service scenario does not work with camel 2.5.0

2010-12-14 Thread Willem Jiang
FYI,I just committed a patch of CAMEL-3426 into Camel trunk. Please check out the latest Camel 2.6-SNAPSHOT for verification. On 12/14/10 10:03 PM, Willem Jiang wrote: Hi, I just reproduce the error by writing a simple test case as you described, and created a JIRA[1] for it. [1] https://issue

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Claus Ibsen
Its probably best to receive without any timeout, using receiveNoWait. On Tue, Dec 14, 2010 at 6:43 PM, Andreas A. wrote: > > Hi > > Something fishy is still going on, this is the code now: > > String ftpsUri = > "ftp:localhost:1981/inbox?consumer.delay=1h&username=camel&password=camel123&move=.

Re: JMS Exceptions

2010-12-14 Thread Claus Ibsen
On Wed, Dec 15, 2010 at 7:35 AM, Damian Harvey wrote: > Thanks Claus. So I could get the Route starting by specifying the JMS > endpoint like (note the hash): > > from("jms:"+getRequestQueue()+getRequestQueueOps()+"&exceptionListener=#jmsExceptionListener") > > So that when Camel starts I can see

RE: JMS Exceptions

2010-12-14 Thread Damian Harvey
Thanks Claus. So I could get the Route starting by specifying the JMS endpoint like (note the hash): from("jms:"+getRequestQueue()+getRequestQueueOps()+"&exceptionListener=#jmsExceptionListener") So that when Camel starts I can see the following in the logs: Route: JmsRouter started and consumi

Re: Cannot create JMX connector

2010-12-14 Thread tan
hi Claus Ibsen-2, thanks for the reply. I have tried using agent.setCreateConnector(true) only, but still got the same error. Just a summary, I have tried: 1. agent.setCreateConnector(true) only 2. -Dorg.apache.camel.jmx.createRmiConnector=true only 3. -Dorg.apache.camel.jmx.createRmiConnector=t

Re: SFTP operation raises an exception, but the file is transferred

2010-12-14 Thread codemickey
My understanding of what is going on behind the scenes is: It downloads the file. When the context.stop is executed, it tries to to do graceful shutdown, but I get the following message: INFO: Route: route1 suspended and shutdown deferred, was consuming from: Endpoint[sftp://usern...@server/data

Re: interceptSendToEndpoint with dynamic endpoint

2010-12-14 Thread John
I've started testing with the camel 2.6 snapshot and believe I have found the root of the issue. The endpoint I am trying to test is an http endpoint. I included the user name and password as query params in the URI. Having a "&" in the URI prevents the InterceptSendToEndpoint from working corre

Re: Splitting big XML files using xpath() and streaming()

2010-12-14 Thread Christian Müller
Only for clarification, the streaming mode doesn't work with xpath but works very well with the Scanner, which is used if you split like this: split(body(String.class).tokenize("\n")). If you have to split CSV files, you will probably use the Scanner. You should also have a look at the camel smooks

CXF+REST+Camel Routes

2010-12-14 Thread Kazi, Iftekhar
Hi, Am a newbie and have some problems with the cxf endpoint in a Camel Route. Have created JAXB object definitions using xjc and created a REST Interface using cxf. When I deploy the implementation in Camel and use the code as outlined in the Part 4 of the ReportIncident Tutorial [using a pr

Re: dynamicRouter Thread safe issue

2010-12-14 Thread Claus Ibsen
On Tue, Dec 14, 2010 at 7:05 PM, kaoru wrote: > > Hi guys, > >  from the dynamic-router webpage, there is an example: > > > /** >  * Use this method to compute dynamic where we should route next. >  * >  * @param body the message body >  * @return endpoints to go, or null to indicate the end >  */

Re: SFTP operation raises an exception, but the file is transferred

2010-12-14 Thread Claus Ibsen
On Tue, Dec 14, 2010 at 7:18 PM, codemickey wrote: > > I did search for this issue but had no luck finding something related to it. > I will try asking this at the JCraft mailing list! > > Thanks Claus! I will try and post a solution once I find it. > For the FTP component I thought of using some

Re: SFTP operation raises an exception, but the file is transferred

2010-12-14 Thread codemickey
I did search for this issue but had no luck finding something related to it. I will try asking this at the JCraft mailing list! Thanks Claus! I will try and post a solution once I find it. Thanks, Mansi Kanani -- View this message in context: http://camel.465427.n5.nabble.com/SFTP-operation-

dynamicRouter Thread safe issue

2010-12-14 Thread kaoru
Hi guys, from the dynamic-router webpage, there is an example: /** * Use this method to compute dynamic where we should route next. * * @param body the message body * @return endpoints to go, or null to indicate the end */ public String slip(String body) { bodies.add(body); invok

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Hi Something fishy is still going on, this is the code now: String ftpsUri = "ftp:localhost:1981/inbox?consumer.delay=1h&username=camel&password=camel123&move=.done"; String fileUri = "file:{{path.in}}"; consumer.start(); while(true) { Exchange exchange = consumer.receive(ftpsUri, 5000

camel 2.5 JMS Request/Reply caching weirdness

2010-12-14 Thread Jason Burkhardt
A little background: I'm using FioranoMQ repeaters to share messages between different servers. Request reply works over this by setting JMSReplyTo to a common destination being propagated between servers and setting JMSX_OriginalReplyTo to the actual destination the requester will be listening

Re: onException not catching exception

2010-12-14 Thread John
2.6 fixes it. Thanks Claus! -- View this message in context: http://camel.465427.n5.nabble.com/onException-not-catching-exception-tp3304725p3304872.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: cxf:handlers for cxf:cxfEndpoint?dataFormat=PAYLOAD not supported?

2010-12-14 Thread William Tam
I think you have to provide a serviceClass in this case. The serviceClass is only retrospected to create a CXF service endpoint. Yes, If you specific PAYLOAD mode, the XML message unmarshalling to Java will not be performed by the Camel-cxf endpoint. It's looks you are using the simple fro

Re: Questions of how to simplify using Camel as mediator for WebService

2010-12-14 Thread ext2
Hi, William Tam: It's cool. Thanks a lot original - Sender: William Tam [mailto:email.w...@gmail.com] Date: 2010/12/15 0:04 Receiver: users@camel.apache.org Subject: Re: Questions of how to simplify using Camel as mediator for WebService I think you can give Simple Language's OGNL a tr

Re: Questions of how to simplify using Camel as mediator for WebService

2010-12-14 Thread William Tam
I think you can give Simple Language's OGNL a try (on CxfPayload object) to avoid writing Java code. On 12/14/2010 10:40 AM, ext2 wrote: >> Camel message header is used by transport header and other Camel >> "internal" header. > Is it the design principles of camel? Only transport header and Inter

Re: How to setup a dynamic route using beans in Java w/o having a spring ref to them?

2010-12-14 Thread ext2
Sorry, forget to say, in osgi registry, the name of service(bean) is the osgi service's class name; that's to say to using "to" endpoint to invoke a osgi service is not like to invoke a spring bean. It should use the class as name , not the id like spring registry does; By the way, if you osgi se

Re: Questions of how to simplify using Camel as mediator for WebService

2010-12-14 Thread William Tam
Another suggestion is to leverage sample language's OGNL support (http://camel.apache.org/simple.html) which is pretty cool. I haven't tried it myself tho. For example in PAYLOAD mode, you can get ... the second SOAP message part by simple("${body.body[1]}") the third SOAP header by simple("${bod

Re: How to setup a dynamic route using beans in Java w/o having a spring ref to them?

2010-12-14 Thread ext2
Trying recipient-list pattern(dynamic to create to endpoint to invoke beans in registry), it will look registry of osgi first(Clause has already said ) -original - Sender: klausb [mailto:klaus.baumec...@hp.com] Date: 2010/12/14 23:31 Sender: users@camel.apache.org Subject: Re: How to setu

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Claus Ibsen
I have created a ticket to make this easier using the ConsumerTemplate API https://issues.apache.org/jira/browse/CAMEL-3427 Check the source code in trunk, how to do it in your Camel version. On Tue, Dec 14, 2010 at 4:39 PM, Andreas A. wrote: > > Can't find anything along those lines. I tried d

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Oh it was a private method. Thought you meant in the api. I suppose I should do the manual handover then. Just pasting here for future reference: if (exchange.getUnitOfWork() == null) { // handover completions and done them manually to ensure they are being executed List synchroni

Re: Questions of how to simplify using Camel as mediator for WebService

2010-12-14 Thread ext2
>Camel message header is used by transport header and other Camel >"internal" header. Is it the design principles of camel? Only transport header and Internal header? > If you jam the SOAP header in there, not only it can >create a mess. How can other components tell it is not a "transport" >heade

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Can't find anything along those lines. I tried doing while(true) { Exchange ex = consumer.receive(ftpsUri, 5000); if(ex != null) { logger.info("Fetching file: " + ex.getIn().getHeader("CamelFileName")); producer.send(fileUri, ex);

Re: How to setup a dynamic route using beans in Java w/o having a spring ref to them?

2010-12-14 Thread klausb
Hi Claus, I tried it, but it doesn't work. The point is, that my dynamic Java-DSL route-builder does not know, what the IDs of the beans are, which are added to the routes. It works, if I'm adding the osgi:ref to one of the spring resource files, like this: Without this line, the bean is not

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Claus Ibsen
On Tue, Dec 14, 2010 at 4:27 PM, Andreas A. wrote: > > However if I use only receiveBody I miss the headers like the filename etc. > -- Then you need to done the Exchange yourself. See the doneUoW method in DefaultConsumerTemplate > View this message in context: > http://camel.465427.n5.nabble.

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
However if I use only receiveBody I miss the headers like the filename etc. -- View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTemplate-to-fetch-files-tp3304671p3304747.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Ah ok! -- View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTemplate-to-fetch-files-tp3304671p3304746.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Hi I should be a subscriber. I have made 100+ posts via nabble. I haven't changed anything regarding my account, are my posts not accepted on the mailinglist anymore or? I've tried with both 2.5 and 2.6. I'm getting some really odd behaviour - why is it stacking the base dir "inbox"?: -> ERROR

Re: Asynchronous Netty Server And CAMEL

2010-12-14 Thread davsclaus
We love contributions, so you are much welcome to see if you can improve the component. -- View this message in context: http://camel.465427.n5.nabble.com/Asynchronous-Netty-Server-And-CAMEL-tp3302581p3304735.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: onException not catching exception

2010-12-14 Thread davsclaus
Try with 2.6-SNAPSHOT, as I think its fixed there. -- View this message in context: http://camel.465427.n5.nabble.com/onException-not-catching-exception-tp3304725p3304734.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not able to get Exchange.REDELIVERY_EXHAUSTED header

2010-12-14 Thread davsclaus
boolean exhausted = exchange.getIn().getHeader(Exchange.REDELIVERY_EXHAUSTED, Boolean.class); -- View this message in context: http://camel.465427.n5.nabble.com/Not-able-to-get-Exchange-REDELIVERY-EXHAUSTED-header-tp3303237p3304731.html Sent from the Camel - Users mailing list archive at Nabble.

onException not catching exception

2010-12-14 Thread John
Hi, I have the following route that worked in 2.2 but doesn't appear to work in 2.5: from("direct:POSTINGAPP.REQ.LISTSPLITTER") .routeId("splitterRouter") .onException(InvalidXPathExpression.class).handled(true).log("Invalid xpath posting request").end()

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread davsclaus
Since you work with the low level Exchange, you need to done it if you want it to move the files. exchange.getUnitOfWork().done(exchange); This is done automatic for you in Camel 2.5 onwards if you use, eg receiveBody instead Object body = consumer.redeveiveBody("uri", xxx); -- View this messag

Re: Questions of how to simplify using Camel as mediator for WebService

2010-12-14 Thread William Tam
On 12/14/2010 08:51 AM, ext2 wrote: > Hi: > > The cxf component (payload model)will wrapped the soap message in a > CXFPayLoad or a CXFMessage. Both are not advantage for camel's script > language to access headers and body xml。 > I cannot use a simple expression etc: simple language

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread davsclaus
Are you a subscriber of the mailing list? I haven't seen you mail before. You need Camel 2.5 or better AFAIR for the consumer template to work with files, where it supports deleting / moving files when done. -- View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTempla

Re: How to setup a dynamic route using beans in Java w/o having a spring ref to them?

2010-12-14 Thread Claus Ibsen
On Tue, Dec 14, 2010 at 12:04 PM, klausb wrote: > > I want to configure routing by an external configuration file. > The routes are made of beans, which register themselves using the > spring/osgi registry. > Now the route builder, made with the Java DSL, wants to use the beans > without knowing t

Re: Cannot create JMX connector

2010-12-14 Thread Claus Ibsen
Hi Have you tried with just only setting create connector = true On Tue, Dec 14, 2010 at 8:24 AM, tan wrote: > > Hi, > > I have problems creating a jmx connector for remote monitoring. I tried > putting -Dorg.apache.camel.jmx.createRmiConnector=true in the VM arguments, > as well as adding the

Re: Sftp access to file that are not yet finished to be written

2010-12-14 Thread Claus Ibsen
Hi We have discussed this before. Maybe search this forum. Its a general issue when sharing data with files. How to know when the file is ready for me to read. Its generally better to have the person who writes the file, to do that in another folder / or use a temporary name. Then when he is done

Re: file to oneway cxf service scenario does not work with camel 2.5.0

2010-12-14 Thread Willem Jiang
Hi, I just reproduce the error by writing a simple test case as you described, and created a JIRA[1] for it. [1] https://issues.apache.org/jira/browse/CAMEL-3426 On 12/13/10 11:16 PM, Aki Yoshida wrote: Hi, I have a simple scenario using the file endpoint that polls a file and sends it to a

Questions of how to simplify using Camel as mediator for WebService

2010-12-14 Thread ext2
Hi: The cxf component (payload model)will wrapped the soap message in a CXFPayLoad or a CXFMessage. Both are not advantage for camel's script language to access headers and body xml。 I cannot use a simple expression etc: simple language or xpath language to access the soap header

Re: Aggregate all files in one

2010-12-14 Thread Claus Ibsen
There is a special completion for batch consumer. Use that instead of the completion predicate. http://camel.apache.org/aggregator2 On Tue, Dec 14, 2010 at 2:28 PM, florent andré wrote: > Hi there, > > I continue to explore Camel, and now I would like to aggregate all > text/xml files in a folde

Re: Splitting big XML files using xpath() and streaming()

2010-12-14 Thread ext2
The real problem is: if split expression cannot do streaming operation, the memory cost cannot be avoid; Here the xpath is example which cannot do streaming. Csv will be another example. It means we cannot process a very large csv file (is it?I am not sure, but it seems so) So how about supporting

Aggregate all files in one

2010-12-14 Thread florent andré
Hi there, I continue to explore Camel, and now I would like to aggregate all text/xml files in a folder in one unique file in another folder. I try many things, and think arrive to something that "should work" ;)... but it don't : the aggregated file is not created. Do you see any newbie mistake

Throwing Soap Fault in POJO mode

2010-12-14 Thread hervbarr
Hi, I have looked to the following documentation : http://camel.apache.org/cxf.html#CXF-HowtothrowaSOAPFaultfromCamel I have tried as the documentation says and it works : from("cxf:bean:myEndpoint") .setFaultBody(constant(new SoapFault("My Error message", org.apache.cxf.interceptor.Fault.FAULT

Re: Splitting a List and deleting it at the end

2010-12-14 Thread ext2
Backup it in a message header before entering split, then you can use it. But if memory cost is a critical problem for you, you'd better to redesign your from endpoint's implementation, which should not loading all objects in memory at once, but return a iterator which will sequential load the ob

Re: Splitting big XML files using xpath() and streaming()

2010-12-14 Thread Charles Moulliard
Hi Christian, Interesting discussion that you have started where we reach the border / limit about what camel should do in a messaging approach instead of a batch process. Regarding to your question about using a stylesheet to split the XML files into multiple small files, I'm not quite sure

How to setup a dynamic route using beans in Java w/o having a spring ref to them?

2010-12-14 Thread klausb
I want to configure routing by an external configuration file. The routes are made of beans, which register themselves using the spring/osgi registry. Now the route builder, made with the Java DSL, wants to use the beans without knowing them in advance. That is, they are not configured in the spri

Re: Splitting big XML files using xpath() and streaming()

2010-12-14 Thread Christian Müller
@Claus: As what I found, using XPath in a streaming mode is not possible out of the box in Java 5 or 6 (XPath 1.0 needs the DOM XML Document). JAXP 1.4 (part of Java 6) includes the StAX API and can be used in Java 5. But than we have to parse the XPath expression by our self and use the Iterator A

Sftp access to file that are not yet finished to be written

2010-12-14 Thread nspadaro
Hi all, I have a route who pool on an sftp folder, and when find a file download and delete it. The problem is that it download and delete the file even if it's not completed the upload. There is a way other than delay the operation to check for the end of file? I'm using camel 2.3.0. Thanks in a

Re: SFTP operation raises an exception, but the file is transferred

2010-12-14 Thread Claus Ibsen
Hi I have been told by another Camel user they had something similar, but I think it was the regular FTP component. The file was downloaded but the FTP library threw an exception. Their problem was their network topology which wasn't to well setup. Try googling and asking at the JCraft mailing li