Skip to content

Latest commit

 

History

History

quickstart-redpanda-serverless

Quick Start with Redpanda Serverless

This folder contains a variant of the Quick Start SSL app configured to use Redpanda Serverless as the target cluster. You may follow the instructions on Redpanda Docs to perform the following operations:

  • Deploy a Serverless Cluster.
  • Create a user that uses SCRAM-SHA-256 mechanism.
  • Create a topic.
  • Allow All permissions to the user on the topic.
  • Allow All permissions to the user on the consumer group quick-start-group.

The docker-compose.yml file has been revised to realize the integration with Redpanda Serverless 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, and topic name in the adapters.xml through the variable-expansion feature of Lightstreamer:
      ...
      environment:
        - bootstrap_server=${bootstrap_server}
        - username=${username}
        - password=${password}
          # adapters.xml uses env variable "topic_mapping", built from env variable "topic"
        - topic_mapping=map.${topic}.to
      ...
    • Aaption of adapters.xml to include thw following changes:
      • Update of the parameter bootstrap.servers to the environment variable bootstrap_server:

        <param name="bootstrap.servers">$env.bootstrap_server</param>
      • Configuration of the encryption settings:

        <param name="encryption.enable">true</param>
        <param name="encryption.protocol">TLSv1.2</param>
        <param name="encryption.hostname.verification.enable">true</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 --boostrap-servers from the environment variable bootstrap_server
    • Update of the parameter --topic from 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/PLAIN mechanism
    sasl.mechanism=SCRAM-SHA-256
    # 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 follow the command:

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

where:

  • bootstrap_server is the bootstrap server address of the Redpanda cluster.
  • username and password are the credentials of the user created from the Redpanda Console.
  • topic is the name of the topic created on the rpk tool or from the Redpanda Console.

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