Re: CamelTestSupport best way to unit test the OUT or result of the route

2016-11-04 Thread catequil
@Steve973 Can you elaborate on your comment? I don't understand why that would be the case. Why have the "skipSendToOriginalEndpoint" if a strict unit test was not intended? I'm new to Camel so if you could help me understand. I would like to correctly implement testing in camel. -- View th

Re: CamelTestSupport best way to unit test the OUT or result of the route

2016-11-04 Thread Steve973
Just a note that doesn't help you directly, but camel route tests can never be unit tests. They are always integration tests. On Nov 4, 2016 4:23 PM, "catequil" wrote: > I applogize, I just missed that. I actually do have that in my test. I've > kinda got a mix of an example of what I have in

Re: Split, aggregate, then wait for completionTimeout before continuing

2016-11-04 Thread Brad Johnson
When I run into this kind of edge case problem I usually start thinking about Java objects. If you have an object with an increment method you invoke when coming in and then have a List inside that you add your aggregated objects into, then when the list length and incremented size are the same,

Re: CamelTestSupport best way to unit test the OUT or result of the route

2016-11-04 Thread catequil
I applogize, I just missed that. I actually do have that in my test. I've kinda got a mix of an example of what I have in prod and the test code. right after context.start(); i have: template.request("direct:someCamelEndpoint", (Exchange exchange) -> setExchangeProperties(exchange, som

Re: Split, aggregate, then wait for completionTimeout before continuing

2016-11-04 Thread Craig Washington
That’s correct On 11/4/16, 4:13 PM, "Brad Johnson" wrote: It appears that the splitter is exiting while your aggregator is still stuck waiting for the time out if I'm groking the code right. On Nov 4, 2016 3:49 PM, "Craig Washington" wrote: > Thanks Brad. > Jus

Re: Split, aggregate, then wait for completionTimeout before continuing

2016-11-04 Thread Brad Johnson
It appears that the splitter is exiting while your aggregator is still stuck waiting for the time out if I'm groking the code right. On Nov 4, 2016 3:49 PM, "Craig Washington" wrote: > Thanks Brad. > Just now taking a look at the resequencer. In my case the final message > and ordering > aren’t

Re: Split, aggregate, then wait for completionTimeout before continuing

2016-11-04 Thread Craig Washington
Thanks Brad. Just now taking a look at the resequencer. In my case the final message and ordering aren’t important, only the timing of the split/group/completion. The resequncer may work, likewise I suppose I could get away with using delay() and some sufficiently large value after the split,

Re: CamelTestSupport best way to unit test the OUT or result of the route

2016-11-04 Thread Craig Washington
There are many ways to test your production camel routes – you’ve included a few with Mock and AdviceWith. With this approach you shouldn’t need to include any mock endpoints in your prod route. Instead, in your test you instructing camel to advice the prod route with your mock endpoints. Last

Re: Split, aggregate, then wait for completionTimeout before continuing

2016-11-04 Thread Craig Washington
@Claus I could be wrong but the composed message processor (splitter-only) doesn’t appear to solve it. I’m not actually interested in the final composed response. I’m only interested that the message was split, processed in batches. My actual route will split a huge file (w/streaming, parallel

Re: exception handling

2016-11-04 Thread Quinn Stevenson
A little clarification - the order does matter, but not as much as it does in Java. For the code snippets you posted, it doesn’t make any difference. You’ve defined one onException block than handles multiple exceptions. The order of the onException blocks themselves can effect which block is

Re: Large message handling

2016-11-04 Thread Quinn Stevenson
I think the EIP you’re referring to is the “Claim Check” pattern ( http://www.enterpriseintegrationpatterns.com/patterns/messaging/StoreInLibrary.html ), and Camel does support that EIP ( http://camel.apache.o

Re: Best way to build a wait/retry loop with Camel?

2016-11-04 Thread Quinn Stevenson
James brings up a very good point. I know ActiveMQ isn’t designed for long-term messages, and it’s bit me a couple of times with KahaDB. What happened was I had quite a few old messages, but they were spaced out over time. KahaDB doesn’t compact files, and it can’t delete files until all th

Re: Best way to build a wait/retry loop with Camel?

2016-11-04 Thread James Green
Are you unable to move the messages into a database for "long-term" storage? That's what we do, and we simply scan for messages due to be "re-sent" and re-submit them back into the queue. I do not believe ActiveMQ was really intended to hold many messages for long term storage, hence we use someth

Re: Large message handling

2016-11-04 Thread souciance
I can't speak about the approach but I have used camel to parse and generate thousands of mb size Json messages and performance was more than satisfactory. Den 4 nov. 2016 3:54 em skrev "James Green [via Camel]" < ml-node+s465427n5789754...@n5.nabble.com>: > > Hi, > > We are preparing to start han

CamelTestSupport best way to unit test the OUT or result of the route

2016-11-04 Thread catequil
Using CamelTestSupport how do you test the out, or result of the route when it does not end in a endpoint call? Would I just put in my production route code a .to("mock:result) for each API call/route and intercept it or is there a better way that does not put a mock:endpoint in my production rout

Large message handling

2016-11-04 Thread James Green
Hi, We are preparing to start handling very large messages. Currently we have small (<1k) messages arriving from message queues and being processed, but these new messages could be several mb each. Each message is basically a JSON formatted payload with metadata and a content-body. It's this cont

Re: Camel - Hystrix

2016-11-04 Thread Claus Ibsen
There was a bug fixed recently in camel-hystrix so you can try 2.18.1 when its released or with the latest source code you can build yourself On Fri, Nov 4, 2016 at 3:20 PM, r_karthik1 wrote: > I am new to Camel and Hystrix, I am trying to imple hystrix in my project. > Before making sure I can

Camel - Hystrix

2016-11-04 Thread r_karthik1
I am new to Camel and Hystrix, I am trying to imple hystrix in my project. Before making sure I can move with hystrix for circuit break scenarios. I tried the following with give hystrix eample. When I enable the circuitBreakerForceOpen, its not even entering into the Bean that I defined. myunders

Re: Best way to build a wait/retry loop with Camel?

2016-11-04 Thread Brad Johnson
@Stephan, The timestamp could prevent you from ever getting to the processing. Since I don't actually have your code I can't tell for sure. Imagine consuming a message from the queue and the very first thing you do is check the timestamp. You haven't even tried to process it yet. If the timesta

Re: Split, aggregate, then wait for completionTimeout before continuing

2016-11-04 Thread Brad Johnson
@Craig, This may or may not be appropriate to your situation depending on your situation, but I recently ran into a situation where I was parallel processing and making external REST calls to another company so one couldn't count on uniform transaction speed and an exception absolutely bogged a th

Re: Testing CDI Route

2016-11-04 Thread Oli
It would work, if there were no third-party dependencies. I deliberately used google guava to demostrate this Caused by: java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap That is because Deployment was JavaArchive. So, I've tried to create WARArchive, which can include depende

Re: Best way to build a wait/retry loop with Camel?

2016-11-04 Thread Stephan Burkard
Hi all Thanks a lot for the interesting answers. @Quinn: The AMQ scheduler delay is a great way to accomplish this since it makes even the waiting queue completely obsolete. And if one cannot change the configuration to activate the AMQ scheduler, the route stop via ControlBus is also a good alte

Re: exception handling

2016-11-04 Thread souciance
Yeah the order does matter, take a look at http://camel.apache.org/exception-clause.html , there is section in the beginning that shows an example of how camel looks and matches exceptions. On Fri, Nov 4, 2016 at 7:46 AM, Demon Hunter [via Camel] < ml-node+s465427n5789729...@n5.nabble.com> wrote:

Re: Testing CDI Route

2016-11-04 Thread Antonin Stefanutti
I would expect your testing logic to work fine in an Arquillian test. What error do you face? > On 04 Nov 2016, at 09:37, Oli wrote: > > I see... I've tried the approach recommended by wildfly swarm, but it didn't > work for me either. The examples are very basic and don't involve any > injecti

Re: Testing CDI Route

2016-11-04 Thread Oli
I see... I've tried the approach recommended by wildfly swarm, but it didn't work for me either. The examples are very basic and don't involve any injecting and mocking of the parts of the route. -- View this message in context: http://camel.465427.n5.nabble.com/Testing-CDI-Route-tp5789709p5789