php ksql
changed namespace
Apache kafka / Confluent KSQL REST Client for php
KSQL is the streaming SQL engine for Apache Kafka.
What Is KSQL?
required >= PHP 7.1
$ composer require ytake/php-ksql
class |
---|
YtakeKsqlClientQueryCommandStatus |
YtakeKsqlClientQueryStatus |
YtakeKsqlClientQueryServerInfo |
YtakeKsqlClientQueryKsql |
YtakeKsqlClientQueryStream (for stream) |
Syntax Reference
<?php
use YtakeKsqlClientRestClient;
use YtakeKsqlClientQueryCommandStatus;
use YtakeKsqlClientComputationCommandId;
$client = new RestClient(
"http://localhost:8088"
);
$result = $client->requestQuery(
new CommandStatus(CommandId::fromString('stream/MESSAGE_STREAM/create'))
)->result();
<?php
use YtakeKsqlClientRestClient;
use YtakeKsqlClientQueryStatus;
$client = new RestClient(
"http://localhost:8088"
);
$result = $client->requestQuery(new Status())->result();
<?php
use YtakeKsqlClientRestClient;
use YtakeKsqlClientQueryServerInfo;
$client = new RestClient(
"http://localhost:8088"
);
$result = $client->requestQuery(new ServerInfo())->result();
<?php
use YtakeKsqlClientRestClient;
use YtakeKsqlClientQueryKsql;
$client = new RestClient(
"http://localhost:8088"
);
$result = $client->requestQuery(
new Ksql('DESCRIBE users_original;')
)->result();
<?php
use YtakeKsqlClientStreamClient;
use YtakeKsqlClientQueryStream;
use YtakeKsqlClientStreamConsumable;
use YtakeKsqlClientEntityStreamedRow;
$client = new StreamClient(
"http://localhost:8088"
);
$result = $client->requestQuery(
new Stream(
'SELECT * FROM testing',
new class() implements StreamConsumable {
public function __invoke(StreamedRow $row)
{
// stream response consumer
}
}
)
)->result();