Confluent::SchemaRegistry - A simple client for interacting with Confluent Schema Registry.
use Confluent::SchemaRegistry; my $sr = Confluent::SchemaRegistry->new( { host => 'https://my-schema-registry.org' } );
Confluent::SchemaRegistry provides a simple way to interact with Confluent Schema Registry (https://docs.confluent.io/current/schema-registry/docs/index.html) enabling writing into Apache Kafka (https://kafka.apache.org/) according to Apache Avro schema specification (https://avro.apache.org/).
Confluent::SchemaRegistry
Full RESTful API documentation of Schema Registry is available here: https://docs.confluent.io/current/schema-registry/docs/api.html?_ga=2.234767710.1188695207.1526911788-1213051144.1524553242#
Avro package is a dependency of Confluent::SchemaRegistry but is not available in CPAN index. Perhaps you may find and download it directly from GitHub repository at https://github.com/apache/avro/tree/master/lang/perl. Please, refer its documentation for installation.
Installation of Kafka::Consumer::Avro is a canonical:
Kafka::Consumer::Avro
perl Makefile.PL make make test make install
Tests expect that in the target host is available Schema Registry listening on http://localhost:8081, otherwise most of the test are skipped.
http://localhost:8081
You can alternatively set a different URL by exporting CONFLUENT_SCHEMA_REGISTY_URL environment variable.
CONFLUENT_SCHEMA_REGISTY_URL
Construct a new Confluent::SchemaRegistry. Takes an optional hash that provides configuration flags for the REST::Client internal object.
The config flags, according to REST::Client::new specs, are:
REST::Client::new
The host at which Schema Registry is listening.
The default is http://localhost:8081
A timeout in seconds for requests made with the client. After the timeout the client will return a 500.
The default is 5 minutes.
The path to a X509 certificate file to be used for client authentication.
The default is to not use a certificate/key pair.
The path to a X509 key file to be used for client authentication.
The path to a certificate authority file to be used to verify host certificates.
The default is to not use a certificates authority.
The path to a PKCS12 certificate to be used for client authentication.
The password for the PKCS12 certificate specified with 'pkcs12'.
Boolean that determins whether REST::Client attempts to automatically follow redirects/authentication.
The default is false.
An LWP::UserAgent object, ready to make http requests.
REST::Client will provide a default for you if you do not set this.
Confluent::SchemRegistry exposes the following methods.
Confluent::SchemRegistry
Returns the body (content) of the last method call to Schema Registry.
Returns the error structure of the last method call to Schema Registry.
Registers a new schema version under a subject.
Returns the generated id for the new schema or undef.
undef
Params keys are:
the name of the Kafka topic
the type of schema ("key" or "value")
the schema to add
...
Alvaro Livraghi, <alvarol@cpan.org>
https://github.com/alivraghi/Confluent-SchemaRegistry
Please use GitHub project link above to report problems or contact authors.
Copyright 2018 by Alvaro Livraghi
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Confluent::SchemaRegistry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Confluent::SchemaRegistry
CPAN shell
perl -MCPAN -e shell install Confluent::SchemaRegistry
For more information on module installation, please visit the detailed CPAN module installation guide.