Skip to content

Commit 8e5c396

Browse files
committed
add exception for unsupported librdkafka version
1 parent a476ec5 commit 8e5c396

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

RdKafkaConnectionFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class RdKafkaConnectionFactory implements ConnectionFactory
3939
*/
4040
public function __construct($config = 'kafka:')
4141
{
42+
if (version_compare(RdKafkaContext::getLibrdKafkaVersion(), '1.0.0', '<')) {
43+
throw new \RuntimeException('You must install librdkafka:1.0.0 or higher');
44+
}
45+
4246
if (empty($config) || 'kafka:' === $config) {
4347
$config = [];
4448
} elseif (is_string($config)) {

0 commit comments

Comments
 (0)