Apache Kafka 2.0遇到了用户滞后

时间:2018-11-25 14:45:04

标签: apache-kafka

我使用$./airports.py --full {'city': 'London','name': 'Heathrow', 'code': 'LHR'} ... $./airports.py --city --code {'city': 'London', 'code': 'LHR'} ... $./airports.py --city --code --full Error: '--city' and '--code' can't be used with '--full'

,并希望检查Kafka消费者在特定群体的话题上的滞后性

Kafka 2.0.0 (Commit:3402a8361b734732)

但它返回以下错误:

kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --topic imdb.title --zookeeper localhost:2181 --group decisionwanted

如何正确获取此Kafka版本的滞后值?

1 个答案:

答案 0 :(得分:1)

此类显然已在1.0中删除。使用<?php class MBM_Encrypt_Decrypt { const ENCRYPT_METHOD = 'AES-256-CBC'; // type of encryption const SECRET_KEY = '13GsJd6076v69^f4(fdB'; // secret key const SECRET_IV = 'fg3Dk54f4340fKF2JTC9'; // secret iv public function encrypt($string) { return $this->encrypt_decrypt('encrypt', $string); } public function decrypt($string) { return $this->encrypt_decrypt('decrypt', $string); } private function encrypt_decrypt($action, $string) { $key = hash('sha256', self::SECRET_KEY); $iv = substr(hash('sha256', self::SECRET_IV), 0, 16); if ($action == 'encrypt') { $output = openssl_encrypt($string, self::ENCRYPT_METHOD, $key, 0, $iv); } else if ($action == 'decrypt') { $output = openssl_decrypt(base64_decode($string), self::ENCRYPT_METHOD, $key, 0, $iv); } $output = (!empty($output)) ? $output : false; return $output; } } $class_encrypt = new MBM_Encrypt_Decrypt(); $plain_txt = "xyz@abc.com"; echo 'Plain Text: ' . $plain_txt . PHP_EOL; $decrypted_txt = $class_encrypt->decrypt("ZHRodkpCK3R5QXlCMnh3MFdudDh3Zz09"); echo 'Decrypted Text: ' . $decrypted_txt . PHP_EOL; if ($plain_txt === $decrypted_txt) echo 'SUCCESS' . PHP_EOL; else echo 'FAILED' . PHP_EOL; echo PHP_EOL . 'Length of Plain Text: ' . strlen($plain_txt); echo PHP_EOL . 'Length of Encrypted Text: ' . strlen($encrypted_txt). PHP_EOL; 获取消费者组详细信息。