Re: Why is this not possible with the twitter component in Camel 2.10 ?

2012-06-18 Thread Bruno Borges
Soumya, please take a look at this new improvement here:

https://github.com/brunoborges/camel-twitter

I've forked 2.10-SNAPSHOT and added support for producing queries on the
fly like you asked. :-)




*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Fri, Jun 1, 2012 at 2:25 PM, soumya_sd soumya...@yahoo.com wrote:

 I'm trying to use Camel twitter component.
 http://camel.apache.org/twitter.html

 I want to create a route like -

from(direct:twitter-search).to(


 twitter://search?type=pollingdelay=20keywords=mykeywordsconsumerKey=keyconsumerSecret=secretaccessToken=xxxaccessTokenSecret=secret)
.to(stream:out);




 However, looks like this is not supported (see exception below). Can
 someone
 explain why?


 *org.apache.camel.FailedToCreateProducerException: Failed to create
 Producer
 for endpoint:

 Endpoint[twitter://search?...delay=20keywords=mykeywordtype=polling].
 Reason: java.lang.IllegalArgumentException: Cannot create any producer with
 uri

 twitter://search?accessToken=.delay=20keywords=mykeywordtype=polling.
 A producer type was not provided (or an incorrect pairing was used).*

 Given that twitter component internally makes use of HTTP REST calls it
 should be possible to use it both as a consumer as well as a producer.

 For example, I can successfully execute the following route with the http
 component.  I cannot understand why I cannot do the same with the twitter
 component ?

 from(direct:startgoogleplaces)
.process(new HTTPRequestParamProcessor())
.setHeader(
Exchange.HTTP_QUERY,


 simple(location=${in.headers.location}radius=${in.headers.radius}types=${in.headers.types}sensor=${in.headers.sensor}key=${in.headers.key}))
.to(
 https://maps.googleapis.com/maps/api/place/search/json;)
.unmarshal()
.json(JsonLibrary.Jackson,
 GooglePlaceResponseObject.class)
.log(before split the body is
 ${body}).to(stream:out);






 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Documentation for sftp incorrect or misleading?

2012-06-18 Thread Siano, Stephan
I am doing some experiments with the sftp connection of the camel ftp component 
(in Camel 2.9.2). I have found some unexpected behavior during these tests:

If the strictHostKeyChecking parameter is set to no (default) and the file 
exists and does not contain a host key for the host that is connected, a 
warning is logged and the key is written into the known hosts file (as defined 
in the knownHostsFile parameter). This is to be expected, however if there is 
already a key in the file (or the file exists) there is NO error or warning and 
the connection is successful, which is definitely not what I would expect.

If strictHostKeyChecking is set to yes or ask the connection fails, if the 
key is wrong was well as if the key is not in the file. (I haven't tried this 
with a non-existing file). I think the error is somewhere in the jsch coding 
(that does host checking at all only if the strictHostChecking parameter is set 
to yes or ask), however I think that  at least something about this should 
be mentioned in the ftp component documentation.

Stephan


RE: Documentation for sftp incorrect or misleading?

2012-06-18 Thread Siano, Stephan
Just some additional information:
I checked the jsch-users mailing list and found the following:
http://sourceforge.net/mailarchive/message.php?msg_id=28163308

So it looks that the behavior is not a bug but intended by the jsch developers 
(strictHostKeyChecking actually means no host key checking at all). I think 
that should definitely be mentioned in the documentation.

Stephan


-Original Message-
From: Siano, Stephan [mailto:stephan.si...@sap.com] 
Sent: Montag, 18. Juni 2012 13:54
To: users@camel.apache.org
Subject: Documentation for sftp incorrect or misleading?

I am doing some experiments with the sftp connection of the camel ftp component 
(in Camel 2.9.2). I have found some unexpected behavior during these tests:

If the strictHostKeyChecking parameter is set to no (default) and the file 
exists and does not contain a host key for the host that is connected, a 
warning is logged and the key is written into the known hosts file (as defined 
in the knownHostsFile parameter). This is to be expected, however if there is 
already a key in the file (or the file exists) there is NO error or warning and 
the connection is successful, which is definitely not what I would expect.

If strictHostKeyChecking is set to yes or ask the connection fails, if the 
key is wrong was well as if the key is not in the file. (I haven't tried this 
with a non-existing file). I think the error is somewhere in the jsch coding 
(that does host checking at all only if the strictHostChecking parameter is set 
to yes or ask), however I think that  at least something about this should 
be mentioned in the ftp component documentation.

Stephan


Re: Documentation for sftp incorrect or misleading?

2012-06-18 Thread Claus Ibsen
On Mon, Jun 18, 2012 at 2:19 PM, Siano, Stephan stephan.si...@sap.comwrote:

 Just some additional information:
 I checked the jsch-users mailing list and found the following:
 http://sourceforge.net/mailarchive/message.php?msg_id=28163308

 So it looks that the behavior is not a bug but intended by the jsch
 developers (strictHostKeyChecking actually means no host key checking at
 all). I think that should definitely be mentioned in the documentation.


Thanks for spotting.

If  you consider helping out with the docs, then read a bit here
http://camel.apache.org/contributing.html

To actually edit the docs yourself an ICLA need to be signed with Apache,
as saying here
http://camel.apache.org/how-do-i-edit-the-website.html

An alternative is to open a JIRA ticket and attach a .txt file or patch
etc. with [x] in grant license to ASF.
Then we can take that and fold it into the docs.

As we love contributions its great when the community can help maintain the
docs directly.




 Stephan


 -Original Message-
 From: Siano, Stephan [mailto:stephan.si...@sap.com]
 Sent: Montag, 18. Juni 2012 13:54
 To: users@camel.apache.org
 Subject: Documentation for sftp incorrect or misleading?

 I am doing some experiments with the sftp connection of the camel ftp
 component (in Camel 2.9.2). I have found some unexpected behavior during
 these tests:

 If the strictHostKeyChecking parameter is set to no (default) and the
 file exists and does not contain a host key for the host that is connected,
 a warning is logged and the key is written into the known hosts file (as
 defined in the knownHostsFile parameter). This is to be expected, however
 if there is already a key in the file (or the file exists) there is NO
 error or warning and the connection is successful, which is definitely not
 what I would expect.

 If strictHostKeyChecking is set to yes or ask the connection fails, if
 the key is wrong was well as if the key is not in the file. (I haven't
 tried this with a non-existing file). I think the error is somewhere in the
 jsch coding (that does host checking at all only if the strictHostChecking
 parameter is set to yes or ask), however I think that  at least
 something about this should be mentioned in the ftp component documentation.

 Stephan




-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: copy of Exchange during Multicast

2012-06-18 Thread Henryk Konsek
 Could Spring mess up things? Or am I missing out on something here? Is my
 config wrong?

Actually your example seems a little bit complicated for me. It's hard
for me to tell what's wrong there.

Could you describe me what is the purpose of your route? Maybe I could
suggest you then how would I achieve it.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Single request with multiple replies over TCP

2012-06-18 Thread Alexander Kaiser
Hi,

I am trying to connect to a server with mina. The server sends a hello
message on socket connect, then I send it a command and want to receive the
servers reply in the message body.

camel-mina connects server
  -- welcome message
command --
  -- reply

Basically I need to skip, or parse and skip the welcome message, and then
decode the reply.

With mina I can get only the servers welcome message. I read in a
threadhttp://camel.465427.n5.nabble.com/Single-request-with-multiple-replies-over-TCP-td5022206.htmlon
this subject that mina2 supports this kind of scenario, but I can't
find
any documentation on mina2.

Does mina2 indeed support this?

Many thanks,
Alexander


JSON To XML Converter

2012-06-18 Thread Sri
Hi All,

is there any JSON to XML converter in camel. As of now I couldn't find any
component in that. Please suggest me if there are any alternative ways.

Thanks in advance for your responses.

Regards
Srinivas

--
View this message in context: 
http://camel.465427.n5.nabble.com/JSON-To-XML-Converter-tp5714624.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JSON To XML Converter

2012-06-18 Thread Claus Ibsen
On Mon, Jun 18, 2012 at 3:52 PM, Sri sri.tec...@googlemail.com wrote:

 Hi All,

 is there any JSON to XML converter in camel. As of now I couldn't find any
 component in that. Please suggest me if there are any alternative ways.

 Thanks in advance for your responses.


Yes in Camel 2.10 there is this
http://camel.apache.org/xmljson.html

And there is a number of json / xml data formatters
http://camel.apache.org/data-format.html





 Regards
 Srinivas

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/JSON-To-XML-Converter-tp5714624.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.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: running ActiveMQ with camel from maven

2012-06-18 Thread Mark Webb
I don't want this to be a strictly in-JVM broker.  I would like to
allow external clients to connect to ActiveMQ.  Ideally I would like
maven to start ActiveMQ, with my camel routes defined and referenced
from an activemq.xml file.



On Sun, Jun 17, 2012 at 11:28 PM, boday ben.o...@initekconsulting.com wrote:
 don't use the m2-amq plugin, instead just configure your test AMQ broker URL
 to be vm://localhost (generally configured with a test context file,
 /src/test/resources/camel-context.xml, etc.) and an embedded broker will be
 started automatically.


 Mark Webb wrote

 I usually use the command mvn camel:run to execute my camel
 routes..etc in my development environment.  I have included ActiveMQ
 support for my camel routing and would like to start an ActiveMQ
 broker as part of my Camel routes when they start up.  Is there a way
 to do this from maven or should I just embed a broker in my main
 class?

 I ran across this link -
 http://activemq.apache.org/maven2-activemq-broker-plugin.html, but it
 seems quite dated.


 Thanks,
 Mark



 -
 Ben O'Day
 IT Consultant -http://consulting-notes.com

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/running-ActiveMQ-with-camel-from-maven-tp5714563p5714598.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ExchangePattern InOnly for JMS component

2012-06-18 Thread bjacob
I'm sorry for the late reply.

camel version: 2.4.0
JMS Provider: TIBCO EMS 6.1

--
View this message in context: 
http://camel.465427.n5.nabble.com/ExchangePattern-InOnly-for-JMS-component-tp5683515p5714631.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to set the LRU-Cache size?

2012-06-18 Thread stefzar
Hello,

in the Camel documentation it says: idempotent falseOption to use the
Idempotent Consumer EIP pattern to let Camel skip already processed files.
Will by default use a memory based LRUCache that holds 1000 entries. If
noop=true then idempotent will be enabled as well to avoid consuming the
same files over and over again. - http://camel.apache.org/file2.html

What's the easiest way of setting the LRUCache size above 1000 entries?

Thank you in advance.

--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-set-the-LRU-Cache-size-tp5714634.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Asynchronous behavior of SEDA queue?

2012-06-18 Thread csete
I'm struggling to understand SEDA queue behavior in terms of asynchronous
behavior.  My understanding from the documentation is that if
concurrentConsumers  1 it should spawn multiple threads to handle
requests.  However, it doesn't seem like this is currently working correctly
and I'm sure that I'm missing something stupid.  

I have a route that is configured to route
seda://request_handler_tmb?concurrentConsumers=10size=100timeout=6
to a handler bean.  There is a single instance of that bean (if that
matters).  My logging shows that while the thread that does the (InOut)
request handling changes from one request to the next, that there is only
one outstanding request at a time.  The request handling is currently wired
to our test harness which is intentionally delaying responses for 20
seconds... in which case, I would expect to see multiple threads
outstanding.

2012-06-18 13:44:58,070 DEBUG [ProcessorBean] (Camel
(context_request_handler) thread #56 - seda://request_handler_tmb)
Processing request for exchange: ID-seteramac-56604-1340045015657-5-68
2012-06-18 13:44:58,127 DEBUG [ProcessorBean] (Camel
(context_request_handler) thread #56 - seda://request_handler_tmb)
Successfully processed request for exchange:
ID-seteramac-56604-1340045015657-5-68
2012-06-18 13:45:01,295 DEBUG [ProcessorBean] (Camel
(context_request_handler) thread #53 - seda://request_handler_tmb)
Processing request for exchange: ID-seteramac-56604-1340045015657-5-74
2012-06-18 13:45:01,340 DEBUG [ProcessorBean] (Camel
(context_request_handler) thread #53 - seda://request_handler_tmb)
Successfully processed request for exchange:
ID-seteramac-56604-1340045015657-5-74

Can anyone point me in the right direction on this?  I'm assuming this is
something that I'm doing wrong since I can see the executor service code in
the SEDA source code, but it is definitely not behaving as I would expect it
to behave.

Thanks,
Craig





--
View this message in context: 
http://camel.465427.n5.nabble.com/Asynchronous-behavior-of-SEDA-queue-tp5714635.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Pointers on setting up Camel on JBoss 5.1 using EJBs/Hibernate

2012-06-18 Thread vishal1981
Hi,
I want to setup Camel as part on of my application being deployed to JBoss
5.1. My application nests in a bigger ear (which is a company wide umbrella
application) and it contains several modules including 3 of mine - ejb jar,
servlets war and REST API war. There is also an interface jar in the lib
folder of the ear. We are not using Spring but EJB (hibernate and JPA).
This is my first time with Camel and wanted to make sure I got the
deployment right. I intend to use Camel to start and stop several routes
during runtime based on some user selections.
What is the recommended way of deploying Camel in this scenario? Should it
be part of the war or ejb jar?
I am using Camel 2.9.2 ..do I still need the special JBoss Camel component?
Thanks
V

--
View this message in context: 
http://camel.465427.n5.nabble.com/Pointers-on-setting-up-Camel-on-JBoss-5-1-using-EJBs-Hibernate-tp5714636.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Simple language question

2012-06-18 Thread Gershaw, Geoffrey
Hello all,

 

I am using the Spring DSL with the Filter EIP. The below snippet works,
but  its confusing. I am trying to include a msg with a non-null body
the outcome of bean:CXRefDataCache?method=put  equals false.

 

Is there a cleaner way?

 

filter

!-- Only process valid (non-null) SecDefs. cache CXRefdata. Return true
if its an update--

  simple${body} != null and false ==
${bean:CXRefDataCache?method=put}/simple



 

Thanks

 

Geoffrey A. Gershaw

 


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Re: How to set the LRU-Cache size?

2012-06-18 Thread Claus Ibsen
On Mon, Jun 18, 2012 at 7:42 PM, stefzar stef...@hotmail.com wrote:

 Hello,

 in the Camel documentation it says: idempotent falseOption to use the
 Idempotent Consumer EIP pattern to let Camel skip already processed files.
 Will by default use a memory based LRUCache that holds 1000 entries. If
 noop=true then idempotent will be enabled as well to avoid consuming the
 same files over and over again. - http://camel.apache.org/file2.html

 What's the easiest way of setting the LRUCache size above 1000 entries?


To set a custom idempotentRepository
And have that using a memory store, where you can configure the size.


Thank you in advance.

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/How-to-set-the-LRU-Cache-size-tp5714634.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.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Simple language question

2012-06-18 Thread Claus Ibsen
On Mon, Jun 18, 2012 at 11:49 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 Hello all,



 I am using the Spring DSL with the Filter EIP. The below snippet works,
 but  its confusing. I am trying to include a msg with a non-null body
 the outcome of bean:CXRefDataCache?method=put  equals false.



 Is there a cleaner way?



Why is that confusing? You have 2 predicates to test for. And that is what
you use in the simple expression.
You can put that logic behind a single bean method and give the method a
meaningful name

filter
  method ref=myBean method=someMeaningfulNameHere/
   ...
/filter

And there is many other scripting languages you can use, if you think they
can provide a less confusing way
http://camel.apache.org/languages


 filter

 !-- Only process valid (non-null) SecDefs. cache CXRefdata. Return true
 if its an update--

  simple${body} != null and false ==
 ${bean:CXRefDataCache?method=put}/simple

 



 Thanks



 Geoffrey A. Gershaw





 ===
 Please access the attached hyperlink for an important electronic
 communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html

 ===




-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: running ActiveMQ with camel from maven

2012-06-18 Thread Claus Ibsen
On Mon, Jun 18, 2012 at 5:01 PM, Mark Webb elihusma...@gmail.com wrote:

 I don't want this to be a strictly in-JVM broker.  I would like to
 allow external clients to connect to ActiveMQ.  Ideally I would like
 maven to start ActiveMQ, with my camel routes defined and referenced
 from an activemq.xml file.


You can start AMQ from a script it has in the bin. And it can take
parameters.
So you can start a process of that script and point to a broker XML file
that includes you Camel routes.

Starting AMQ from a script is the usual way, eg bin/activemq.
You may have to add some logic to avoid starting the broker, if its already
running etc.






 On Sun, Jun 17, 2012 at 11:28 PM, boday ben.o...@initekconsulting.com
 wrote:
  don't use the m2-amq plugin, instead just configure your test AMQ broker
 URL
  to be vm://localhost (generally configured with a test context file,
  /src/test/resources/camel-context.xml, etc.) and an embedded broker will
 be
  started automatically.
 
 
  Mark Webb wrote
 
  I usually use the command mvn camel:run to execute my camel
  routes..etc in my development environment.  I have included ActiveMQ
  support for my camel routing and would like to start an ActiveMQ
  broker as part of my Camel routes when they start up.  Is there a way
  to do this from maven or should I just embed a broker in my main
  class?
 
  I ran across this link -
  http://activemq.apache.org/maven2-activemq-broker-plugin.html, but it
  seems quite dated.
 
 
  Thanks,
  Mark
 
 
 
  -
  Ben O'Day
  IT Consultant -http://consulting-notes.com
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/running-ActiveMQ-with-camel-from-maven-tp5714563p5714598.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.com
Author of Camel in Action: http://www.manning.com/ibsen


How temporary are the temporary queues in Camel Request/Reply pattern?

2012-06-18 Thread ED M Barwani
Do Temporary Queues get deleted at all? Or are the destinations valid
while the route is running?

Suppose we have a simple route like so;
route
  from uri=timer:foo?period=5000/
  inOut uri=activemq:queue:Test.Queue/
/route

Suppose also, that the activemq endopoint times out. In other words,
the replier took longer than the timeout to reply.

Would you expect the replier to successfully place a message in the
temporary queue?

We found that the temporary destination stay alive and ignores
incoming messages with incorrect correlation ids. This may be a
desirable behaviour, however if the messages are critical dropping
them or ignoring them is perhaps not the best option. Our replier was
designed to fall back on a different queue if the temporary
destination was deleted.

What do my fellow camel users do in this scenario?


Re: Why is this not possible with the twitter component in Camel 2.10 ?

2012-06-18 Thread Bruno Borges
https://issues.apache.org/jira/browse/CAMEL-5374

THe patch has been submitted.

Thanks,
*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Mon, Jun 18, 2012 at 4:58 AM, Bruno Borges bruno.bor...@gmail.comwrote:

 Soumya, please take a look at this new improvement here:

 https://github.com/brunoborges/camel-twitter

 I've forked 2.10-SNAPSHOT and added support for producing queries on the
 fly like you asked. :-)




 *Bruno Borges*
 (21) 7672-7099
 *www.brunoborges.com*



 On Fri, Jun 1, 2012 at 2:25 PM, soumya_sd soumya...@yahoo.com wrote:

 I'm trying to use Camel twitter component.
 http://camel.apache.org/twitter.html

 I want to create a route like -

from(direct:twitter-search).to(


 twitter://search?type=pollingdelay=20keywords=mykeywordsconsumerKey=keyconsumerSecret=secretaccessToken=xxxaccessTokenSecret=secret)
.to(stream:out);




 However, looks like this is not supported (see exception below). Can
 someone
 explain why?


 *org.apache.camel.FailedToCreateProducerException: Failed to create
 Producer
 for endpoint:

 Endpoint[twitter://search?...delay=20keywords=mykeywordtype=polling].
 Reason: java.lang.IllegalArgumentException: Cannot create any producer
 with
 uri

 twitter://search?accessToken=.delay=20keywords=mykeywordtype=polling.
 A producer type was not provided (or an incorrect pairing was used).*

 Given that twitter component internally makes use of HTTP REST calls it
 should be possible to use it both as a consumer as well as a producer.

 For example, I can successfully execute the following route with the http
 component.  I cannot understand why I cannot do the same with the twitter
 component ?

 from(direct:startgoogleplaces)
.process(new HTTPRequestParamProcessor())
.setHeader(
Exchange.HTTP_QUERY,


 simple(location=${in.headers.location}radius=${in.headers.radius}types=${in.headers.types}sensor=${in.headers.sensor}key=${in.headers.key}))
.to(
 https://maps.googleapis.com/maps/api/place/search/json;)
.unmarshal()
.json(JsonLibrary.Jackson,
 GooglePlaceResponseObject.class)
.log(before split the body is
 ${body}).to(stream:out);






 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Why-is-this-not-possible-with-the-twitter-component-in-Camel-2-10-tp5713823.html
 Sent from the Camel - Users mailing list archive at Nabble.com.