0.3.3 • Published 3 years ago

@halcyon-agile/adonis-kafka v0.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

npm-image license-image synk-image

API is based on https://github.com/Frubana/adonis-kafka and depends on kafkajs

Getting Started

Let's start by installing the package in our project.

Yarn:

yarn add @halcyon-agile/adonis-kafka

NPM:

npm install @halcyon-agile/adonis-kafka

Setup

You can configure the project by running the following command:

node ace invoke @halcyon-agile/adonis-kafka

Adding Topics

node ace make:prldfile kafka
// start/kafka.ts
import Kafka from '@ioc:Kafka'

// Callback function
Kafka.on('topic_name', async (data, commit) => {
  commit() // For successful transaction
  commit(false) // For failed transaction
})

// Multiple topics
Kafka.on('topic_name_1,topic_name_2,topic_name_3', async (data, commit) => {
  commit() // For successful transaction
  commit(false) // For failed transaction
})
0.3.2

3 years ago

0.3.1

3 years ago

0.3.3

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.1

3 years ago

0.1.1-1

3 years ago

0.1.1-0

3 years ago