Class KafkaEndpointBuilder
- java.lang.Object
-
- com.scaleoutsoftware.digitaltwin.datasource.kafka.KafkaEndpointBuilder
-
public class KafkaEndpointBuilder extends java.lang.Object
The KafkaEndpointBuilder is used to create an endpoint between a Kafka server and the DigitalTwin execution environment. Ensure that your Kafka distribution's libraries are placed inside the following directory for each SOSS host in the grid: '/soss/install/dir/java_api/lib/Kafka'
For more information regarding Kafka configuration -- please review the soss-jkc-5.8.jar javadoc which is available in the ScaleOut StateServer installation directory.
-
-
Constructor Summary
Constructors Constructor Description KafkaEndpointBuilder(java.lang.String friendlyName, java.io.File kafkaServerProperties)
Instantiates a KafkaEndpointBuilder with server properties to connect to Kafka.KafkaEndpointBuilder(java.lang.String friendlyName, java.lang.String azureConnectionString)
Instantiates a KafkaEndpointBuilder with an azure connection string for connecting to Azure Kafka enabled EventHub.KafkaEndpointBuilder(java.lang.String friendlyName, java.util.HashMap<java.lang.String,java.lang.String> kafkaServerProperties)
Instantiates a KafkaEndpointBuilder with server properties to connect to Kafka.
-
Method Summary
Modifier and Type Method Description KafkaEndpointBuilder
addTopic(java.lang.String dtModel, java.lang.String consumeTopic, java.lang.String produceTopic)
Adds consume and produce data source topics for a DigitalTwin model.KafkaEndpoint
build()
Starts the execution environment which will consume and produce messages from Kafka.
-
-
-
Constructor Detail
-
KafkaEndpointBuilder
public KafkaEndpointBuilder(java.lang.String friendlyName, java.io.File kafkaServerProperties)
Instantiates a KafkaEndpointBuilder with server properties to connect to Kafka.- Parameters:
friendlyName
- the friendly name of this Kafka endpointkafkaServerProperties
- the file to a Kafka server properties
-
KafkaEndpointBuilder
public KafkaEndpointBuilder(java.lang.String friendlyName, java.util.HashMap<java.lang.String,java.lang.String> kafkaServerProperties)
Instantiates a KafkaEndpointBuilder with server properties to connect to Kafka.- Parameters:
friendlyName
- the friendly name of this Kafka endpointkafkaServerProperties
- the file to a Kafka server properties
-
KafkaEndpointBuilder
public KafkaEndpointBuilder(java.lang.String friendlyName, java.lang.String azureConnectionString) throws KafkaDeploymentException
Instantiates a KafkaEndpointBuilder with an azure connection string for connecting to Azure Kafka enabled EventHub.- Parameters:
friendlyName
- the friendly name of this connectorazureConnectionString
- the azure connection string used to initialize this connector grid.- Throws:
KafkaDeploymentException
- if an exception occurs when creating the connection or if an exception occurs when connecting to Kafka
-
-
Method Detail
-
addTopic
public KafkaEndpointBuilder addTopic(java.lang.String dtModel, java.lang.String consumeTopic, java.lang.String produceTopic)
Adds consume and produce data source topics for a DigitalTwin model.- Parameters:
dtModel
- the DigitalTwin modelconsumeTopic
- the topic to consume JSON messages fromproduceTopic
- the topic to produce JSON messages to- Returns:
- this builder
-
build
public KafkaEndpoint build() throws KafkaDeploymentException
Starts the execution environment which will consume and produce messages from Kafka.- Returns:
- the KafkaEndpoint
- Throws:
KafkaDeploymentException
- if an exception occurs when creating the ExecutionEnvironment or a connection exception occurs when connecting to Kafka
-
-