Re: JBoss 5.1.0 - 6.0.0.Final (Camel Issues)

2011-03-31 Thread davsclaus
We love contributions so I suggest that you take a look and try to add
support for JBoss 6 in the camel-jboss project at camel-extra. 

You can see about contributing here
http://camel.apache.org/contributing.html

-
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
--
View this message in context: 
http://camel.465427.n5.nabble.com/JBoss-5-1-0-6-0-0-Final-Camel-Issues-tp3353086p4272909.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-cxf karaf 2.2.0 failure

2011-03-31 Thread davsclaus
Its a bit painful to get CXF running in Karaf as you need to mess with the
jre.properties to get it working. Its often easiest to copy the
jre.properties from Apache ServiceMix project and use that.

This is shown how to do in chapter 13 in the Camel in Action book.

-
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cxf-karaf-2-2-0-failure-tp4272129p4272910.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Throw exception from subroute to the parent route

2011-03-31 Thread Claus Ibsen
Yes you would need to disable error handling on that sub route.

On Wed, Mar 30, 2011 at 4:03 PM, Charles Moulliard cmoulli...@gmail.com wrote:
 Hi,

 To be able to process in a camel parent route an exception throwed in
 a sub route, a noErrorHandler must be defined in the subroute. Is
 there an alternative for doing that without defining a NoErrorHandler
 into the second camel route ?


       public void configure() throws Exception {

               from(direct:start) // route parent

 .onException(IllegalArgumentException.class).continued(true).logContinued(true).end()
                    .to(mock:start)
                    .to(direct:b)
                    .to(direct:c)
                    .to(mock:result);

                from(direct:b) // sub route
                    .errorHandler(noErrorHandler())
                    .to(mock:b)
                    .throwException(new IllegalArgumentException(Forced));

                from(direct:c)
                    .to(mock:c);

 Regards,

 Charles Moulliard

 Sr. Principal Solution Architect - FuseSource
 Apache Committer

 Blog : http://cmoulliard.blogspot.com
 Twitter : http://twitter.com/cmoulliard
 Linkedin : http://www.linkedin.com/in/charlesmoulliard
 Skype: cmoulliard




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


Re: SendProcessor has not been started - While using Exception policies

2011-03-31 Thread davsclaus
What version of Camel are you using? And can you post your full route? And
have you tried upgrading to a newer release?

-
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
--
View this message in context: 
http://camel.465427.n5.nabble.com/SendProcessor-has-not-been-started-While-using-Exception-policies-tp4267238p4272917.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: InOut over JMS always leads to Timout (ExchangeTimedOutException)

2011-03-31 Thread Claus Ibsen
If the processing of the messages is very slow then you can set a
higher value for the timeout (20 sec by default)

Its the requestTimeout option
http://camel.apache.org/jms

On Wed, Mar 30, 2011 at 11:56 PM, Mike L. patzer...@hotmail.com wrote:
 Attachment #1 (ActiveMQ_DLQ_Msg.png) shows a sample of such a message.

 Hopefully, the attachment stays attached this time... (or I give up)






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


Re: Asynchronous Remoting with Futures

2011-03-31 Thread davsclaus
This has been implemented in Camel 2.8. You can now use Future in your client
interfaces, and the invocation will now be asynchronous.

And there is a little example here
https://cwiki.apache.org/confluence/display/CAMEL/Using+CamelProxy

-
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
--
View this message in context: 
http://camel.465427.n5.nabble.com/Asynchronous-Remoting-with-Futures-tp3606370p4273033.html
Sent from the Camel - Users mailing list archive at Nabble.com.


multiple databases used in mybatis or ibatis in one route

2011-03-31 Thread Michael Dewitte
Hi,

I finally succeeded using MyBatis in a route with camel 2.7.0 deployed on
Karaf (servicemix in fact).
But what I'd like now is to be able to use 2 different databases in the same
route.
I know that I can define different databases in MyBatis, but is it possible
to configure two instances of the MyBatis component for Camel in the same
route, each one pointing to a different database ?
Or maybe is there another way to use the 2 databases in the same route ? or
use subroutes ?

Thanks for your help,

Mike


Re: multiple databases used in mybatis or ibatis in one route

2011-03-31 Thread Claus Ibsen
Hi

Yeah you should be able to declare a 2nd mybatis component and
configure it to use a different mybatis configuration file.

bean id=mybatis2 class=...MyBatisComponent
   !-- configure a property with the configuration file to use --
/bean



On Thu, Mar 31, 2011 at 1:39 PM, Michael Dewitte
michael.dewi...@gmail.com wrote:
 Hi,

 I finally succeeded using MyBatis in a route with camel 2.7.0 deployed on
 Karaf (servicemix in fact).
 But what I'd like now is to be able to use 2 different databases in the same
 route.
 I know that I can define different databases in MyBatis, but is it possible
 to configure two instances of the MyBatis component for Camel in the same
 route, each one pointing to a different database ?
 Or maybe is there another way to use the 2 databases in the same route ? or
 use subroutes ?

 Thanks for your help,

 Mike




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


Asynchronous architecture

2011-03-31 Thread James Talbut
Folks,

Another question along similar lines to the System architecture thread.

I need to provide an asynchronous web service that will accept calls
from a client, persist them somewhere, then asynchronously try to call
a corresponding web service implemented by a third party.
If the call succeeds my service should notify the client (via another
web service, probably most REST-like than SOAP-like).
If the call fails I should keep trying periodically for 24 hours.

The two primary requirements are:
1. The initial call from the client should be quick (so don't try
calling the third party straight away).
2. It must be impossible to lose a message or send it to the third
party twice (hence it needs to persist the message somehow before
returning).

I don't know ActiveMQ (but happy to learn) and the third party won't
provide anything more than a simple web service interface (so they
won't hook into an ActiveMQ that we implement).

I'd like to be able to reuse the infrastructure so providing the same
functionality across different web services is trivial.
i.e. I'd like the thing that picks up failed messages to work for any
web service (requiring nothing more than the spring definition).

Is ActiveMQ the right tool for looking after persisting the messages
and making them available?
Should I just write my own component to persist (and recover) a
complete Camel Exchange?
Or is there something else out there that will do what I want?

Any pointers gratefully received.

Thanks

Jim



Re: Asynchronous architecture

2011-03-31 Thread John McDonald
I have seen this kind of operation in place before - SMS providers for example 
for event driven stuff across the solution boundaries using basically a 
callback implementation

I would 
* expose an http interface to my solution.  I think it would be RESTian for the 
usual reasons
* I would use some message broking in the middle because it guarantees the 
sequence, deliver once, dont lose thing.  ActiveMq seems pretty good - I am no 
expert though
* For the feedback leg to the client you could
 ** ask them to register an optional http endpoint that you could signal
 ** let them come and get it from you - e.g. you expose an rss feed 
personalised to that client

I think its a fairly standard way of exposing an inherently async service in a 
sync manner

On 31 Mar 2011, at 14:41, James Talbut wrote:

 Folks,
 
 Another question along similar lines to the System architecture thread.
 
 I need to provide an asynchronous web service that will accept calls
 from a client, persist them somewhere, then asynchronously try to call
 a corresponding web service implemented by a third party.
 If the call succeeds my service should notify the client (via another
 web service, probably most REST-like than SOAP-like).
 If the call fails I should keep trying periodically for 24 hours.
 
 The two primary requirements are:
 1. The initial call from the client should be quick (so don't try
 calling the third party straight away).
 2. It must be impossible to lose a message or send it to the third
 party twice (hence it needs to persist the message somehow before
 returning).
 
 I don't know ActiveMQ (but happy to learn) and the third party won't
 provide anything more than a simple web service interface (so they
 won't hook into an ActiveMQ that we implement).
 *
 I'd like to be able to reuse the infrastructure so providing the same
 functionality across different web services is trivial.
 i.e. I'd like the thing that picks up failed messages to work for any
 web service (requiring nothing more than the spring definition).
 
 Is ActiveMQ the right tool for looking after persisting the messages
 and making them available?
 Should I just write my own component to persist (and recover) a
 complete Camel Exchange?
 Or is there something else out there that will do what I want?
 
 Any pointers gratefully received.
 
 Thanks
 
 Jim
 



Re: Asynchronous architecture

2011-03-31 Thread Hadrian Zbarcea
Hi James,

Camel can help you with that. Looks like you got it covered. For persistence 
you have a few choices, camel-jms, camel-jpa, camel-sql, depending on your 
message. But ActiveMQ is probably your best bet. It also scales very well  (you 
can also cluster it) and is relatively easy to configure. 

1. How quick it is, depends on the size of the message. For best results you 
can use an embedded broker, in the same container you use for your camel 
routes. I personally prefer OSGi/Karaf, but app servers and other deployment 
models work as well. 
2. For not sending it twice, camel supports an idempotent consumer [1].

There is no need to write your own persistence mechanism.

I hope this helps,
Hadrian

[1] http://camel.apache.org/idempotent-consumer.html


On Mar 31, 2011, at 9:41 AM, James Talbut wrote:

 Folks,
 
 Another question along similar lines to the System architecture thread.
 
 I need to provide an asynchronous web service that will accept calls
 from a client, persist them somewhere, then asynchronously try to call
 a corresponding web service implemented by a third party.
 If the call succeeds my service should notify the client (via another
 web service, probably most REST-like than SOAP-like).
 If the call fails I should keep trying periodically for 24 hours.
 
 The two primary requirements are:
 1. The initial call from the client should be quick (so don't try
 calling the third party straight away).
 2. It must be impossible to lose a message or send it to the third
 party twice (hence it needs to persist the message somehow before
 returning).
 
 I don't know ActiveMQ (but happy to learn) and the third party won't
 provide anything more than a simple web service interface (so they
 won't hook into an ActiveMQ that we implement).
 
 I'd like to be able to reuse the infrastructure so providing the same
 functionality across different web services is trivial.
 i.e. I'd like the thing that picks up failed messages to work for any
 web service (requiring nothing more than the spring definition).
 
 Is ActiveMQ the right tool for looking after persisting the messages
 and making them available?
 Should I just write my own component to persist (and recover) a
 complete Camel Exchange?
 Or is there something else out there that will do what I want?
 
 Any pointers gratefully received.
 
 Thanks
 
 Jim
 



polling database

2011-03-31 Thread Mark Webb
I want to create a route that will query a database for new rows
periodically.  If a new row is found I would like to put the
information from that row into the route for processing.  I have been
looking at the timer and quartz components and can't seem to get
either one to fit quite right with me requirement.

Is there another Camel component that will do this?  I have looked
through the Camel book and found ScheduledPollConsumer, but that just
looks like I would need to add in my own sleep.

I tried looking at the unit tests in
/camel/trunk/camel-camel/trunk/camel-core/src/test/java/org/apache/camel/component/timer
and could not find anything that fits either.

Any other suggestions?

Thanks,
Mark


Re: polling database

2011-03-31 Thread Christian Müller
Hello Mark!

Sample taken from the camel-jdbc wiki page [1]:

from(timer://foo?period=6).setBody(constant(select * from
customer)).to(jdbc:testdb).to(activemq:queue:customers);


[1] http://camel.apache.org/jdbc.html

Cheers,
Christian


Re: multiple databases used in mybatis or ibatis in one route

2011-03-31 Thread Richard Kettelerij
To use this component in your route use:

   from(mybatis2:selectFoo).to(...);


--
View this message in context: 
http://camel.465427.n5.nabble.com/multiple-databases-used-in-mybatis-or-ibatis-in-one-route-tp4273206p4274145.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: multiple databases used in mybatis or ibatis in one route

2011-03-31 Thread Michael Dewitte
Thnaks to you, Claus and Richard for this fast and extensive help ! I'll
give it a try today !

Thx,

Mike



2011/3/31 Richard Kettelerij richardkettele...@gmail.com

 To use this component in your route use:

   from(mybatis2:selectFoo).to(...);


 --
 View this message in context:
 http://camel.465427.n5.nabble.com/multiple-databases-used-in-mybatis-or-ibatis-in-one-route-tp4273206p4274145.html
 Sent from the Camel - Users mailing list archive at Nabble.com.