PHP code example of g41797 / queue-kafka
1. Go to this page and download the library: Download g41797/queue-kafka library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
g41797 / queue-kafka example snippets
[
'bootstrapServers' => 'localhost:9092', // Format `'127.0.0.1:9092,127.0.0.1:9093'` or `['127.0.0.1:9092','127.0.0.1:9093']`
]
// Push a job into the queue and get a message ID.
$id = $queue->push(new SomeJob());
// Get job status.
$status = $queue->status($id);