You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/09/02 16:03:00 UTC

[jira] [Resolved] (CAMEL-15640) Partition component/EIP

     [ https://issues.apache.org/jira/browse/CAMEL-15640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-15640.
---------------------------------
    Resolution: Won't Fix

> Partition component/EIP
> -----------------------
>
>                 Key: CAMEL-15640
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15640
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Jan Bednar
>            Assignee: Jan Bednar
>            Priority: Minor
>
> Sometimes you need to process messages in parallel and also ensure order of messages per key. Kafka is great for this with its partitioning and ActiveMQ with message groups, but in small single instance project may be broker overkill.
> I needed that feature in one project and solved it with something what doesnt look nice, similar to this pseudo code:
> {code:java}
> final int consumers = 10;
> from("direct:source")
>     .process(exchange ->
>             exchange.getMessage().setHeader("partition",
>                     exchange.getMessage().getHeader("partition_key")
>                             .hashCode() % consumers)
>     )
>     .toD("seda:partition_${header.partition}");
> for (int i = 0; i < consumers; i++) {
>     from("seda:partition_" + i)
>             .to("direct:target");
> }
> {code}
> It would be great to have something like Partition component (*or maybe better Partition EIP?*)
> It can be similar to seda, but with following features.
>  * Pluggable PartitionStrategy with pluggable Expression for partition key. Default can be HashPartitionStrategy.
>  * Message will be assigned to Thread based on following algorithm: _target_thread_id = hash % concurrentConsumers_
>  
>  
> *Community feedback/discussion about this feature welcomed.*



--
This message was sent by Atlassian Jira
(v8.20.10#820010)