kafka-consume

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README


{ "image": "direktiv/kafka-consume", "desc": "Consume messages from a Kafka service" }

Kafka

Consumes messages from a Kafka service

Direktiv

An example workflow of consuming from a Kafka service.

id: kafka
functions:
- id: kafka-consume
  image: direktiv/kafka-consume:v1
description: "Read messages from a Kafka service"
states:
- id: readmsg
  type: action
  action:
    function: kafka-consume
    input: jq(.)

Input

Consume messages from a Kafka service hosted on the address. The property timeout is optional(default=1000) and is the amount of time in milliseconds to consume messages.

input:
  topic: "quickstart-events"
  partition: 0
  address: "localhost:9092"
  timeout: 1000

Output

If the output is successful, the messages consumed will be returned as a string array.

{
	"return": {
		"messages": [
			"Hello World :)!",
			"Goodbye"
		]
	}
}

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.kafka-consume.error",
    "errorMsg": "Something went wrong"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL