Kafka Self-Service Actions
Port manages a Kafka Topic per customer that publishes the execution run requests.
You can listen to a Kafka Topic with any code platform you wish to use, and also use it as a trigger for a serverless function. For example, AWS Lambda.
The steps shown in the image above are as follows:
- Port publishes an invoked
Action
orChange
message to Kafka; - A secure Kafka topic holds all of the action invocations and changes;
The actions and changes topics are separated, their formats are:
- Action Topic -
ORG_ID.runs
- Changes Topic -
ORG_ID.change.log
As part of the setup, you will need to create a consumer group that listens to the topics. The consumer group id can be one of:
- Any group name with a prefix of your org id, for example
ORG_ID.my-group-name
- A group name that matches your username provided by Port
- A listener implemented on the Client side receives the new topic message and runs code defined by the DevOps team.
The listener can be anything that can read from a Kafka topic and run code based on the received message, for example:
- AWS Lambda;
- Python code that reads from the topic;
- Docker container running code.
You control how you interact with these topics, in the way that best suits your organization and infrastructure.
An example flow would be:
- A developer asks to deploy a new version of an existing
Microservice
; - The
create
action is sent to theruns
Kafka topic; - An AWS Lambda function is triggered by this new action message;
- The Lambda function deploys a new version of the service;
- When the Lambda is done, it reports back to Port about the new Microservice
Deployment
.
Examples
For guides and examples of self-service actions using Kafka as the backend, check out the guides section.