InfinyOn Cloud Quickstart
This guide will outline using the Fluvio CLI with InfinyOn Cloud or a local Fluvio Cluster.
- Install Fluvio Client (CLI)
- Create an InfinyOn Cloud Account
- Start a Cluster
- Produce & Consume Records
- Use Connectors
- Use StartModules
- Build Stateful Dataflows
Let's get started.
1. Installing Fluvio Client (CLI)
You'll need to download and install the CLI.
$ curl -fsS https://hub.infinyon.cloud/install/install.sh | bash
This command will download the Fluvio Version Manager (fvm), Fluvio CLI (fluvio) and config files into $HOME/.fluvio
, with the executables in $HOME/.fluvio/bin
. To complete the installation, you must add the executables to your shell $PATH
.
2. Create an InfinyOn Cloud Account
Head over to the InfinyOn Cloud sign-up page and create an account. Depending on which method you choose in account creation, you can log in with OAuth2 or username/password.
Login to InfinyOn Cloud using Oauth:
$ fluvio cloud login --use-oauth2
A web browser has been opened at https://infinyon-cloud.us.auth0.com/activate?user_code=GLMC-QDDJ.
Please proceed with authentication.
Or, login with your Username/Password:
$ fluvio cloud login
InfinyOn Cloud email: john@example.com
Password:
3. Start a Cluster
Use Fluvio CLI to start a cluster on InfinyOn Cloud. Start cluster on InfinyOn Cloud (must be logged in as intructed in section 2):
$ fluvio cloud cluster create
Run the following command to check the CLI and the cluster platform versions:
$ fluvio version
4. Produce and Consume records
Create your first topic
Topics are used to store data and send data streams.
You can create a topic with the following command:
$ fluvio topic create quickstart-topic
Where quickstart-topic
is the name of your topic
Read more about Topics in the Fluvio docs.
Produce data to your topic
You can send data (aka produce) to your topic.
Let's try to produce text to your topic interactively:
$ fluvio produce quickstart-topic
> hello world!
Ok!
Typing anything and then pressing Enter
will send a record to your topic.
Press Ctrl+C
to exit the interactive producer prompt.
You may also use the following commands:
$ fluvio produce quickstart-topic
> hello world!
Ok!
Or pipe output to fluvio
:
echo "hello world!" | fluvio produce quickstart-topic
Read more about Producers in the Fluvio docs.
Consume data from your topic
You can read data (aka consume) from your topic.
This command will create a consumer that listens to your topic for new records and then prints it to the screen:
$ fluvio consume quickstart-topic
Consuming records from the end of topic 'quickstart-topic'. This will wait for new records
To see this in action, open another terminal and produce new data.
To see previously sent data, you can add an option to your consume command to request a starting offset with the -B <offset>
flag.
$ fluvio consume quickstart-topic -B -d
hello world!
Flags:
-B
- reads from the beginning of the stream (defaults to0
if no value supplied).-d
- closes the consumer connection after all data has been sent.
Read more about Consumers in the Fluvio docs.
5. Use Connectors
InfinyOn offers a growing number of connectors to communicate with external services.
In this example, we will be covering the HTTP Source connector. The connector polls data from an HTTP endpoint that returns a random quote every 3 seconds to a topic called quotes
.
Save the following configuration file on your machine:
# quotes-source-connector.yml
apiVersion: 0.1.0
meta:
version: x.y.z
name: http-quotes
type: http-source
topic: quotes
http:
endpoint: https://demo-data.infinyon.com/api/quote
interval: 3s
You may run the connector on InfinyOn Cloud, or your local machine.