Class RoundRobinDistributionStrategy


  • public class RoundRobinDistributionStrategy
    extends DistributionStrategy
    Publishing strategy to implement messages in a round robin manner to multiple destinations
    • Constructor Detail

      • RoundRobinDistributionStrategy

        public RoundRobinDistributionStrategy()
    • Method Detail

      • init

        public void init​(io.siddhi.query.api.definition.StreamDefinition streamDefinition,
                         OptionHolder transportOptionHolder,
                         OptionHolder distributionOptionHolder,
                         List<OptionHolder> destinationOptionHolders,
                         ConfigReader configReader)
        Initialize the Distribution strategy with the information it will require to make decisions.
        Specified by:
        init in class DistributionStrategy
        Parameters:
        streamDefinition - The stream attached to the sink this DistributionStrategy is used in
        transportOptionHolder - Sink options of the sink which uses this DistributionStrategy
        destinationOptionHolders - The list of options under @destination of the relevant sink.
        configReader - This hold the RoundRobinDistributionStrategy configuration reader.
        distributionOptionHolder - The option under @destination of the relevant sink.
      • getDestinationsToPublish

        public List<Integer> getDestinationsToPublish​(Object payload,
                                                      DynamicOptions transportOptions)
        This method tells the ID(s) of the destination(s) to which a given messages should be sent. There can be cases where a given message is only sent to a specific destination(e.g., partition based) and message is sent to multiple endpoints(e.g., broadcast)
        Specified by:
        getDestinationsToPublish in class DistributionStrategy
        Parameters:
        payload - payload of the message
        transportOptions - Dynamic transport options of the sink
        Returns:
        Set of IDs of the destination to which the event should be sent