Re: Consumers need to restart when ActivemQ restarts

2010-08-12 Thread Claus Ibsen
On Tue, Aug 10, 2010 at 3:21 PM, Sri sri.tec...@googlemail.com wrote:

 It works when I remove jms.prefetchPolicy.queuePrefetch=0 from the URI but
 not when I included
 --

And if you set the value to 1 instead of 0, just to see if this makes
a difference.


 View this message in context: 
 http://camel.465427.n5.nabble.com/camel-failover-and-prefetchPolicy-are-not-working-together-tp2428233p2431512.html
 Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Error Handling in Camel routes

2010-08-12 Thread somemightsay

I've been looking into this for quite a while but still haven't been able to
find a definitive answer.

How do you add error handling to a route such as the following:

from(inputdir)
.startupOrder(1)
.setBody(constant(query))
.to(jdbc:vprsitdb)
.marshal(csv)
.to(TargetDir);

Obviously you can't add normal throw/catch exceptions like you would with
normal java code. I would like to have error handling for the likes of the
database not being available (in that case retry connection 3 times etc),
the input file not being present etc.

Any help would be appreciated.


-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Error-Handling-in-Camel-routes-tp2472989p2472989.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Error Handling in Camel routes

2010-08-12 Thread Claus Ibsen
On Thu, Aug 12, 2010 at 10:33 AM, somemightsay euanbeg...@hotmail.com wrote:

 I've been looking into this for quite a while but still haven't been able to
 find a definitive answer.

 How do you add error handling to a route such as the following:

 from(inputdir)
 .startupOrder(1)
 .setBody(constant(query))
 .to(jdbc:vprsitdb)
 .marshal(csv)
 .to(TargetDir);

 Obviously you can't add normal throw/catch exceptions like you would with
 normal java code. I would like to have error handling for the likes of the
 database not being available (in that case retry connection 3 times etc),
 the input file not being present etc.

 Any help would be appreciated.


See this link
http://camel.apache.org/error-handling-in-camel.html

And if fell the online documentation is not sufficient then consider
the Camel in Action book.
The entire chapter 5 is devoted to error handling.


 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Error-Handling-in-Camel-routes-tp2472989p2472989.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Consumers need to restart when ActivemQ restarts

2010-08-12 Thread Sri

I have tried with setting jms.prefetchPolicy.queuePrefetch=1 but still there
is no difference. 
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/camel-failover-and-prefetchPolicy-are-not-working-together-tp2428233p2473072.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: content based routing based on header value

2010-08-12 Thread Mark Webb
I see that the latest MEAP of Camel In Action answers this question in
the first page of Appendix A.

On Tue, Aug 10, 2010 at 11:56 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 On Tue, Aug 10, 2010 at 5:42 PM, Mark Webb elihusma...@gmail.com wrote:
 I am setting up a route in XML and want to send messages to a
 destination based on a field in the header.  I have the following:

 log message=Analyzed [${body}] with destination -- ${header.dest}/
                choice
                        when
                                header'${header.dest}' = 'stuff'/header
                                to uri=jms:somewhere /
                        /when
                /choice

 As I test this the log gives me the correct information for
 ${header.dest} and that being stuff, but I do not know how to test
 the value in order to send the message to the proper location.  What
 is the proper syntax here?  I looked through the Camel in Action book
 and the camel website and cannot find anything.


 The header will only grab a header. It's not a scripting language to
 evaluate expressions/predicates etc.

 For that you can use any of the more powerful languages
 http://camel.apache.org/languages.html

 For example you can use the built in simple language
 http://camel.apache.org/simple.html

 Which is being explained in the appendix A of the Camel book (avail in
 next MEAP update).

 simple${header.dest} == 'stuff'/simple


 Thanks,
 Mark




 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus



Camel 2.4 - InterceptStrategy error

2010-08-12 Thread Charles Moulliard
Hi,

We get the following error when we try to use the following camel route +
test
Is it a bad configuration or a bug ?

1) Error

40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: route1
started and consuming from: Endpoint[direct://in-only]
40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: route2
started and consuming from: Endpoint[direct://start]
40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: route3
started and consuming from: Endpoint[direct://file]
40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Started 3
routes
40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel
2.4.0 (CamelContext: camel-1) started in 0.000 seconds
40781 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
opened
40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
Processing Exchange
40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
40797 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
opened
40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
ENDPOINT: direct
OrderFailedExeption: Cannot order: fail
40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
Processing Exchange
40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
40938 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
opened
40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
ENDPOINT: direct
Order ERROR
41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
Processing Exchange
41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
41000 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
opened
41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
ENDPOINT: direct
41047 [main] ERROR org.apache.camel.processor.DefaultErrorHandler - Failed
delivery for exchangeId: a23af01b-64a6-49c7-80c9-15177d945ee5. Exhausted
after delivery attempt
: 1 caught: java.lang.IllegalStateException: SendProcessor has not been
started: sendTo(Endpoint[mock://error])
java.lang.IllegalStateException: SendProcessor has not been started:
sendTo(Endpoint[mock://error])
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:94)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
at
org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:67)
at
org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:58)
at
org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:90)
at
org.fusesource.esb.audit.camel.AuditInterceptor.process(AuditInterceptor.java:78)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
at
org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:76)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
at
org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:582)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:236)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
at

Re: Camel 2.4 - InterceptStrategy error

2010-08-12 Thread Claus Ibsen
And it only occurs when you use the intercept strategy? If you remove
it, does it work then? Sending to the mock:error endpoint?


On Thu, Aug 12, 2010 at 12:50 PM, Charles Moulliard
cmoulli...@gmail.com wrote:
 Hi,

 We get the following error when we try to use the following camel route +
 test
 Is it a bad configuration or a bug ?

 1) Error

 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: route1
 started and consuming from: Endpoint[direct://in-only]
 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: route2
 started and consuming from: Endpoint[direct://start]
 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: route3
 started and consuming from: Endpoint[direct://file]
 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Started 3
 routes
 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel
 2.4.0 (CamelContext: camel-1) started in 0.000 seconds
 40781 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
 opened
 40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
 Processing Exchange
 40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
 path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
 40797 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
 opened
 40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
 ENDPOINT: direct
 OrderFailedExeption: Cannot order: fail
 40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
 Processing Exchange
 40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
 path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
 40938 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
 opened
 40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
 ENDPOINT: direct
 Order ERROR
 41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
 Processing Exchange
 41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
 path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
 41000 [main] INFO org.apache.jackrabbit.core.TransientRepository - Session
 opened
 41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
 ENDPOINT: direct
 41047 [main] ERROR org.apache.camel.processor.DefaultErrorHandler - Failed
 delivery for exchangeId: a23af01b-64a6-49c7-80c9-15177d945ee5. Exhausted
 after delivery attempt
 : 1 caught: java.lang.IllegalStateException: SendProcessor has not been
 started: sendTo(Endpoint[mock://error])
 java.lang.IllegalStateException: SendProcessor has not been started:
 sendTo(Endpoint[mock://error])
        at
 org.apache.camel.processor.SendProcessor.process(SendProcessor.java:94)
        at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
 org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
        at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
        at
 org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
        at
 org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:67)
        at
 org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:58)
        at
 org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:90)
        at
 org.fusesource.esb.audit.camel.AuditInterceptor.process(AuditInterceptor.java:78)
        at
 org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
        at
 org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:76)
        at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
 org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290)
        at
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
        at
 org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
        at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
        at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
 org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:582)
        at
 org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:236)
        at
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
        at
 org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
  

Re: Camel 2.4 - InterceptStrategy error

2010-08-12 Thread Claus Ibsen
On Thu, Aug 12, 2010 at 1:12 PM, Charles Moulliard cmoulli...@gmail.com wrote:
 It works fine if I remove the intercept strategy in the camel route

                // getContext().addInterceptStrategy(
                //        new AuditInterceptStrategy(getRepository()));

 Here is the trace about what the mock:error endpoint receive

 35531 [main] INFO org.apache.camel.component.mock.MockEndpoint - Asserting:
 Endpoint[mock://error] is satisfied
 PROPERTIES ERROR: {CamelToEndpoint=mock://error,
 CamelFailureEndpoint=direct://start,
 CamelExceptionCaught=org.fusesource.esb.audit.testsupport.MockOrderService$OrderFail
 edException: Cannot order: fail}



Thanks I have created a ticket to track this
https://issues.apache.org/activemq/browse/CAMEL-3049

-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Camel, OSGI and container wide Camel route lookups

2010-08-12 Thread Christian Mueller

Hello Ade, Ron and Claus!

Thanks for your responses. I assume that I can send/receive a message in SMX
using Camel in this way:

first OSGI bundle:
{code}
  from(direct:start)
  .to(nmr:orderEntryPreProcessor);
{code}

second OSGI bundle:
{code}
  from(nmr:orderEntryPreProcessor)
  .to(mock:end);
{code}

But how it is possible to discover routes, deployed in another OSGI bundle
to extend or modify a route dynamicly? I understood the following code
will not work, if the route nmr:orderEntryPreProcessor is defined in
another OSGI bundle:
{code}
  Endpoint endpoint =
exchange.getContext().hasEndpoint(nmr:orderEntryPreProcessor); 
{code}

Du you advice a solution like this:

first OSGI bundle:
{code}
  bean id=orderEntryPreProcessorRoute
class=com.company.OrderEntryPreProcessorRoute /

  osgi:service ref=orderEntryPreProcessorRoute
osgi:interfaces
  valueorg.apache.camel.RoutesBuilder/value
/osgi:interfaces
osgi:service-properties
  entry key=routeName value=orderEntryPreProcessorRoute /
/osgi:service-properties
  /osgi:service
{code}

and in the other bundle, I need a reference to the OSGI service registry and
lookup the exported route (by service property because we export multiple
routes).
I don't know whether this works and how I can inject the OSGI service
registry in a Spring managed bean. I assume, this is not the Spring
application context...

Thanks for your help,
Christian
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-OSGI-and-container-wide-Camel-route-lookups-tp2269094p2473177.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.4 - InterceptStrategy error

2010-08-12 Thread Claus Ibsen
Charles

can you attach / post your interceptor logic in the JIRA ticket?

If there is company sensitive information in it, then remove/change
the stuff. I just wanna see how you have created the interceptor
stuff.

On Thu, Aug 12, 2010 at 1:12 PM, Charles Moulliard cmoulli...@gmail.com wrote:
 It works fine if I remove the intercept strategy in the camel route

                // getContext().addInterceptStrategy(
                //        new AuditInterceptStrategy(getRepository()));

 Here is the trace about what the mock:error endpoint receive

 35531 [main] INFO org.apache.camel.component.mock.MockEndpoint - Asserting:
 Endpoint[mock://error] is satisfied
 PROPERTIES ERROR: {CamelToEndpoint=mock://error,
 CamelFailureEndpoint=direct://start,
 CamelExceptionCaught=org.fusesource.esb.audit.testsupport.MockOrderService$OrderFail
 edException: Cannot order: fail}


 On Thu, Aug 12, 2010 at 1:00 PM, Claus Ibsen claus.ib...@gmail.com wrote:

 And it only occurs when you use the intercept strategy? If you remove
 it, does it work then? Sending to the mock:error endpoint?


 On Thu, Aug 12, 2010 at 12:50 PM, Charles Moulliard
 cmoulli...@gmail.com wrote:
  Hi,
 
  We get the following error when we try to use the following camel route +
  test
  Is it a bad configuration or a bug ?
 
  1) Error
 
  40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route:
 route1
  started and consuming from: Endpoint[direct://in-only]
  40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route:
 route2
  started and consuming from: Endpoint[direct://start]
  40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route:
 route3
  started and consuming from: Endpoint[direct://file]
  40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Started 3
  routes
  40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache
 Camel
  2.4.0 (CamelContext: camel-1) started in 0.000 seconds
  40781 [main] INFO org.apache.jackrabbit.core.TransientRepository -
 Session
  opened
  40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
  Processing Exchange
  40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
  path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
  40797 [main] INFO org.apache.jackrabbit.core.TransientRepository -
 Session
  opened
  40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
  ENDPOINT: direct
  OrderFailedExeption: Cannot order: fail
  40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
  Processing Exchange
  40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
  path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
  40938 [main] INFO org.apache.jackrabbit.core.TransientRepository -
 Session
  opened
  40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
  ENDPOINT: direct
  Order ERROR
  41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
  Processing Exchange
  41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node
  path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5
  41000 [main] INFO org.apache.jackrabbit.core.TransientRepository -
 Session
  opened
  41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor -
  ENDPOINT: direct
  41047 [main] ERROR org.apache.camel.processor.DefaultErrorHandler -
 Failed
  delivery for exchangeId: a23af01b-64a6-49c7-80c9-15177d945ee5. Exhausted
  after delivery attempt
  : 1 caught: java.lang.IllegalStateException: SendProcessor has not been
  started: sendTo(Endpoint[mock://error])
  java.lang.IllegalStateException: SendProcessor has not been started:
  sendTo(Endpoint[mock://error])
         at
  org.apache.camel.processor.SendProcessor.process(SendProcessor.java:94)
         at
 
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
         at
 
 org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
         at
 
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
         at
 
 org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
         at
 
 org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:67)
         at
 
 org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:58)
         at
 
 org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:90)
         at
 
 org.fusesource.esb.audit.camel.AuditInterceptor.process(AuditInterceptor.java:78)
         at
 
 org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
         at
 
 org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:76)
         at
 
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
         

Re: request / response example

2010-08-12 Thread Mark Webb
OK, cool.  I got that to work.  Now what about the case in which I do
not want to set the JMSReplyTo header field?  How would that work?

Thanks for the help



On Wed, Aug 11, 2010 at 4:51 PM, Claus Ibsen claus.ib...@gmail.com wrote:
 If the JMS message has a JMSReplyTo header then the JMS consumer will
 use request/reply automatically.
 http://camel.apache.org/request-reply.html

 So you route should simply just be:

  route
         from uri=jms:queue.A /
         process ref=processor /
  /route

 So when the route ends, the consumer jms:queue.A will send the reply
 back the the queue defined in the JMSReplyTo header.


 On Wed, Aug 11, 2010 at 8:45 PM, Mark Webb elihusma...@gmail.com wrote:
 I am trying to figure out how to set up a request / response in Camel
 with ActiveMQ.  Basically this is what I am looking for:


 myapp - queue.A - processor(DB query) - queue.A - myapp


 I have read through the documentation and the closest I have come is
 the following sping-camel example:

 route
        from uri=jms:queue.A /
        process ref=processor /
        to uri=jms:queue.A pattern=InOut /
 /route

 This seems to work, but it doesn't seem right to me that I need a
 from and to.  Plus I get a
 org.apache.camel.ExchangeTimedOutException: exception on each message.


 Thanks for any help you have,
 Mark




 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus



Re: request / response example

2010-08-12 Thread Claus Ibsen
On Thu, Aug 12, 2010 at 4:33 PM, Mark Webb elihusma...@gmail.com wrote:
 OK, cool.  I got that to work.  Now what about the case in which I do
 not want to set the JMSReplyTo header field?  How would that work?


Thats the event message EIP pattern
http://camel.apache.org/event-message.html



 Thanks for the help



 On Wed, Aug 11, 2010 at 4:51 PM, Claus Ibsen claus.ib...@gmail.com wrote:
 If the JMS message has a JMSReplyTo header then the JMS consumer will
 use request/reply automatically.
 http://camel.apache.org/request-reply.html

 So you route should simply just be:

  route
         from uri=jms:queue.A /
         process ref=processor /
  /route

 So when the route ends, the consumer jms:queue.A will send the reply
 back the the queue defined in the JMSReplyTo header.


 On Wed, Aug 11, 2010 at 8:45 PM, Mark Webb elihusma...@gmail.com wrote:
 I am trying to figure out how to set up a request / response in Camel
 with ActiveMQ.  Basically this is what I am looking for:


 myapp - queue.A - processor(DB query) - queue.A - myapp


 I have read through the documentation and the closest I have come is
 the following sping-camel example:

 route
        from uri=jms:queue.A /
        process ref=processor /
        to uri=jms:queue.A pattern=InOut /
 /route

 This seems to work, but it doesn't seem right to me that I need a
 from and to.  Plus I get a
 org.apache.camel.ExchangeTimedOutException: exception on each message.


 Thanks for any help you have,
 Mark




 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus





-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


AW: request / response example

2010-08-12 Thread Schneider Christian
Hi Mark,

you don´t have to set the header by hand. If you use a route for the client 
then Camel will automatically create a temporary reply queue, set the header 
field and listen for the response.

The code below would allow you to send requests to the direct endpoint that 
travel to the jms queue and to the processor and back again to your direct 
endpoint.

route
  from uri=direct:myEndpoint /
  to uri=jms:queue.A /
/route
route
  from uri=jms:queue.A /
  process ref=processor /
/route

Using the reply to header is the standard jsm way to do request response. Is 
there any special reason why you want to do this in another way?

Greetings

Christian




Christian Schneider
Informationsverarbeitung 
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-Ursprüngliche Nachricht-
Von: Mark Webb [mailto:elihusma...@gmail.com] 
Gesendet: Donnerstag, 12. August 2010 16:33
An: users@camel.apache.org
Betreff: Re: request / response example

OK, cool.  I got that to work.  Now what about the case in which I do
not want to set the JMSReplyTo header field?  How would that work?

Thanks for the help



On Wed, Aug 11, 2010 at 4:51 PM, Claus Ibsen claus.ib...@gmail.com wrote:
 If the JMS message has a JMSReplyTo header then the JMS consumer will
 use request/reply automatically.
 http://camel.apache.org/request-reply.html

 So you route should simply just be:

  route
         from uri=jms:queue.A /
         process ref=processor /
  /route

 So when the route ends, the consumer jms:queue.A will send the reply
 back the the queue defined in the JMSReplyTo header.


 On Wed, Aug 11, 2010 at 8:45 PM, Mark Webb elihusma...@gmail.com wrote:
 I am trying to figure out how to set up a request / response in Camel
 with ActiveMQ.  Basically this is what I am looking for:


 myapp - queue.A - processor(DB query) - queue.A - myapp


 I have read through the documentation and the closest I have come is
 the following sping-camel example:

 route
        from uri=jms:queue.A /
        process ref=processor /
        to uri=jms:queue.A pattern=InOut /
 /route

 This seems to work, but it doesn't seem right to me that I need a
 from and to.  Plus I get a
 org.apache.camel.ExchangeTimedOutException: exception on each message.


 Thanks for any help you have,
 Mark




 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus



Re: Camel, OSGI and container wide Camel route lookups

2010-08-12 Thread rlg673

Let me know if the following Servicemix-NMR method will accomplish what you
are looking to do: nmr.getEndpointRegistry().lookup(yourTargetEndpoint). The
camel-nmr docs describe how the nmr component is exposed in camel. You may
also find the following link useful:
http://servicemix.apache.org/SMX4NMR/9-interceptors.html.

/Ron
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-OSGI-and-container-wide-Camel-route-lookups-tp2269094p2473342.html
Sent from the Camel - Users mailing list archive at Nabble.com.


threads question

2010-08-12 Thread Ron Smith
I have created a route like this:

from(tibco:queue:myqueue)
.threads(10)
.bean(StepOne.class, handleMessage)
.bean(StepTwo.class, handleMessage)


I had been testing my app without the threads(). After adding the threads()
I was surprised to find that it still only creates one instance of StepOne
and StepTwo and has all ten threads use those single instances. There is
probably something in the docs somewhere that says that is how it works but
I must have missed it. I was surprised because I prefer to use separate
instance of classes for each thread so I don't have to mess around with
ThreadLocal, etc. and, of course, everyone thinks the same way as me :-)

Is there an easy way to get camel to create separate instances for each
thread?


Blog: Dynamic FTP Client using Apache Camel and Spring

2010-08-12 Thread Mattias Severson

Hi all!

I have written a blog post about how Apache Camel and Spring can be used to
implement a dynamic FTP client. Feel free to add comments, questions or
suggestions how it can be improved:

http://blog.jayway.com/2010/08/12/dynamic-ftp-client-using-apache-camel-and-spring/
http://blog.jayway.com/2010/08/12/dynamic-ftp-client-using-apache-camel-and-spring/
 

Enjoy!

Mattias Severson
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Blog-Dynamic-FTP-Client-using-Apache-Camel-and-Spring-tp2473481p2473481.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Blog: Dynamic FTP Client using Apache Camel and Spring

2010-08-12 Thread Claus Ibsen
Hi Mattias

Just commented on your blog. I think its a very well written blog. I
took the liberty and added a link to it from the camel website
https://cwiki.apache.org/confluence/display/CAMEL/Articles

It will be synced to the static html pages in several hours.



On Thu, Aug 12, 2010 at 7:56 PM, Mattias Severson mat...@gmail.com wrote:

 Hi all!

 I have written a blog post about how Apache Camel and Spring can be used to
 implement a dynamic FTP client. Feel free to add comments, questions or
 suggestions how it can be improved:

 http://blog.jayway.com/2010/08/12/dynamic-ftp-client-using-apache-camel-and-spring/
 http://blog.jayway.com/2010/08/12/dynamic-ftp-client-using-apache-camel-and-spring/

 Enjoy!

 Mattias Severson
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Blog-Dynamic-FTP-Client-using-Apache-Camel-and-Spring-tp2473481p2473481.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Blog: Dynamic FTP Client using Apache Camel and Spring

2010-08-12 Thread Claus Ibsen
The only issue I could spot from the code is that you have a method
createFtpUri but in the send method you invoke getFtpUri method.


On Thu, Aug 12, 2010 at 8:15 PM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi Mattias

 Just commented on your blog. I think its a very well written blog. I
 took the liberty and added a link to it from the camel website
 https://cwiki.apache.org/confluence/display/CAMEL/Articles

 It will be synced to the static html pages in several hours.



 On Thu, Aug 12, 2010 at 7:56 PM, Mattias Severson mat...@gmail.com wrote:

 Hi all!

 I have written a blog post about how Apache Camel and Spring can be used to
 implement a dynamic FTP client. Feel free to add comments, questions or
 suggestions how it can be improved:

 http://blog.jayway.com/2010/08/12/dynamic-ftp-client-using-apache-camel-and-spring/
 http://blog.jayway.com/2010/08/12/dynamic-ftp-client-using-apache-camel-and-spring/

 Enjoy!

 Mattias Severson
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Blog-Dynamic-FTP-Client-using-Apache-Camel-and-Spring-tp2473481p2473481.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: threads question

2010-08-12 Thread Claus Ibsen
On Thu, Aug 12, 2010 at 7:19 PM, Ron Smith ronsmit...@gmail.com wrote:
 I have created a route like this:

 from(tibco:queue:myqueue)
    .threads(10)
    .bean(StepOne.class, handleMessage)
    .bean(StepTwo.class, handleMessage)


 I had been testing my app without the threads(). After adding the threads()
 I was surprised to find that it still only creates one instance of StepOne
 and StepTwo and has all ten threads use those single instances. There is
 probably something in the docs somewhere that says that is how it works but
 I must have missed it. I was surprised because I prefer to use separate
 instance of classes for each thread so I don't have to mess around with
 ThreadLocal, etc. and, of course, everyone thinks the same way as me :-)

 Is there an easy way to get camel to create separate instances for each
 thread?


You can use Spring and have it use prototype scoped for the bean

Or just use a Processor and new the bean yourself and invoke the method.


-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Scala DSL: splitting

2010-08-12 Thread Andrey Popp
Hello, I want to implement that piece of configuration in Scala DSL,
but can't find the solution:

from(direct:in).split(body()).to(direct:out)

The problem is the split() statement, Scala DSL's split has type
(Exhange = Any) but what should I do inside this function?

Thanks!

-- 
Andrey Popp

phone: +7 911 740 24 91
e-mail: 8may...@gmail.com


Re: Blog: Dynamic FTP Client using Apache Camel and Spring

2010-08-12 Thread Mattias Severson

Thank you very much for your comments, highly appreciated. Of course, you are
welcome to link to my post. I have corrected the blog post with the error
that you found.

Regards, 

Mattias Severson
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Blog-Dynamic-FTP-Client-using-Apache-Camel-and-Spring-tp2473481p2474029.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel 1.6.2 and jaxb-impl 2.1.12 and errorHandlerRef

2010-08-12 Thread Eric Haszlakiewicz


I'm having some problems with using a default errorHandlerRef on a
camelContext element in my spring config.  I am using camel 1.6.2. 
Everything works fine when I use a version of jaxb-impl that is prior to
2.1.12, but if I use 2.1.12 or newer the errorHandlerRef doesn't seem to
take effect.

Specifying an errorHandlerRef on individual routes works find regardless of
the version of jaxb-impl.

I took a brief look at the changes listed in the jaxb changelog
(https://jaxb.dev.java.net/nonav/2.1.12/docs/changelog2.html), but I'm not
familiar enough with either camel or jaxb for those to really mean much to
me.

I haven't had the time to trim this down to a simple test case yet, but
before I spend the time doing so: does this problem ring a bell with anyone?  

eric
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/camel-1-6-2-and-jaxb-impl-2-1-12-and-errorHandlerRef-tp2476479p2476479.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: threads question

2010-08-12 Thread Ron Smith
I don't really want a new bean every time it is called. I just want one for
each thread.

On Thu, Aug 12, 2010 at 1:22 PM, Claus Ibsen claus.ib...@gmail.com wrote:

 On Thu, Aug 12, 2010 at 7:19 PM, Ron Smith ronsmit...@gmail.com wrote:
  I have created a route like this:
 
  from(tibco:queue:myqueue)
 .threads(10)
 .bean(StepOne.class, handleMessage)
 .bean(StepTwo.class, handleMessage)
 
 
  I had been testing my app without the threads(). After adding the
 threads()
  I was surprised to find that it still only creates one instance of
 StepOne
  and StepTwo and has all ten threads use those single instances. There is
  probably something in the docs somewhere that says that is how it works
 but
  I must have missed it. I was surprised because I prefer to use separate
  instance of classes for each thread so I don't have to mess around with
  ThreadLocal, etc. and, of course, everyone thinks the same way as me :-)
 
  Is there an easy way to get camel to create separate instances for each
  thread?
 

 You can use Spring and have it use prototype scoped for the bean

 Or just use a Processor and new the bean yourself and invoke the method.


 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus



ApplicationContextTestSupport class not found in Camel 2.3

2010-08-12 Thread vcheruvu

Hi,

 I am looking at Camel-Mock component site. According to the spring example
comments, I believe it is out of date for Camel 2.0+ versions. I haven't
been able to follow your example with Camel 2.3 version. Could you please
let me know if you could update the example that works with Camel 2.3
version, So that I can understand how to utilize  @EndpointInject in my test
class. 

Kind regards,
-VId-
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/ApplicationContextTestSupport-class-not-found-in-Camel-2-3-tp2507940p2507940.html
Sent from the Camel - Users mailing list archive at Nabble.com.