README.md
- Project Structure
- Download and set up the Confluent CLI
- Connect to your cluster
- Configuring the project
- Unix Commands Reference table
Let us create our project structure by initializing a directory called kafka-consumer-application and moving into it.
mkdir kafka-consumer-application && cd kafka-consumer-application
Copy the cluster information and paste in a file called ccloud.properties inside the configuration folder.
By now we should have the following structure:
└── configuration
    └── ccloud.properties
To install Confluent CLI run the following command brew install confluentinc/tap/cli
If you don't have Homebrew already installed you can do so by going here https://brew.sh/ .
Let us connect to our Confluent Cloud by running confluent login --save the -- save is just a flag and will save your credentials and log you back in if session expires.
We are now connected and in order to view a list of active environments run confluent environment list.
Select the environment by running confluent environment use .<env-id>
Get the cluster ID previously created at the beginning of the lab by running confluent kafka cluster list.
Select the appropriate cluster by running confluent kafka cluster use .<cluster-id>
If you created your API key using the CLI on another machine or using the UI you need to store it by runnig api-key store <api-key> <api-secret> --resource <resource-id>
If by any chance one was already stored previously we need to ooverride it by using the --force flag at the end of your command api-key store .<api-key> <api-secret> --resource <resource-id> --force
Finnaly set API key to use by running confluent api-key use and you can now run the Confluent CLI commands against the specified cluster.<api-key>
If you already have a topic already created you can view it by running confluent kafka topic list .
Create the following file build.gradle inside the root of your directory.
| Unix Command | Description |
|---|---|
mkdir |
This command is used to create a new directory |
cd |
This command is used to change to a directory |
touch |
This command is used to create an empty file |