Kafka::MockIO - object interface to simulate communications with the Apache Kafka server via socket.
This documentation refers to Kafka::MockIO version 1.08 .
This module is not a user module.
The main features of the Kafka::MockIO class are:
Emulates an object oriented model of communication (Kafka::IO class).
Simplistically emulates interaction with kafka server.
Examples see t/*_mock_io.t.
Use Kafka::MockIO only with the following information.
The following constants are available for export
0 - Partition number.
$KAFKA_MOCK_SERVER_PORT is the default Apache Kafka server port that can be imported from the Kafka module and = 9092.
'localhost' - $KAFKA_MOCK_HOSTNAME is the default local host name.
The following methods are defined for the Kafka::MockIO class:
Override the Kafka::IO class methods.
Restore the Kafka::IO class methods.
add_special_case( $cases )
Adds special cases for use in the simulation of interaction with kafka server.
This function takes the following arguments:
$cases is a reference to the hash representing the special cases.
The keys of the hash should be binary-encoded query string to kafka server. The values of each key must be encoded binary string of the expected response.
del_special_case( $encoded_request )
Removes the special case.
Binary string of the encoded request.
Returns a reference to a hash of special cases.
The keys of the hash are binary strings encoded requests to kafka server. The value of each key is encoded binary string of the expected response.
Constructor emulation (Kafka::IO-new>).
Method emulation (Kafka::IO::send).
Method emulation (Kafka::IO::receive).
Method emulation (Kafka::IO::close).
Error diagnosis emulated methods corresponds to the work of class Kafka::IO.
The basic operation of the Kafka package modules:
Kafka - constants and messages used by the Kafka package modules.
Kafka::Connection - interface to connect to a Kafka cluster.
Kafka::Producer - interface for producing client.
Kafka::Consumer - interface for consuming client.
Kafka::Message - interface to access Kafka message properties.
Kafka::Int64 - functions to work with 64 bit elements of the protocol on 32 bit systems.
Kafka::Protocol - functions to process messages in the Apache Kafka's Protocol.
Kafka::IO - low-level interface for communication with Kafka server.
Kafka::Exceptions - module designated to handle Kafka exceptions.
Kafka::Internals - internal constants and functions used by several package modules.
A wealth of detail about the Apache Kafka and the Kafka Protocol:
Main page at http://kafka.apache.org/
Kafka Protocol at https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol
Kafka package is hosted on GitHub: https://github.com/TrackingSoft/Kafka
Copyright (C) 2012-2016 by TrackingSoft LLC.
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic at http://dev.perl.org/licenses/artistic.html.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =rem
To install Kafka, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.