Hi,

not sure if you have solved this already, but one idea comes to my mind,
where your partitioner would inject a marker which would tell which part of
the stream you need to consume next when merging. This means that at the
partitioner side you would have to buffer at least two elements (hold on to
the one, that will carry the merge marker, and another one that the marker
applies). This approach would apply when the elements in the stream carry
no data which can be used to order them.

On Wed, Dec 13, 2017 at 12:54 AM, Charlie <charlieevansvimpel...@gmail.com>
wrote:

> Hello,
>
> I'm trying to use Akka streams to split a stream into two then merge the
> results back into one stream, keeping the order. I cannot keep the ordering
> and started to work on a custom GraphStage but not sure if that can work
> for me either.
>
> A simplified version of what I'm trying to achieve is here:
> https://gist.github.com/chaz2505/ce5bc170d483f95faa9156b04230372f, I
> would like the logs to print 100,2,300,4,500,6 but currently getting
> 100,300,500,2,4,6.
> I make use of PartitionWith from akka stream contrib.
>
> For background: My use case is with kafka, I want to split a stream into
> two based on the message content, do some async processing on each
> sub-stream, then merge back to commit the messages (this is why I need the
> ordering). The async processing is represented by separate flows (one of
> which I reuse from another project).
>
> Any help would be greatly appreciated.
>
> Thanks,
>
> Charlie
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Akka Team
Lightbend <http://www.lightbend.com/> - Reactive apps on the JVM
Twitter: @akkateam

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to