Download the PHP package vadimon/kafka-router-for-laravel without Composer

On this page you can find all versions of the php package vadimon/kafka-router-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kafka-router-for-laravel

Laravel router for Kafka messages

Introduction

This package provides a way to route Kafka messages to controllers same way as for web routes.

Installation

Require this package with composer.

Install application service provider and route map file.

Register KafkaRouteServiceProvider in config/app.php

Usage

Consume

This package is aimed only to route messages. You need some other solution to consume message.

Route

Simply pass consumed message to KafkaRoute::dispatch, and it will be routed to controller, specified by route map.

If you consume messages from multiple connections, you can also provide connection name.

Route map

By default, route map is defined in routes/kafka.php. You can override this in KafkaRouterServiceProvider::map() method.

Topics

The handler for messages is defined by KafkaRoute::topic method.

Topic names are case-sensitive. * mean any topic.

Fallback route

Routes are matched in order, in which they are provided. If you need some fallback, put handler for * after all other routes

Connections

You can use KafkaRoute::connection to specify different handlers for different connections.

Connection names are case-sensitive. * mean any connection.

Middleware

You can assign middleware in route table

Groups

Groups allow to specify connection and middleware in one call.

Controller

You can write controllers same way, you write them for HTTP requests. The only difference - you do not need to return anything from controller.

To access message, connection name and router in controller method, you can use Dependency Injection or KafkaRoute facade.

Middleware

You can write middleware same way, you write them for HTTP requests. The only difference - you do not need to return anything from middleware.

Writing middleware

Closure middleware example:

Class middleware example:

Assigning middleware

You can assign middleware in routing table (see above), or in controller constructor, same way this is done in HTTP controllers.


All versions of kafka-router-for-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8
ext-rdkafka Version >=3.1.2
laravel/framework Version ^6.20.1|^7.29.1|^8.12.1|>=9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vadimon/kafka-router-for-laravel contains the following files

Loading the files please wait ....