Skip to main content

Quickstart

In this Quickstart we will set up our first source, listen to conversations, and consume directly from Kafka.

We are going to use Airy's Live Chat Plugin as our first source. We then use the plugin to send messages, and check them out in the UI, your terminal and directly in Apache Kafka.

Did you already install the Airy CLI?

To get going with the Quickstart, you must install Airy first. Once the CLI is up and running you are good to go.


note

The Quickstart guide explains setting up and using the Chatplugin source which is enabled by default.

To enable and use other sources, please refer to our Sources documentation.

Step 1: How to setup your first source

The Airy Live Chat Plugin source is well suited for a first integration because it does not require any configuration.

curl -H "Content-Type: application/json" -d \
"{
\"name\": \"chat plugin source\"
}" http://localhost/channels.chatplugin.connect
channels_connect

The ID from the response is the channel_id. It is required for the next steps, so note it down.

Step 2: Send messages via the Chat Plugin

Pass the channel_id as a query parameter when opening the demo page in your browser. This authenticates the chat plugin and enables you to send messages immediately:

http://localhost/chatplugin/ui/example?channel_id=<channel_id>

You can now type a message in the text box and send it 🎉

chatplugin working

Step 3: Use the HTTP API to list conversations

To see how messages are flowing through the system, list conversations for the channel you have just created. It should return the message you have just sent. Make sure that you have the jq binary installed.

curl -XPOST http://localhost/conversations.list | jq .
conversations.list

Step 4: Consume directly from Apache Kafka

Get a shell to the running kafka-0 container:

kubectl exec -it kafka-0 -- /bin/bash

Then you can consume the events of the application.communication.messages topic directly from the kafka-0 container shell:

kafka-console-consumer.sh \
--bootstrap-server localhost:9092 \
--topic application.communication.messages \
--from-beginning
Kafka Topic