Class RoundRobinDistributionStrategy
- java.lang.Object
-
- io.siddhi.core.stream.output.sink.distributed.DistributionStrategy
-
- io.siddhi.core.stream.output.sink.distributed.RoundRobinDistributionStrategy
-
public class RoundRobinDistributionStrategy extends DistributionStrategy
Publishing strategy to implement messages in a round robin manner to multiple destinations
-
-
Constructor Summary
Constructors Constructor Description RoundRobinDistributionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voidinit(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.-
Methods inherited from class io.siddhi.core.stream.output.sink.distributed.DistributionStrategy
destinationAvailable, destinationFailed, getActiveDestinationCount
-
-
-
-
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:
initin classDistributionStrategy- Parameters:
streamDefinition- The stream attached to the sink this DistributionStrategy is used intransportOptionHolder- Sink options of the sink which uses this DistributionStrategydestinationOptionHolders- The list of options under @destination of the relevant sink.configReader- This hold theRoundRobinDistributionStrategyconfiguration 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:
getDestinationsToPublishin classDistributionStrategy- Parameters:
payload- payload of the messagetransportOptions- Dynamic transport options of the sink- Returns:
- Set of IDs of the destination to which the event should be sent
-
-