Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 endpoint
        kafkaServerProperties - 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 endpoint
        kafkaServerProperties - 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 connector
        azureConnectionString - 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 model
        consumeTopic - the topic to consume JSON messages from
        produceTopic - 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