Last active
July 7, 2017 04:44
-
-
Save Jayasagar/1394dd4aa92f04627fb60b3996bf1411 to your computer and use it in GitHub Desktop.
Akka Stream Create Partition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Graph<UniformFanOutShape<EventMessage, EventMessage>, NotUsed> eventTypePartition = Partition.create(3, | |
(Function<EventMessage, Object>) tuple -> { | |
switch (tuple.message) { | |
case "EVENT_TYPE_1": | |
return 1; | |
case "EVENT_TYPE_2": | |
return 2; | |
default: | |
return 0; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a 3 partition example.