Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ytake/php-ksql
Apache Kafka / Confluent KSQL REST Client for PHP
https://github.com/ytake/php-ksql
kafka ksql php php-library php7
Last synced: about 2 months ago
JSON representation
Apache Kafka / Confluent KSQL REST Client for PHP
- Host: GitHub
- URL: https://github.com/ytake/php-ksql
- Owner: ytake
- License: mit
- Created: 2018-04-27T10:47:10.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2021-09-25T13:48:24.000Z (over 3 years ago)
- Last Synced: 2024-10-04T13:35:08.578Z (3 months ago)
- Topics: kafka, ksql, php, php-library, php7
- Language: PHP
- Homepage:
- Size: 119 KB
- Stars: 18
- Watchers: 78
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ytake\KsqlClient [ytake/php-ksql]
Apache kafka / Confluent KSQL REST Client for php
[![Build Status](http://img.shields.io/travis/ytake/php-ksql/master.svg?style=flat-square)](https://travis-ci.org/ytake/php-ksql)
[![Coverage Status](http://img.shields.io/coveralls/ytake/php-ksql/master.svg?style=flat-square)](https://coveralls.io/github/ytake/php-ksql?branch=master)
[![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/ytake/php-ksql.svg?style=flat-square)](https://scrutinizer-ci.com/g/ytake/php-ksql/?branch=master)
[![StyleCI](https://styleci.io/repos/131283937/shield?branch=master)](https://styleci.io/repos/131283937)[![License](http://img.shields.io/packagist/l/ytake/php-ksql.svg?style=flat-square)](https://packagist.org/packages/ytake/php-ksql)
[![Latest Version](http://img.shields.io/packagist/v/ytake/php-ksql.svg?style=flat-square)](https://packagist.org/packages/ytake/php-ksql)
[![Total Downloads](http://img.shields.io/packagist/dt/ytake/php-ksql.svg?style=flat-square)](https://packagist.org/packages/ytake/php-ksql)## What is KSQL
KSQL is the streaming SQL engine for Apache Kafka.
[What Is KSQL?](https://docs.confluent.io/current/ksql/docs/)
## Install
required >= PHP 7.1
```bash
$ composer require ytake/php-ksql
```## Usage
### Request Preset
| class |
|-------------------------------------|
| Ytake\KsqlClient\Query\CommandStatus |
| Ytake\KsqlClient\Query\Status |
| Ytake\KsqlClient\Query\ServerInfo |
| Ytake\KsqlClient\Query\Ksql |
| Ytake\KsqlClient\Query\Stream (for stream) |[Syntax Reference](https://docs.confluent.io/current/ksql/docs/syntax-reference.html)
### Get Command Status
```php
requestQuery(
new CommandStatus(CommandId::fromString('stream/MESSAGE_STREAM/create'))
)->result();```
### Get Statuses
```php
requestQuery(new Status())->result();```
### Get KSQL Server Information
```php
requestQuery(new ServerInfo())->result();```
### Query KSQL
```php
requestQuery(
new Ksql('DESCRIBE users_original;')
)->result();```
### Client for Stream Response
```php
requestQuery(
new Stream(
'SELECT * FROM testing',
new class() implements StreamConsumable {
public function __invoke(StreamedRow $row)
{
// stream response consumer
}
}
)
)->result();
```