Skip to content

Latest commit

 

History

History
114 lines (85 loc) · 4.56 KB

File metadata and controls

114 lines (85 loc) · 4.56 KB

Axual Quickstart

This folder contains a variant of the SSL Quickstart app configured to use a shared test cluster from Axual Platform as the target Kafka cluster. You may follow the Getting started on the Axual site to perform the following operations:

  • Add a new topic stocks with:
    • String key type
    • JSON value type
    • delete retention policy
    • 1 partition
    • 1 day of retention time
  • Add a new application with:
    • ID: stocks-application
    • Name: stocks-application
    • Short name: stocks_app
    • Application type: Java
    • Visibility: Private
  • Generate a new authentication credentials and take note of them.
  • Authorize the application to consume and produce data from/to the stocks topic.

The docker-compose.yml file has been revised to realize the integration with Axual Platform as follows:

  • Removal of the broker service, because replaced by the remote cluster

  • kafka-connector:

    • Definition of new environment variables to configure remote endpoint, credentials, topic name, and consumer group in the adapters.xml through the variable-expansion feature of Lightstreamer:

      ...
      environment:
        - bootstrap_server=${bootstrap_server}
        - username=${username}
        - password=${password}
        - group_id=${group_id}
        - topic_mapping=map.${topic}.to
      ...
    • Adaption of adapters.xml to include the following changes:

      • Update of the parameter bootstrap.servers to the environment variable bootstrap_server:

        <param name="bootstrap.servers">$env.bootstrap_server</param>
      • Update of the parameter group.id to the the environment variable group_id:

        <param name="group.id">$env.group_id</param>
      • Configuration of the encryption settings:

        <param name="encryption.enable">true</param>
        <param name="encryption.protocol">TLSv1.3</param>
        <param name="encryption.hostname.verification.enable">false</param>
      • Configuration of the authentication settings, with the credentials retrieved from environment variables username and password:

        <param name="authentication.enable">true</param>
        <param name="authentication.mechanism">SCRAM-SHA-256</param>
        <param name="authentication.username">$env.username</param>
        <param name="authentication.password">$env.password</param>
      • Update of the parameter map.<topic>.to to the environment variable topic_mapping (which in turn is composed from env variable topic):

        <param name="$env.topic_mapping">item-template.stock</param>
  • producer:

    • Update of the parameter --bootstrap-servers to the environment variable bootstrap_server

    • Update of the parameter --topic to the environment variable topic

    • Provisioning of the producer.properties configuration file to enable SASL/SCRAM over TLS, with username and password retrieved from the environment variables username and password:

      # Configure SASL/SCRAM mechanism
      sasl.mechanism=SCRAM-SHA-512
      # Enable SSL encryption
      security.protocol=SASL_SSL
      # JAAS configuration
      sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${username}" password="${password}";

Run

From this directory, run the following command:

$ bootstrap_server=<bootstrap_server> \
  group_id=<group_id> username=<username> \
  password=<password> \
  topic=<topic> \
  ./start.sh

where:

  • <bootstrap_server> - The bootstrap server address of the Axual cluster
  • <group_id> - The consumer group ID
  • <username> and <password> - The authentication credentials
  • <topic> - The name of the topic

Tip

You can get the correct values for bootstrap_server, group_id, and topic by looking at the Cluster connectivity Information of the stocks-application from the Axual Self-service portal.

Then, point your browser to http://localhost:8080/QuickStart.