camel-cxfrs with custom http headers...

2010-08-16 Thread boday
I have a route that defines a CXFRS endpoint. I need to retrieve custom HTTP header values from the inbound request... from(CXF_RS_ENDPOINT_URI) .process(new Processor() { public void process(Exchange exchange) throws Exception { Mess

Re: camel-cxfrs with custom http headers...

2010-08-17 Thread boday
Jiang, our client is sending some needed parameters in the HTTP header of each request and I'm trying to figure out how to retrieve them in my Camel processor. Are they accessible from the camel exchange/message now? If so, how can I retrieve them? thanks... - Ben O'Day -- View this mess

Re: camel-cxfrs with custom http headers...

2010-08-19 Thread boday
] To: boday Sent: Wed, August 18, 2010 8:40:04 PM Subject: Re: camel-cxfrs with custom http headers... FYI, I committed the patch into Camel trunk, please check out the latest Camel 2.5-SNAPSHOT to verify it. Willem boday wrote: > Jiang, our client is sending some needed parameters in

guaranteed message processing question...

2009-11-04 Thread boday
I'm using Camel2 in SMX 3.3.1. I have a simple Camel route as follows... from("activemq:inboundMessages?maxConcurrentConsumers=50") .process(new Processor1()) .process(new Processor2()) .to("activemq:finishedQueue"); How do I guarentee that a message will not be removed from the "inboundMessage

Re: guaranteed message processing question...

2009-11-04 Thread boday
thanks guys. I added some parameters to the queue to make the route "transactional"... from("activemq:inboundMessages?maxConcurrentConsumers=50&lazyCreateTransactionManager=true&transacted=true") .process(new Processor1()) .process(new Processor2()) .to("activemq:finishedQueue"); Now I'm getti

Re: guaranteed message processing question...

2009-11-09 Thread boday
Claus, my questions are really specific to how Camel wraps the underlying AMQ technologies. In particular, how Camel handles transactions and client acknowledgements when exceptions are raised and redelivery policies applied (using Camel's onException clause, etc). Also, I'm not running in DUPS_

Re: guaranteed message processing question...

2009-11-16 Thread boday
I've been performance testing my newly transacted route, but have seen a significant performance drop. I assumed there would be a bit of overhead with using transactions, but my route goes from ~250 message/second to ~50 messages/second when I add the "?transacted=true" to it (no other changes)

Camel route with CLIENT_ACKNOWLEDGE?

2009-11-17 Thread boday
how do I explicitly acknowledge a message in a Camel route (using CLIENT_ACKNOWLEGE)? I'm using Camel2 in SMX 3.3.1. I have a simple Camel route as follows... from("activemq:start?maxConcurrentConsumers=10") .process(new Processor1()) .process(new Processor2()) .to("activemq:finished"); I'd li

performance issues with JMS transacted route...

2009-11-30 Thread boday
I have the following JMS transacted route... from("activemq:start?maxConcurrentConsumers=50&transacted=true") .process(new ValidateMessage()) .process(new SaveToDatabase()) .to("activemq:finishedQueue"); I assumed there would be a bit of overhead with using transactions, but my route goes fro

Re: performance issues with JMS transacted route...

2009-12-01 Thread boday
thanks Claus, that is exactly what I wanted to hear... here is my setup...any advice would be appreciated... JDK 1.6, ServiceMix 3.3.1, Camel 2.0 (patched the /hotdeploy/servicemix-camel.zip) AMQ 5.2 (persistent, small 1k messages, 250+ msg/second, no XA Tx) Jenks AMQ pool 2.1, Spring 2.5.6 htt

Re: performance issues with JMS transacted route...

2009-12-02 Thread boday
Claus, I tried the following... -disabled the message groups -setup the Spring JmsTransactionManager as follows... ... ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy(); prefetchPolicy.setQueuePrefetch(50); //tried 0, 10, 1000, 5000 ActiveMQConnectionFactory connFactory = n

start/stop routes programmatically

2009-12-14 Thread boday
I see that Camel 2.1 now support starting/stopping routes via JMX/APIs. But, how do I identify routes properly at runtime... For example, assume I have the following route... from("activemq:queue1").to("activemq:queue2"); from("activemq:queue2").to("activemq:queue3"); They show up in JMX as "r

Re: start/stop routes programmatically

2009-12-15 Thread boday
perfect, that is what I was looking for...thanks guys willem.jiang wrote: > > If you are using camel 2.0, you may need to use id() dsl, > but for camel 2.1 you can use the routeId() dsl. > > You can find more information here[1] > > [1] https://issues.apache.org/activemq/browse/CAMEL-2109 >

DefaultManagementLifecycleStrategy - Could not register service

2009-12-24 Thread boday
I'm sending high volume/small messages to an AMQ topic using the following API inside of a Camel (2.1) processor... exchange.getContext().createProducerTemplate().sendBodyAndHeaders("activemq:topic:portal", messageXML, headers); I get this warning message every few minutes (stack trace below).

context.stopRoute() API hangs periodically

2010-01-06 Thread boday
I'm using Camel 2.1 on SMX 3.3.1. I'm using a timer to periodically reprocess messages that I've sent to an error queue. While reprocessing I want to stop the main message processing route as follows (for some specific client requirements)... from("direct:main").routeId("mainRoute").process(Mes

Re: Issue trying to browse a activemq queue

2010-01-06 Thread boday
I just use JMX to get these statistics... here is some raw code to create a connection and iterate over the AMQ queues to find a given queues size... note: be careful to close/resuse JMX connections or they will cause OutOfMemoryExceptions on the MBeanServer ... JMXServiceURL url = new JMXServ

Re: context.stopRoute() API hangs periodically

2010-01-08 Thread boday
thanks for the feedback guys... I think I found the issue. My ErrorMessageProcessor runs every 60 seconds and was periodically taking longer than 60 seconds to run. Then, I end up with multiple threads trying to stop/start the same route (not a good thing I imagine). So, I increased the time b

clustering Camel with AMQ/ServiceMix

2010-02-04 Thread boday
I'm trying to determine my options for clustering my SMX 3.3.1/Camel 2.1/AMQ 5.3 application. I'm performing high volume message processing and I need to cluster for high availability and horizontal scalability. Here is basically what my application does...HTTP->QUEUE->PROCESS->DATABASE->TOPIC

Re: OnException and log level

2010-02-26 Thread boday
Julien, I added the following to suppress these messages... DefaultErrorHandlerBuilder errHandler = defaultErrorHandler(); errHandler.loggingLevel(LoggingLevel.DEBUG); errHandler.getRedeliveryPolicy().setRetriesExhaustedLogLevel(LoggingLevel.DEBUG); errHandler.getRedeliveryPolicy().setRetryAttemp

DirectProducer - no consumers available on endpoint...message is lost

2010-03-08 Thread boday
I have a polling consumer setup to periodically (using camel-timer) retry messages from an error queue. like this... //initialized in constructor of polling consumer private static ProducerTemplate producer = context.createProducerTemplate(); ... Exchange exchange = consumer.receive("activemq:e

Re: DirectProducer - no consumers available on endpoint...message is lost

2010-03-08 Thread boday
sorry, the '::' was a typo in my post only... the route works fine during normal execution...basically the following from('activemq:inbound') .to('direct:decode'); from('direct:decode') .convertBodyTo(DOMSource.class) .process(new DecodeProcessor()) .process(new ValidateProcessor()) .process(ne

Re: DirectProducer - no consumers available on endpoint...message is lost

2010-03-08 Thread boday
yes, the retry does work fine 99% of the time...randomly we see this error after many successful retries of of other messages, etc... - Ben - Senior Consultant using SMX 3.3.1/Camel 2.1 -- View this message in context: http://old.nabble.com/DirectProducer---no-consumers-available-on-endpoin

Re: DirectProducer - no consumers available on endpoint...message is lost

2010-03-09 Thread boday
Sorry, please ignore my typos in the route (I use constants for all endpoints, but tried to simplify it for the post). Does "no consumers available" mean the route isn't active or that there aren't any available threads? Also, where does the message go exactly? Is there a way to handle this cas

Re: Super basic questions

2014-01-20 Thread boday
in short, Camel parses the from/to URIs to call a Java API that knows how to speak that specific component's language (File I/O, HDFS, etc). So, yes...formatting an appropriate (see camel-hdfs examples) URI to your HDFS server will tell Camel to poll for files from "://in" directory and send the

Re: Super basic questions

2014-01-21 Thread boday
the camel-hdfs producer will throw an error if the send operation fails...internally it just uses a standard HdfsOutputStream...so any step in the route following this send would only be triggered upon successful send operation, and you can use standard Camel onException/doCatch routing exception h

Re: Apache camel guaranteed delivery - multiple endpoints

2014-01-29 Thread boday
might take a look at the idempotent consumer pattern to filter duplicates...it can be used with a repository (hazelcast, file, etc) to survive servers restarts, etc http://camel.apache.org/idempotent-consumer.html MichaelAtSAG wrote > All, > > Please provide best practices on supporting guarant

Re: Apollo support in Camel

2014-05-10 Thread boday
now that openwire supported has been added to Apollo...anyone using it with Camel JMS yet? if so, any advice/lessons learned? Claus Ibsen-2 wrote > A future release of Apollo will support JMS, and thus you can then use > the camel-jms component. > > > On Mon, Feb 6, 2012 at 11:23 PM, MichaelA

Re: Apollo support in Camel

2014-05-19 Thread boday
thanks Christian...I'm looking into migrating a Camel 2.13 app from using an external AMQ 5.9 broker to Apollo...just curious what (if any) client code/config changes are required I've played with it just to see if it works.. anything specific? - Ben O'Day IT Consultant -http://consultin

Re: Avoiding Serialization in DefaultProducerTemplate

2014-05-31 Thread boday
what endpoint are you producing to? if you are using ActiveMQ with the VM transport, then you can disable serialization by setting this property on the connection factory... ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost"); factory.setObjectMessageSerializationD

Re: Broker definition - activemq.xml - Fuse 6

2014-05-31 Thread boday
sounds like you need to either disable security in the activemq.xml or setup your Camel AMQ factory with the user/pw provided... Happy User wrote > I am wondering if anyone can help me with this. > > I am a

Re: Hawtio - ActiveMQ Issue

2014-06-03 Thread boday
you should direct this to the hawtio forum instead: http://hawt.io/community/ Happy User wrote > Could someone help me with the below issue? > > 1. I gave credentials in preferences for ActiveMQ. > 2. I created Queue in the default broker and it was successful. > 3. I selected the queue and clic

Re: Green test, but my RouteBuilder dosent run...

2014-06-19 Thread boday
remove these lines from testSendMatchingMessage(), this is handled by CamelTestSupport automatically and causing duplicate "direct:start" routes context.addRoutes(createRouteBuilder()); context.start(); Frankiboy wrote > What is wrong here > > Green test, but notning happen

Re: Green test, but my RouteBuilder dosent run...

2014-06-19 Thread boday
the issue is also with your template/mock setup...you are mixing concepts a bit... remove the declarations outside of the method and just do something like this... MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedBodiesReceived("expected result"); template

Re: question about seda component

2014-06-23 Thread boday
yep, SEDA uses a BlockingQueue and is asynchronous from the producer (the process that sends to your seda:trades endpoint)...so if you specify concurrentConsumers=100 then it will use 100 threads to pull messages off the queue and execute your route in parallel... simafengyun wrote > Hi All, > >

Re: Camel hang on graceful shutdown - NOT trying to stop a route from a route

2014-06-23 Thread boday
you might try adding a "depends-on" attribute to the definition to tell Spring the order to start/stop things... http://camel.apache.org/schema/spring"; depends-on="activemq, remote.activemq"> Paul Gale wrote > Hi, > > ActiveMQ 5.9.1 > Camel 2.13.1 > Spring 3.2.5 > OS: RHEL 6.3 > Tanuki Java S

Re: Aggregate up to N "ASAP"

2014-10-27 Thread boday
bacar, as suggested...use a completionTimeout value greater than 0...this will complete when a max size of 100 is reached OR after no new messages are received for that amount of time...whichever is FIRST... also, if you have a max delay requirement, then use the completionInterval() instead to gu

Re: can camel throttle messages based a dynamic message key?

2014-10-27 Thread boday
Niels, I think what you are looking for is not throttling, but single threading groups of related messages, correct? If so, then ActiveMQ message groups is designed for exactly that and is trivial to implement... Just route your messages through a JMS queue and set the JMSXGroupId header set to y

Re: question about database querying design pattern

2014-11-16 Thread boday
there isn't a "reach through cache" design pattern implementation...that said, given that both redis/mongdb components support producing/consuming, this shouldn't be difficult to use along with some simple conditional logic implemented via a filter or content based router... here is a pseudo route

Re: general approach to streaming

2014-11-27 Thread boday
Tim, the SEDA component is designed to produce/consume messages quickly and provides a queue (BlockingQueue) in between resources to buffer the flow and provides options such as max size and blockWhenFull to limit memory usage and slow a producer as needed, etc... http://camel.apache.org/seda.htm

Re: Camel production use

2015-03-19 Thread boday
yes. do you have any specific questions about creating routes? on the deployment side, Camel can be embedded in any existing Java app, run in Tomcat, in OSGi or standalone mode... I generally use Tomcat and Spring to bootstrap the context: http://camel.apache.org/servlet-tomcat-example.html o

Re: Transactional batching

2013-04-02 Thread boday
this is a really old thread, but I'm wondering if anyone has any updated ideas on this...I have a similar requirement to read from an AMQ queue, batch X messages together and then process. I'm currently doing this with the aggregator/hawtdb repo combination but performance is proving too slow...

Re: Transactional batching

2013-04-04 Thread boday
Let me know if this answers your question. > > Best Regards, > Scott ES > > > On Tue, Apr 2, 2013 at 11:02 PM, boday < > ben.oday@ > >wrote: > >> this is a really old thread, but I'm wondering if anyone has any updated >> ideas on this...I have

Re: Making a route depend on multiple criteria

2013-05-14 Thread boday
sounds like you could just explicitly invoke the 4th route (direct:route4) at the end of the 3rd route and enrich the 4th route with the "hold" file...see http://camel.apache.org/content-enricher.html cwhistler wrote > I need a way to create a Camel route that uses a file "from" endpoint but > ca

Re: How do I determine which endpoint validation exception came from?

2013-05-14 Thread boday
you generally can isolate individual exceptions by either throwing/catching more explicit exceptions or by using granular doTry/doCatch clauses within routes... another option is to use the Exchange property Exchange.TO_ENDPOINT/FAILURE_ENDPOINT to indicate the last endpoint that was tried before

Re: Using ActiveMQ with Camel

2013-06-03 Thread boday
likewise, you can use Camle/AMQ with Servicemix as well and it can provide greater flexibility in terms of deployments (bundles with separate lifecycles, etc) see this guide for setting up AMQ: http://servicemix.apache.org/docs/4.4.x/activemq/index.html see this guide for setting up Camel: http://

Re: Camel Jetty - Performance Issue

2013-06-03 Thread boday
on a side note, you should reuse the ProducerTemplate in your processors across subsequent requests... minimize calls to "context.createProducerTemplate()" by using a static/class level variable to hold this reference, should help performance... WPk wrote > public class ScanningServicesProcesso

Re: Quick question on Exchange

2013-06-04 Thread boday
the end of the route will handle that for you...if you need to explicitly stop the Exchange processing before the end of the route, you can do this by setting exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE)... Cristiano Costantini wrote > Hi All, > > at the end of a route I process excha

camel deployment options...

2013-06-17 Thread boday
I have a complex/high volume (1k msgs/s) Camel application running in ActiveMQ that I need to scale up (2-5x traffic). To date, we scaled by adding more AMQ/Camel VMs and partitioned traffic to each broker. My thought is that decoupling Camel from AMQ and adding nodes independently is a better wa

Re: Activemq consumer is closing

2013-06-20 Thread boday
we were seeing similar issues and tracked it back to and ActiveMQConnectionPool idleTimeout issue: https://issues.apache.org/jira/browse/AMQ-4366 the solution for us was to explicitly set the idleTimeout to 0 to disable this ActiveMQMessageConsumer.checkClosed() logic... indrayani wrote > Hi , >

Re: Accessing a local declared hashmap variable in a route

2013-07-14 Thread boday
you can use camel-simple to do this... from("direct:start") .choice() .when().simple("${body.keySet} contains 'foo'") .to("mock:king") .otherwise() .to("mock:other"); clipod wrote > Hi, > I have a camel route with a choice

Re: pass input from queue to web service

2013-08-06 Thread boday
start with reading about CXF to wrap the web service interaction: http://camel.apache.org/cxf-example.html otherwise, checkout some CXF unit tests to see how to setup the necessary message information to invoke a web service http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/j

Re: Router with DSL

2013-08-06 Thread boday
#1 - yes, you can use both Spring XML to define routes and also include RouteBuilders that define JavaDSL routes via bean refs or packageScan (see http://camel.apache.org/spring.html) #2 - yes, you can use multiple Camel Contexts in any container pannereselvam wrote > Hi, we are new to camel. Ha

Re: Router with DSL

2013-08-06 Thread boday
sure, assuming you are bootstrapping the contexts with Spring, just include multiple camel-context.xml files (or add multiple contexts to a single file) and make sure you give the contexts explicit bean IDs so they can be referenced later... pannereselvam wrote > Thanks boday... >

Re: Router with DSL

2013-08-08 Thread boday
pannereselvam wrote > Great boday! > > Is it possible to communicate between two contexts. > I m from J2EE background, in tomcat container, each web application has > unique context. So we can deploy many application in the same container. > Is it same in Camel ? > > Thank

Re: aggregatorstrategy on specified jms replyto question

2012-09-15 Thread boday
not sure I follow exactly, but here is an example of aggregating based on the JMSCorrelationID in SpringDSL... header.JMSCorrelationID - Ben O'Day IT Consultant -http://consulting-notes.com -- View this message in context: http://camel.465427.n5.nabble.com/agg

Re: how to retrieve the consumer and/or producer created in an endpoint

2012-09-15 Thread boday
I don't see any APIs in the DefaultContext/DefaultEndpoint for this...you can get Consumer information in JMX however suralk wrote > > Hi All, > Suppose I have defined my camel context:  >  CamelContext camel = new DefaultCamelContext(); > > after defining routes, > I can access the set of end

Re: Cannot figure out routing to a remote web service

2012-09-15 Thread boday
see http://camel.apache.org/cxf-proxy-example.html mjkrumlauf wrote > > I am having difficulty figuring out how to using any combination of Camel > and the CXF or CXF Bean components to route to a remote web service. I > would like to do something like this: > > from("someplace") > .to("cxf:

Re: Content based Routing

2013-01-03 Thread boday
I suggest you start with some simple examples or books to get your head around how to use Camel. To your specific flow, see the following links... 1. see camel-file to proce

Re: Splitter and Aggregator Query

2013-02-11 Thread boday
the splitter sets the CamelSplitSize header that you should be able to use as your aggregator completion predicate... something like this... from("direct:start") .split(body()) .aggregate(constant(true), new BodyInAggregatingStrategy()).completionSize(header("CamelSplitSize")) gilboy wro

Re: Dynamic route : multiple From point

2013-02-12 Thread boday
if you want these to be separate routes altogether, then you can also add routes at runtime by periodically checking for new customer registrations and calling context.addRoutes() for more details, see http://stackoverflow.com/questions/10451444/add-camel-route-at-runtime-in-java ODarwish wrote

Re: default maximum redelivery policy when overridding default error handler not right

2013-02-12 Thread boday
I just created a basic test and it seemed to work fine for my scenario. Can you attach a unit test that replicates this? joe82 wrote > According the the camel documentation, if you provide a context-scoped > error handling policy, and then a route-scoped onException policy also - > the MaximumRe

RE: default maximum redelivery policy when overridding default error handler not right

2013-02-13 Thread boday
t;) > .onException(Exception.class) > .handled(true) > .to("mock:exception") > .end() > > Do you find same if you add this to your route policy? > > Regards, > joanne > > > From: b

Re: Handle exception

2013-03-05 Thread boday
if you don't want the error to propagate back up, then set handled(true) in your doCatch() block... also, don't try to mix try/catch with onException handling of the same error class...just pick one or the other jeff wrote > Hey ! > > I am trying to catch exception from validation properly. >

Re: Redundant Camel Applications

2013-03-05 Thread boday
couple of options...if you want to use ActiveMQ as your deployment container, then you can use its master/slave HA setup (http://activemq.apache.org/shared-file-system-master-slave.html) otherwise, see this article for a camel specific implementation: http://www.liquid-reality.de/display/liquid/

Re: Custom Message Filter

2011-04-28 Thread boday
make sure you put your ref inside the tag... see http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringCustomPredicateTest.xml?view=markup this example ... jguion wrote: > > Hi, > > I am trying to build a custom filter us

Re: Context Monitoring

2011-04-28 Thread boday
also, here are 2 blog posts about remote Camel/AMQ monitoring with JMX...I used this approach to build a JSP/JQuery based monitoring console for a client. http://benoday.blogspot.com/2010/08/managing-camel-routes-with-jmx-apis.html http://benoday.blogspot.com/2010/08/monitoring-and-managing-active

Re: InOut pattern

2011-04-28 Thread boday
at a glance, it's not clear what you are trying to do... if you haven't already, take a look at these patterns and their associated test cases for examples http://camel.apache.org/request-reply.html http://camel.apache.org/return-address.html -Ben O'Day IT Consultant -http://benoday.blogspot.

Re: tcp monitor?

2011-04-29 Thread boday
http://www.wireshark.org/ wireshark -Ben O'Day IT Consultant -http://benoday.blogspot.com -- View this message in context: http://camel.465427.n5.nabble.com/tcp-monitor-tp4359515p4359644.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: One exchange at a time

2011-05-02 Thread boday
Linus, you might also take a look at the camel-ftp unit tests...in particular http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerMaxMessagesPerPollTest.java?view=markup FtpConsumerMaxMessagesPerPollTest , which uses the "ma

Re: Camel with activemq

2011-05-03 Thread boday
a couple of quick thoughts... -if you want load balancing with AMQ, you need a http://activemq.apache.org/networks-of-brokers.html network of brokers setup (as opposed to just failover) -then you can have camel consume from a "distributed" queue (for example) and let AMQ handle the abstraction/b

Re: Round Robin with Camel

2011-05-03 Thread boday
see the http://camel.apache.org/load-balancer.html load balancer page for details...basically, "The round robin load balancer is not meant to work with failover, for that you should use the dedicated failover load balancer" so, see this unit test for an example http://svn.apache.org/viewvc/came

Re: Load testing

2011-05-03 Thread boday
here are a few links that might help... http://camel.apache.org/dataset.html http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/PerformanceRouteTest.java?view=markup http://benoday.blogspot.com/2011/04/camel-activemq-performance-test

Re: Load testing

2011-05-03 Thread boday
just use a mock result endpoint and assert that the total processing time was within an acceptable range... resultEndpoint.expectedMessageCount(100); long start = System.currentTimeMillis(); //send messages resultEndpoint.assertIsSatisfied(); assertTrue("took too long", (System.currentTimeMill

Re: Error recovery

2011-05-04 Thread boday
It won't resume where it left off by default. Camel will only delete the file if it was successfully processed and when it fails, the portion already send to AMQ will not be rolled back. When the process resumes, it will process the entire file again. One option is to use the file's moveFailed o

Re: Problem designing a camel route for an OSGi system.

2011-05-04 Thread boday
I researched this a while back and it I think the Camel approach to communicating between bundles was to use JMS, NMR or WebServices (instead of sharing the camel context). The pure OSGi way is to use the service registry or manifest import/export package statements. Anyways, I wrote this http:/

Re: Synchronization based on correlation identifier

2011-05-06 Thread boday
if you can incorporate AMQ, then you can use http://activemq.apache.org/message-groups.html message groups to do exclusive threading/ordering of groups of messages... - Ben O'Day IT Consultant -http://benoday.blogspot.com -- View this message in context: http://camel.465427.n5.nabble.com/S

Re: route shutdown

2011-05-06 Thread boday
see this example of http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html stopping a route from a route and do it in the onException() clause after the retry/logging configuration, etc... BERTRAND Antoine AWL-IT wrote: > > I'm wondering if it is possible to shutdown a route or a

Re: Append endpoint to route at test-time.

2011-05-08 Thread boday
yep, just use http://camel.apache.org/advicewith.html http://camel.apache.org/advicewith.html and interceptor to decorate with a mock endpoint that you can assert against... tarjei wrote: > > Hi, > > I got a route like this: > from(bookKeeperQueue).routeId("BookKeeperRoute") > .pr

Re: Does onException not support multiple statements?

2011-05-09 Thread boday
hmmm, this should work fine unless "proc3" is short circuiting the route. Here is a basic example of this that simply appends "-P3" and "-P4" to any message passed in... from("direct:start") .onException(Exception.class) .handled(true) .process(new Processo

Re: Aggregator with shutdownRunningTask

2011-05-10 Thread boday
for the aggregator...use both completionSize and completionTimeout to make sure exchanges aren't left hanging (forever theoretically). In general, if you use a shutdown strategy timeout greater than your completionTimeout and you should be covered (assuming the rest of your route if relatively qui

Re: CamelSpringTestSupport and support for @Autowired/@Inject

2011-05-10 Thread boday
one quick way around this is to do the following... @ContextConfiguration public class MyActivityMonitorTestCase extends AbstractJUnit38SpringContextTests { ... see http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/bean/BeanRouteUsingSprin

Re: Does onException not support multiple statements?

2011-05-11 Thread boday
Jens, I do see that the exchange.getOut() message has a fault instead of just an exception (in my example, etc). This is causing the pipeline to short-circuit. Not sure if this is by design or not at the moment...I'll poke around a bit. To verify this, just add this line to your TestProcessor (t

Re: Does onException not support multiple statements?

2011-05-11 Thread boday
Jens, I think you can use this interceptor to convert faults to exceptions...see https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java this unit test basically, just add this to your context... getContext().addInterceptStrategy(new

Re: Does onException not support multiple statements?

2011-05-12 Thread boday
#1-3 are correct, for #4, with the fault removed (or converted to an exception), the exception pipeline will not be short-circuited... that being said, I'm not sure why the HandleFault interceptor isn't being called or converting this..I'll look into it On Thu, May 12, 2011 at 8:49 AM, Jens [via

Re: xpath 2.0 function bean binding camel xpath annotation

2011-05-18 Thread boday
l_tsall, haven't had a chance to look at this yet, but I'll see what I can do (in the next week hopefully)... l_tsall wrote: > > Hi again, > > Thanks for resolving this issue. > > But which is the proper resultType for the very useful xpath function > distinct-values which returns a sequence

Re: lost header (ActiveMQ)

2011-05-19 Thread boday
You said that one of the headers is missing, so I assume others made it through fine. If so, try switching from List to a List and see if you have the same issue (might be bumping up against an unsupported type or something). Also, if can you narrow this down to a unit test, post it so we can tak

Re: Problem writing message to file

2011-05-19 Thread boday
as Ashwin said, there are a few issues with your approach...notably, you shouldn't define your route in a loop... Also, if you need to poll from a queue every 300ms...then you can use http://camel.apache.org/content-enricher.html poll enrich , like this... from("timer://myTimer?fixedRate=true&pe

Re: Using dynamic parameter values in XML DSL Route

2011-05-21 Thread boday
you can use header properties for this...here is an example in Java DSL using a producerTemplate...but it can be done in your route by setting the header properties as well... Map map = new HashMap(); map.put("To", "davscl...@apache.org"); map.put("From", "jstrac...

Re: @XPath for an Integer

2011-05-24 Thread boday
Stu, to your first question, I did this in 2.8 recently...see this JIRA https://issues.apache.org/jira/browse/CAMEL-3911. To your second question, I see your point...I'll look into it Stu.C wrote: > > Two questions really; > a) should I have to explicitly set the resultType, rather than it be

Re: @XPath for an Integer

2011-05-24 Thread boday
Stu, I see the issue, the value is evaluated to Double.NaN and then the type converter further converts it to a primitive int (which defaults to 0, instead of null). I logged this JIRA to check for Double.NaN and return null instead of 0...https://issues.apache.org/jira/browse/CAMEL-4011 Stu.C w

Re: Camel Web Console Questions

2011-05-25 Thread boday
There has been a lot of discussion about reworking camel-web with regards to OSGI and multiple contexts. Overall, I agree that this app should be much more comprehensive, extensible and easy to integrate with existing apps. If camel-web can evolve into this...great. But currently, for specific r

Re: Camel CXF RS Consumer. Why serviceClass is required?

2011-05-25 Thread boday
Sergey, I've wondered this myself. The serviceClass appears to just be used to configure the endpoint based on class/method level annotations...nothing more. I'll look into it...or perhaps one of the more CXF savvy users can comment of this... Sergey_Zhemzhitsky wrote: > > I'm wondering why we

Re: Problem using dead message channel

2011-05-25 Thread boday
hey Greg, given that you configured your error handler to do 3 redelivery attempts (before moving to mock:dead), I think the 2nd retry (or 3rd message, with MyService.count=3) will succeed and skip the mock:dead endpoint...only when all attempts of redelivery have failed, will the Exchange be moved

Re: @XPath for an Integer

2011-05-26 Thread boday
agreed...I'll update the patch. While we are at it, are there any other cases that should be addressed? bvahdat wrote: > > I think that not only Double.NaN should be catched but also Float.NaN. > - Ben O'Day IT Consultant -http://benoday.blogspot.com -- View this message in context: ht

Re: Unit test camel with activeMQ

2011-05-30 Thread boday
take a look at the camel-jms unit tests. they should get you started with setting up AMQ and asserting message flow, etc... here is a good one to start with... https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java hbell

Re: Custom error handler around one endpoint

2011-06-02 Thread boday
just use route scoped exception handling...see http://camel.apache.org/exception-clause.html - Ben O'Day IT Consultant -http://benoday.blogspot.com -- View this message in context: http://camel.465427.n5.nabble.com/Custom-error-handler-around-one-endpoint-tp4449301p4449367.html Sent from the

Re: pass file name of generated file to next endpoint

2011-06-02 Thread boday
you can access the "CamelFileNameProduced" header and set that as the body after the file is written...something like this .setBody(header(Exchange.FILE_NAME_PRODUCED)) Bharat Goyal wrote: > > Hi, > We have a route that is configured to get XML content from a http > endpoint, log it to a file

Re: active mq message lost

2011-06-02 Thread boday
consumer.receive() will only receive a single message per call...try something like this while (true) { // receive the message from the queue, wait at most 3 sec Exchange exchange = consumer.receive(3000); if (exchange == null) { // no more messages

Re: pass file name of generated file to next endpoint

2011-06-02 Thread boday
hmmm, this worked for me... http://camel.apache.org/schema/spring";> Bharat Goyal wrote: > > Thanks that works. > > However, how do I pass the relative folder to

Re: active mq message lost

2011-06-03 Thread boday
are you doing this in a unit test? If so, you might need to add a delay (Thread.sleep(1000), etc) to make sure the queue is processed before the unit test ends. otherwise, post your entire example so we can help you further... guddu wrote: > > Hi, thanks for the reply. > > Have tried in while

  1   2   >