Since this library does not reside in a Go Proxy repository, you need to use it with Go module's replace
directive. You need to set your go.mod
file as following:
require (
...
github.com/kata-ai/messagebus-golang-kafka v1.1.0
)
replace github.com/kata-ai/messagebus-golang-kafka => ../shared-libs/golang/messagebus-kafka/1.1.0
The replace directive is filled with this library's module name and its relative path to your project.
This library only accept Gogen-avro schema. If you have an Avro schema in a avsc
file, you need to convert it to Gogen-avro schema with these steps:
-
Install Gogen-avro with its installation guide
-
Convert your
avsc
file to Go file with Gogen-avro command:gogen-avro --package=<generated-file-package-name> schemas <schema-directory>
For example, if you have an Avro schema in
schemas/prediction_log.avsc
, you have to execute this command:gogen-avro --package=schemas schemas schemas/prediction_log.avsc
It will create a Go file in
schemas
directory and you can use it with this library.