Re: How to tune recipient list performance?

2023-12-16 Thread Steve973
Hello.  I wanted to post a quick follow-up of my efforts to tune my app to
get better performance with a recipient list.  Previously, I was only able
to get 1,000,000 messages through my example in five minutes.  After some
playing around, I got all million messages completed in about 45 seconds!
I am routing through a Kafka broker, and my dynamic router EIP component
that is now utilizing a recipient list.  Here is what I did:

1. Create a custom pool the way the documentation suggests:

@Bean
public ExecutorService customPool() {
DefaultThreadPoolFactory threadPoolFactory = new DefaultThreadPoolFactory();
threadPoolFactory.setCamelContext(camelContext);
DefaultExecutorServiceManager executorServiceManager = new
DefaultExecutorServiceManager(camelContext);
executorServiceManager.setThreadPoolFactory(threadPoolFactory);
return executorServiceManager.newCachedThreadPool(this,
"DynamicRouterSpringBootThreadFactory");
}


2. Utilizing better parallelism to generate and send messages:

Flux.range(1, limit)
.flatMap(n -> Mono.just(n)
.map(Object::toString)
.subscribeOn(Schedulers.boundedElastic())
.doOnNext(strN ->
producerTemplate.sendBodyAndHeaders("direct:command", strN,
Map.of("command", PROCESS_NUMBER_COMMAND,
"number", strN
.subscribe();

I am much more satisfied with these results.  If any of you have other
suggestions that I should try, please let me know.  I will see how it
affects the results, and I will reply to the thread with whatever I find.

When this is all complete, I will submit my changes, which include a spring
boot examples project that demonstrates the dynamic router eip component
utilized in a more real-life scenario where messages are routed to multiple
(separate) JVMs, and stood up in a docker-compose stack where it can all be
controlled and monitored via swagger endpoints.

Thanks,
Steve

On Sat, Dec 16, 2023 at 12:21 PM Steve973  wrote:

> Hello.  Are there examples somewhere that show how to make a recipient
> list as fast as possible?  I have already tried to provide different types
> of thread pools from the DefaultExecutorServiceManager.  If I am sending a
> lot of small messages, what options should I use to make the recipient list
> route as fast as possible?
>
>
>


How to tune recipient list performance?

2023-12-16 Thread Steve973
Hello.  Are there examples somewhere that show how to make a recipient list
as fast as possible?  I have already tried to provide different types of
thread pools from the DefaultExecutorServiceManager.  If I am sending a lot
of small messages, what options should I use to make the recipient list
route as fast as possible?


Re: AWS Kinesis Consumer

2023-12-16 Thread Andrea Cosentino
Hello,

The PR looks good to me, I just would like to have more feedback from
others (in particular, Otavio, the one writing the Resume API and the
Kinesis adapter.

Il giorno sab 16 dic 2023 alle ore 13:26 Alphonse Bendt <
alphonse.be...@gmail.com> ha scritto:

> Hi folks,
>
> A couple of days ago, I asked about resuming an AWS kinesis stream
> consumer:
>
> https://lists.apache.org/thread/sc6oks5jckcbj19t06chmfpm6dpwt60t
>
> I have experimented a bit more with the camel codebase and think now that
> there is functionality missing to allow implementing a ResumeStrategy for a
> Kinesis consumer:
>
> I think the consumer should make the shardId available, plus I think the
> API of the KinesisResumeAdapter needs to be modified.
> I have created a Branch with both proposed changes (see
> https://github.com/apache/camel/pull/12462/files).
> With these changes, I could sketch a custom ResumeStrategy (see branch).
>
> Is this something you would accept as a PR?
>
> Regards,
> Alphonse
>
>
>
>


AWS Kinesis Consumer

2023-12-16 Thread Alphonse Bendt
Hi folks,

A couple of days ago, I asked about resuming an AWS kinesis stream consumer:

https://lists.apache.org/thread/sc6oks5jckcbj19t06chmfpm6dpwt60t

I have experimented a bit more with the camel codebase and think now that there 
is functionality missing to allow implementing a ResumeStrategy for a Kinesis 
consumer:

I think the consumer should make the shardId available, plus I think the API of 
the KinesisResumeAdapter needs to be modified.
I have created a Branch with both proposed changes (see 
https://github.com/apache/camel/pull/12462/files). 
With these changes, I could sketch a custom ResumeStrategy (see branch).

Is this something you would accept as a PR?

Regards,
Alphonse