Re: File contents - socket; socket - pipeline; fails
Hi Tereza Usually it says why it failed to bind. I suppose you checked that your port is not still opened by another process you were debugging or whatever. There's nothing wrong simulating data from a file instead, just ensure that you don't now have 2 routes trying to own that port. PS if you want to listen you don't need your IP, you can use 0.0.0.0 as Willem said. Taariq On 11 Aug 2011, at 11:11 PM, Tereza Nedelescu tnedele...@tagged.com wrote: Hi, The code below camel:route camel:from uri=file:/path/src/data/input/inDir?noop=true / camel:to uri=netty:tcp://999.999.99.99:8985/ /camel:route camel:route camel:from uri=netty:tcp://999.999.99.99:8985 / camel:pipeline bean ref=customProcessor/ camel:to uri=file:/path/src/data/output/Pipeline / /camel:pipeline /camel:route gives the following error: SEVERE: Context initialization failed org.apache.camel.RuntimeCamelException: org.jboss.netty.channel.ChannelException: Failed to bind to /999.999.99.99:8985 at ... (Note: 999.999.99.99 is not actually my ip address) I'm trying to simulate having input to the bean customProcessor coming from a socket. I cannot do that directly, so I send text from a file to a socket, and then I try to read from the same socket. Is there something wrong with this ? Thanks, Tereza -- View this message in context: http://camel.465427.n5.nabble.com/File-contents-socket-socket-pipeline-fails-tp4691086p4691086.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Special characters sent via Camel to ActiveMQ
You can use .convertBodyTo(String.class, utf-8) to convert the file content into a utf-8 format. from file convertBodyTo to activemq On Thu, Aug 11, 2011 at 3:54 PM, Viju vvbiju2...@gmail.com wrote: This is what Im trying to do with Camel and AMQ Read a file that has special characters ( for e.g. års test). Using Camel, I read the line in the file Sends the line as a text message into the AMQ queue. Using Camel, I dequeue the message. When I read the body of the message, å is converted to ? Can you please suggest what needs to be done so that messages are sent in UTF8 to AMQ from camel. -- View this message in context: http://camel.465427.n5.nabble.com/Special-characters-sent-via-Camel-to-ActiveMQ-tp4689608p4689608.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Time delay for routes.
Hi i have a created a simple route. i want that to happen in certain time delay. How to create delay in routes. Help me up. Regards Guru -- View this message in context: http://camel.465427.n5.nabble.com/Time-delay-for-routes-tp4692522p4692522.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Time delay for routes.
Hi You're looking for the delayer. [1] [1] http://camel.apache.org/delayer.html Taariq On 12 Aug 2011, at 10:42 AM, Gnanaguru S gnanaguru.sattanat...@wipro.com wrote: Hi i have a created a simple route. i want that to happen in certain time delay. How to create delay in routes. Help me up. Regards Guru -- View this message in context: http://camel.465427.n5.nabble.com/Time-delay-for-routes-tp4692522p4692522.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: NotifyBuilder condition fails to match on an out/activemq endpoint
Hi, The suggestion is nod valid in java DSL, ie: NotifyBuilder notify = new NotifyBuilder(context) .whenDone(NUMBER_OF_GOOD_TRADES).to({{url.radial-trades}}).create(); Did you mean this is something that could be added camel? or is available in later version of camel? We're on 2.8.0 Thanks -- View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692582.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: NotifyBuilder condition fails to match on an out/activemq endpoint
On Fri, Aug 12, 2011 at 11:09 AM, jason.parr jason.p...@usa.net wrote: Hi, The suggestion is nod valid in java DSL, ie: NotifyBuilder notify = new NotifyBuilder(context) .whenDone(NUMBER_OF_GOOD_TRADES).to({{url.radial-trades}}).create(); Did you mean this is something that could be added camel? or is available in later version of camel? We're on 2.8.0 Yeah it was an idea for a improvement in Camel 2.9. Just wanted to play a bit with the API to make sure we understand your use-case and that the API seems right and understandable what it does. Feedback and suggestions welcome. Maybe instead of .to we need a more expressive name .wasSentTo .hasBeenSentTo .sentTo .sentToEndpoint ??? Thanks -- View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692582.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: NotifyBuilder condition fails to match on an out/activemq endpoint
What I'm trying to do is use my 'production' route unchanged within the test - or as close as possible. My application has a couple of input jms queues and two output queues, one for successful messages the other is an error queue. I send messages via jms into the route from pre-recorded messages stored in files and accessed by the file component. I want to run my test and check that the output queues have exactly the correct amount of messages on them that I expected. I could change the 'out' jms queue endpoints to be mocks but I'd rather they really are jms endpoints configured to use an embedded activemq broker, as this is as close to real deployment as possible. So something like: whenExactlyDone(5).wereSentTo(jms:good-msgs) .and() whenExactlyDone(1).wereSentTo(jms:bad-msgs).create(); -- View this message in context: http://camel.465427.n5.nabble.com/NotifyBuilder-condition-fails-to-match-on-an-out-activemq-endpoint-tp4689038p4692881.html Sent from the Camel - Users mailing list archive at Nabble.com.
XMPP receiver throws SASL authentication failed exception
Hi there, I'm completely new to Camel and am currently trying to get a basic Google Talk XMPP receiver to run that simply writes the received message to the log. I'm using Camel within ServiceMix and wrote this snippet: from(xmpp://receiving_u...@googlemail.com/sending_u...@googlemail.com?password=secret) .to(log:mytestlog); As soon as I try to deploy this route, I'm getting plenty of exceptions that run down to: org.apache.camel.RuntimeCamelException: SASL authentication failed using mechanism PLAIN What am I doing wrong? Regards, Stefan
Re: XMPP receiver throws SASL authentication failed exception
On 08/12/2011 02:41 PM, Stefan Essl wrote: Hi there, I'm completely new to Camel and am currently trying to get a basic Google Talk XMPP receiver to run that simply writes the received message to the log. I'm using Camel within ServiceMix and wrote this snippet: from(xmpp://receiving_u...@googlemail.com/sending_u...@googlemail.com?password=secret) .to(log:mytestlog); As soon as I try to deploy this route, I'm getting plenty of exceptions that run down to: org.apache.camel.RuntimeCamelException: SASL authentication failed using mechanism PLAIN What am I doing wrong? Google doesn't support SASL. Also see this from the Camel XMPP page: When connecting to the Google Chat service, you'll need to specify the serviceName as well as your credentials (as of *Camel 1.6/2.0*): // send a message from fromu...@gmail.com to tou...@gmail.com from(direct:start). to(xmpp://talk.google.com:5222/tou...@gmail.com?serviceName=gmail.comuser=fromuserpassword=secret). to(mock:result); T Regards, Stefan -- Regards / Med vennlig hilsen Tarjei Huse Mobil: 920 63 413
netty component: How can I make Netty listen to all the hosts ?
Hi, I'm trying to bind netty to all the hosts. How can I do that ? Using the netcat format, I see TCP *:port#. I tried using the same format in Camel, but it didn't work. See below: camel:route camel:from uri=netty:tcp://*:8983/ camel:to uri=stream:out / /camel:route Error: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: port out of range: -1 Thanks, Tereza -- View this message in context: http://camel.465427.n5.nabble.com/netty-component-How-can-I-make-Netty-listen-to-all-the-hosts-tp4691636p4691636.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel-freemarker
Hi Maximilien, camel-freemaker's pom.xml seems to be the only one which was missed while the commons-logging = slf4j migration went live by camel 2.7.x, see [1] for the details. Nevertheless the code of this component does effectively logging through slf4j-API (see the code at [2]), so that you should be able to force this component to log to your prefered logging API, i.e. JDK-Logging. By all other components is dependency to log4j is of the scope test which doesn't effect camel users like you me in any way. On the other hand what I DO NOT understand in most of the poms is the dependency declared to be like this: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId scopetest/scope /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId scopetest/scope /dependency which to my understanding is obsolete, as slf4j-log4j12 has already a dependency to log4j, namely to the RIGHT version it requires. So I would say one should remove ALL those DIRECT dependencies to log4j in all poms. The overhead by this today is that if someday camel upgrades to slf4j-log4j12 version x+1 the log4j should also be upgraded, namely to the version matching exactly to slf4j-log4j12 version x+1. Currently camel depends on: slf4j === 1.6.1 slf4j-log4j12 === same as slf4j, which makes sense log4j === 1.2.16 And when one looks at [3] he sees that the log4j dependency would already be given for FREE with the RIGHT version matching to slf4j-log4j12. But maybe I'm missing something... Regards, Babak [1] https://issues.apache.org/jira/browse/CAMEL-2229 [2] https://svn.apache.org/repos/asf/camel/trunk/components/camel-freemarker/src/main/java/org/apache/camel/component/freemarker/ [3] http://repo1.maven.org/maven2/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.pom -- View this message in context: http://camel.465427.n5.nabble.com/Camel-freemarker-tp4693216p4693550.html Sent from the Camel - Users mailing list archive at Nabble.com.
From http4 via md5checksum to FTP: file cache or streaming ?
Hello, one of our routes pulls binary data from from a HTTP service using http4, and then uploads the binary to a remote FTP directory. It also uses temporary files on the local filesystem behind the scenes , which makes sense because the binary image data can grow up till 10MB. Now I want to add one extra step: MD5 checksum verification just after the download. Because of the size, I prefer not to load all the data into a byte array to calculate a simple checksum, and use a InputStream instead. At first sight this seems to work. In the debugger, I can see this input stream is a wrapper around the locally cached file, and at the end of the function I return the original input stream. This is how the route currently looks like: to uri=http4:/ / to uri=bean:md5sum / to uri=ftp://{{attachment.ftp.location}}/?username={{attachment.ftp.user}}amp;password={{attachment.ftp.password}}amp;binary=true/ The processing bean method's signature: InputStream process(InputStream buffer, @Header(mgws_file_md5sum) String expectedChecksum) But now the route seems to hang. I assume returning the used input stream is wrong, since the FTP component can't do anything useful with this anymore. I basically see options to fix this: 1 - use fancy stream interception with a custom HttpBinder for http4, integrating MD5 checksum calculation on the fly 2 - redirect to temporary file explicitly, start a new route for the checksum, reuse same file for FTP upload and cleanup manually Any other recommendations? I think this is a quite common use case, so I guess more experienced Camel user may want to give some useful advice to a novice like me .. Some pages I have been looking at: http://camel.apache.org/http4.html http://camel.apache.org/file2.html http://camel.apache.org/stream-caching.html (using Camel 2.6) Thanks! Tung
Re: From http4 via md5checksum to FTP: file cache or streaming ?
I would make your md5bean return a file. Not sure if the current Jira issue of not cleaning (deleting) the file until JVM stops will apply for you then or not. Don't have the link to it right now. -- Magnus Palmér +46 736 845680 12 aug 2011 kl. 16:51 skrev wing-tung Leung wingtung.le...@gmail.com: Hello, one of our routes pulls binary data from from a HTTP service using http4, and then uploads the binary to a remote FTP directory. It also uses temporary files on the local filesystem behind the scenes , which makes sense because the binary image data can grow up till 10MB. Now I want to add one extra step: MD5 checksum verification just after the download. Because of the size, I prefer not to load all the data into a byte array to calculate a simple checksum, and use a InputStream instead. At first sight this seems to work. In the debugger, I can see this input stream is a wrapper around the locally cached file, and at the end of the function I return the original input stream. This is how the route currently looks like: to uri=http4:/ / to uri=bean:md5sum / to uri=ftp://{{attachment.ftp.location}}/?username={{attachment.ftp.user}}amp;password={{attachment.ftp.password}}amp;binary=true/ The processing bean method's signature: InputStream process(InputStream buffer, @Header(mgws_file_md5sum) String expectedChecksum) But now the route seems to hang. I assume returning the used input stream is wrong, since the FTP component can't do anything useful with this anymore. I basically see options to fix this: 1 - use fancy stream interception with a custom HttpBinder for http4, integrating MD5 checksum calculation on the fly 2 - redirect to temporary file explicitly, start a new route for the checksum, reuse same file for FTP upload and cleanup manually Any other recommendations? I think this is a quite common use case, so I guess more experienced Camel user may want to give some useful advice to a novice like me .. Some pages I have been looking at: http://camel.apache.org/http4.html http://camel.apache.org/file2.html http://camel.apache.org/stream-caching.html (using Camel 2.6) Thanks! Tung
Re: Split large file into small files
Hi Claus, one more quwstion here. I am splitting my messages using custom iterator. But, I am seeing once the route is finished (i.e. when a file routed to destination), messages are getting overwrited in it. Say, my starting message will be A,B,C. I split them into some chunks say A , B and C. But when the route is finished, I am seeing only C in the file. My route is something like below. from(src).split().method(splitbean which returns an custom Iterator).streaming().to(dest); When I debug my code, I could see that the default aggreagtion (inside camel) is not able to get the old exchage data. (I am not sure about this). Could you please tell me where it might have went wrong. -- View this message in context: http://camel.465427.n5.nabble.com/Split-large-file-into-small-files-tp4678470p4693727.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Split large file into small files
On Fri, Aug 12, 2011 at 5:37 PM, jeevan.koteshwara jeevan.koteshw...@gmail.com wrote: Hi Claus, one more quwstion here. I am splitting my messages using custom iterator. But, I am seeing once the route is finished (i.e. when a file routed to destination), messages are getting overwrited in it. Say, my starting message will be A,B,C. I split them into some chunks say A , B and C. But when the route is finished, I am seeing only C in the file. My route is something like below. from(src).split().method(splitbean which returns an custom Iterator).streaming().to(dest); When I debug my code, I could see that the default aggreagtion (inside camel) is not able to get the old exchage data. (I am not sure about this). Could you please tell me where it might have went wrong. Are you writing to the same file name. Then take a look at the fileExist option on the file component http://camel.apache.org/file2 It will by default override. Maybe you want to Append instead? -- View this message in context: http://camel.465427.n5.nabble.com/Split-large-file-into-small-files-tp4678470p4693727.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: Split large file into small files
Hi, After splitting the messages, I am transforming them into different format and sending them to a single file. So, right now, after transforming, data is not sppending to the destination file (instead its over writing). You suggested to append them. As I am using a custom iterator and my bean returns this custom iterator object, how can I append them to the destination. I am not very certain how to append the messages. Please suggest on this. -- View this message in context: http://camel.465427.n5.nabble.com/Split-large-file-into-small-files-tp4678470p4693912.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Split large file into small files
On Fri, Aug 12, 2011 at 6:26 PM, jeevan.koteshwara jeevan.koteshw...@gmail.com wrote: Hi, After splitting the messages, I am transforming them into different format and sending them to a single file. So, right now, after transforming, data is not sppending to the destination file (instead its over writing). You suggested to append them. As I am using a custom iterator and my bean returns this custom iterator object, how can I append them to the destination. I am not very certain how to append the messages. Its the option on the file endpoint .to(file:xxx?fileExist=Append); Please suggest on this. -- View this message in context: http://camel.465427.n5.nabble.com/Split-large-file-into-small-files-tp4678470p4693912.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: Split large file into small files
Hi Claus, are you suggesting something like below.. from(src).split().method(splitbean which returns an custom Iterator).streaming().to(file:...?fileExist=Append); Is that the correct approach? -- View this message in context: http://camel.465427.n5.nabble.com/Split-large-file-into-small-files-tp4678470p4693936.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel/ JMS/ Jboss 4.2.2
Hi, you should use property name=jndiName value/ConnectionFactory/value /property instead of property name=jndiName valuejava:QueueConnectionFactory/value /property java: namespace is not usable outside of the server jvm ... Using this , i can connect to my jboss 4.2.3 box... also you have to put jbossall-client.jar in your classpath . Regards Greg -- View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-Jboss-4-2-2-tp4568064p4694064.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Split large file into small files
On Fri, Aug 12, 2011 at 6:48 PM, jeevan.koteshwara jeevan.koteshw...@gmail.com wrote: Sorry, I didnt see your reply... Thanks. Its appending the messages to the file now. Is there any ways to append the messages first and then write to the destination (I mean without using fileExist=Append, somewhere after the completion of split process)?? Its best to append to a file as you wont have to keep all data in memory. However you can provide a custom AggregationStrategy to the Splitter EIP where you can append the message how you like it, and then afterwords send it to the file. See example on wiki pages http://camel.apache.org/splitter If you got the Camel book then chapter 8 covers this in better detail. Thanks, Jeevan. -- View this message in context: http://camel.465427.n5.nabble.com/Split-large-file-into-small-files-tp4678470p4693983.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: Split large file into small files
Hello Jeevan! Sorry for answering so late... If your input file is line oriented (CSV or fixed length), you do not have to implement your own splitter. from(file://foo.txt).split(body().tokenize(\n)).streaming().to(...); or from(file://foo.csv).split(body().tokenize(,)).streaming().to(...); should meet your requirements (or I miss something). Best, Christian
Sending Nagios Passive Checks from Spring - HowTo ?
Hi, I tried sending Nagios passive checks from Spring using the following code, and Nagios didn't receive them: camel:route camel:from uri=file:/path/input/Nagios?noop=true / camel:to uri=nagios://nagHost:5667?password=secret / /camel:route Then I looked up on the Camel website and I found this: In Spring XML it's just a matter of defining a Spring bean with the type EventNotifier and Camel will pick it up as documented here: EventNotifier0..nCamel 2.2: To use 3rd part event notifiers. I'm sorry, that is not quite clear to me (What does it mean by 3rd part ?). Could you provide me with an example, as in, what should I add to my Spring code to get the message sent properly to Nagios ? Thanks, Tereza -- View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4694564.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Splitter with Xpath recognizes namespace, but returns null
Did you had already a look on [1]? May one of the other possibilities works for you: - declaring the namespace on the camel context element (instead of the beans element) - specifying the xPath result type [1] http://camel.apache.org/xpath.html Best, Christian
Re: Camel-freemarker
Hello Babak! I think you are right. If we define the test dependency slf4j-log4j12, we do not have to declare the dependency to log4j (because it's a transitive dependency from slf4j-log4j12). Could you please open a JIRA for it? Do you consider to provide a patch for it? For camel-freemarker, do you know whether Freemarker use log4j as default logging engine so that we have to set this dependency explicitly? If not, I think we should change this as well. Best, Christian
Consistenty Hashing Support
Hai I am trying to get some inputs on how best to implement the following: - Let us say we have a service that is implemented by a set of servers. The service basically provides leaderboard. They expose SOAP interface. - Request for a particular leaderboard should ALWAYS go to the same server. If there was a failure in reaching that server, it can be sent to another server and subsequent requests for the leaderboard need to go the new server Kind of sticky loadblancing with a failover capabilities. In otherwords, given a set of servers and a key, i need a consistent hashing implemented to talk to a set of servers. 1. Should i just do all of this logic myself? or 2. Are there classes that i can take as a base and extend to support my use-case? Any pointers/inputs greatly appreciated. Anu -- View this message in context: http://camel.465427.n5.nabble.com/Consistenty-Hashing-Support-tp4694747p4694747.html Sent from the Camel - Users mailing list archive at Nabble.com.