The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Kafka::MockIO - object interface to simulate communications with the Apache Kafka server via socket.

VERSION

This documentation refers to Kafka::MockIO version 1.08 .

DESCRIPTION

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.

EXPORT

Use Kafka::MockIO only with the following information.

The following constants are available for export

$TOPIC

Topic name.

$PARTITION

0 - Partition number.

$KAFKA_MOCK_SERVER_PORT

$KAFKA_MOCK_SERVER_PORT is the default Apache Kafka server port that can be imported from the Kafka module and = 9092.

$KAFKA_MOCK_HOSTNAME

'localhost' - $KAFKA_MOCK_HOSTNAME is the default local host name.

FUNCTIONS

The following methods are defined for the Kafka::MockIO class:

override

Override the Kafka::IO class methods.

restore

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

$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.

This function takes the following arguments:

$encoded_request

Binary string of the encoded request.

special_cases

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

new

Constructor emulation (Kafka::IO-new>).

METHODS

The following methods are defined for the Kafka::MockIO class:

send

Method emulation (Kafka::IO::send).

receive

Method emulation (Kafka::IO::receive).

close

Method emulation (Kafka::IO::close).

DIAGNOSTICS

Error diagnosis emulated methods corresponds to the work of class Kafka::IO.

SEE ALSO

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

SOURCE CODE

Kafka package is hosted on GitHub: https://github.com/TrackingSoft/Kafka

AUTHOR

Sergey Gladkov

CONTRIBUTORS

Alexander Solovey

Jeremy Jordan

Sergiy Zuban

Vlad Marchenko

COPYRIGHT AND LICENSE

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:

Around line 275:

Unknown directive: =rem