Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confluent's Avro / Schema Registry support? #119

Closed
simplesteph opened this issue Oct 4, 2017 · 29 comments
Closed

Confluent's Avro / Schema Registry support? #119

simplesteph opened this issue Oct 4, 2017 · 29 comments

Comments

@simplesteph
Copy link

I'd be amazing to have an -avro http://schema-registry-url flag (i.e. confluent's avro) so we can deserialise avro messages while reading a topic

@edenhill
Copy link
Owner

edenhill commented Oct 5, 2017

What would it deserialize to? JSON?

@simplesteph
Copy link
Author

Yes! Similar behaviour as the avro console consumer from confluent

@derekcline
Copy link

This would be a really helpful feature!

@Dabz
Copy link

Dabz commented May 31, 2018

+1

@llofberg
Copy link
Contributor

#151

@gschmutz
Copy link

gschmutz commented Feb 3, 2019

+1

10 similar comments
@lcuquejo
Copy link

+1

@msiddiqi
Copy link

+1

@ehrlichja
Copy link

+1

@anderseriksson
Copy link

+1

@TsuyoshiUshio
Copy link

+1

@dkalcheu
Copy link

+1

@kkoch-od
Copy link

kkoch-od commented Jun 4, 2019

+1

@jboulineau
Copy link

+1

@spoissant
Copy link

+1

@raphaelsolarski
Copy link

+1

@Tempys
Copy link

Tempys commented Jul 2, 2019

so what the status of that ?

@lsimmons2
Copy link

+1

@lsimmons2
Copy link

Unless I'm missing something, seems like this is described as a feature in the README:

Decode Avro key (-s key=avro), value (-s value=avro) or both (-s avro) to JSON using schema from the Schema-Registry:

When I try to run though with kafkacat version 1.4.0 I get the error kafkacat: illegal option -- s.

@llofberg
Copy link
Contributor

llofberg commented Jul 31, 2019

On a Mac with Homebrew you can try editing the kafkacat recipe with brew edit kafkacat as seen below and then reinstall kafkacat with brew install --HEAD kafkacat. You may need to add more dependencies too.

class Kafkacat < Formula
  desc "Generic command-line non-JVM Apache Kafka producer and consumer"
  homepage "https://github.com/edenhill/kafkacat"
  url "https://github.com/edenhill/kafkacat.git",
      :tag      => "1.4.0",
      :revision => "e685f7e05a184e06a9a1a34abffbb3676a2d6f95"
  head "https://github.com/edenhill/kafkacat.git",
      :revision => "6bb21640611621c13bd0567680389b7171286592"

  bottle do
    cellar :any
    sha256 "93f09459a4a835dc4506c78ffd2a22f28a357f1dc359f1083c1a68b6c59e914b" => :mojave
    sha256 "1a22bb79786c31a5c58114b79571171f339b901529e302c3d99311b385075d2a" => :high_sierra
    sha256 "f087b771ff8f6a7de9fa412980b4449139b1130bf1dd8fc0d58380bfcc334551" => :sierra
  end

  depends_on "librdkafka"
  depends_on "yajl"

  def install
    system "./configure", "--prefix=#{prefix}",
                          "--enable-json",
                          "--enable-avro"
    system "make"
    system "make", "install"
  end

  test do
    system bin/"kafkacat", "-X", "list"
  end
end

@TDanielsHL
Copy link

Hi,

I followed the steps above and received the following error:
% ERROR: This build of kafkacat lacks Avro/Schema-Registry support

@colaho
Copy link

colaho commented Aug 15, 2019

Hi,

Got the same error as % ERROR: This build of kafkacat lacks Avro/Schema-Registry support after following the step. Any update on this?

@edenhill
Copy link
Owner

Use docker image edenhill/kafkacat:20190711

@homdoq
Copy link

homdoq commented Aug 21, 2019

docker run -t edenhill/kafkacat:20190711 kafkacat -b <host:port>

on Windows 10, docker desktop v 2.1.0.1 returns error:

Error: -b <broker,..> missing

Usage: kafkacat <options> [file1 file2 .. | topic1 topic2 ..]]
kafkacat - Apache Kafka producer and consumer tool
https://github.com/edenhill/kafkacat
Copyright (c) 2014-2019, Magnus Edenhill
Version 1.4.0 (JSON, Avro, librdkafka 1.1.0 builtin.features=gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins,zstd,sasl_oauthbearer)
...

The same command with 20190709 "works" in that it complains about a missing topic rather than a missing broker (however on 20190709 -L does not work)

@edenhill
Copy link
Owner

@homdoq You shouldn't specify "kafkacat" as an argument, kafkacat is already the entrypoint.

@homdoq
Copy link

homdoq commented Aug 21, 2019

Thanks! I just followed the examples using the confluent image...

@vedal
Copy link

vedal commented Nov 15, 2019

How do you include schema.registry.basic.auth.credentials.source and schema.registry.basic.auth.user.info in the request? there seems only to be the -r option?

@edenhill
Copy link
Owner

Try http://user:pass@srurl:port/

@a6kme
Copy link

a6kme commented Apr 19, 2020

For Confluent Schema registry, you might have to encode the password, since the password might contain URL unsafe characters.

I use https://www.url-encode-decode.com/ to quickly encode the password.

Then you can easily use -r https://USERNAME:URL_ENCODED_PASSWORD@SRURL and it will work like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests