Package io.siddhi.core.util.transport
Class MultiClientDistributedSink
- java.lang.Object
-
- io.siddhi.core.stream.output.sink.Sink
-
- io.siddhi.core.stream.output.sink.distributed.DistributedTransport
-
- io.siddhi.core.util.transport.MultiClientDistributedSink
-
- All Implemented Interfaces:
SinkListener
public class MultiClientDistributedSink extends DistributedTransport
This is the distributed transport to publish to multiple endpoints using client/publisher for each endpoint. There will be a separate independentSinkinstance connecting to each destination. This class interacts with Sink interface and it does not make any assumptions on the underlying transport implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMultiClientDistributedSink.MultiClientConnectionCallbackConnection callback to notify DistributionStrategy about new connection initiations and failures-
Nested classes/interfaces inherited from class io.siddhi.core.stream.output.sink.distributed.DistributedTransport
DistributedTransport.ConnectionCallback
-
Nested classes/interfaces inherited from class io.siddhi.core.stream.output.sink.Sink
Sink.OnErrorAction
-
-
Field Summary
-
Fields inherited from class io.siddhi.core.stream.output.sink.distributed.DistributedTransport
siddhiAppContext, strategy, streamDefinition
-
Fields inherited from class io.siddhi.core.stream.output.sink.Sink
isTryingToConnect
-
-
Constructor Summary
Constructors Constructor Description MultiClientDistributedSink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()Will be called to connect to the backend before events are publishedvoiddestroy()Will be called at the end to clean all the resources consumedvoiddisconnect()Will be called after all publishing is done, or when ConnectionUnavailableException is thrownprotected ServiceDeploymentInfoexposeServiceDeploymentInfo()Give information to the deployment about the service exposed by the sink.List<ServiceDeploymentInfo>getServiceDeploymentInfoList()Class[]getSupportedInputEventClasses()voidinitTransport(OptionHolder sinkOptionHolder, List<OptionHolder> destinationOptionHolders, Map<String,String> deploymentProperties, List<Map<String,String>> destinationDeploymentProperties, io.siddhi.query.api.annotation.Annotation sinkAnnotation, ConfigReader sinkConfigReader, DistributionStrategy strategy, String type, SiddhiAppContext siddhiAppContext)voidpublish(Object payload, DynamicOptions transportOptions, Integer destinationId, State state)-
Methods inherited from class io.siddhi.core.stream.output.sink.distributed.DistributedTransport
getSupportedDynamicOptions, init, init, isConnected, publish
-
Methods inherited from class io.siddhi.core.stream.output.sink.Sink
connectWithRetry, getHandler, getMapper, getStreamDefinition, getType, init, initOnlyTransport, isStateful, onError, publish, retryPublish, setConnected, shutdown
-
-
-
-
Method Detail
-
publish
public void publish(Object payload, DynamicOptions transportOptions, Integer destinationId, State state) throws ConnectionUnavailableException
- Specified by:
publishin classDistributedTransport- Throws:
ConnectionUnavailableException
-
initTransport
public void initTransport(OptionHolder sinkOptionHolder, List<OptionHolder> destinationOptionHolders, Map<String,String> deploymentProperties, List<Map<String,String>> destinationDeploymentProperties, io.siddhi.query.api.annotation.Annotation sinkAnnotation, ConfigReader sinkConfigReader, DistributionStrategy strategy, String type, SiddhiAppContext siddhiAppContext)
- Specified by:
initTransportin classDistributedTransport
-
getSupportedInputEventClasses
public Class[] getSupportedInputEventClasses()
- Specified by:
getSupportedInputEventClassesin classSink
-
exposeServiceDeploymentInfo
protected ServiceDeploymentInfo exposeServiceDeploymentInfo()
Description copied from class:SinkGive information to the deployment about the service exposed by the sink.- Specified by:
exposeServiceDeploymentInfoin classSink- Returns:
- ServiceDeploymentInfo Service related information to the deployment
-
connect
public void connect() throws ConnectionUnavailableExceptionWill be called to connect to the backend before events are published- Specified by:
connectin classSink- Throws:
ConnectionUnavailableException- if it cannot connect to the backend
-
disconnect
public void disconnect()
Will be called after all publishing is done, or when ConnectionUnavailableException is thrown- Specified by:
disconnectin classSink
-
destroy
public void destroy()
Will be called at the end to clean all the resources consumed
-
getServiceDeploymentInfoList
public List<ServiceDeploymentInfo> getServiceDeploymentInfoList()
- Overrides:
getServiceDeploymentInfoListin classSink
-
-