{"id":37098855,"url":"https://github.com/adbourne/go-archetype-kafka-processor","last_synced_at":"2026-01-14T12:01:22.126Z","repository":{"id":57578011,"uuid":"96238445","full_name":"adbourne/go-archetype-kafka-processor","owner":"adbourne","description":"A Golang project archetype for a Kafka processor application","archived":false,"fork":false,"pushed_at":"2017-07-20T19:30:14.000Z","size":3959,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T08:11:04.704Z","etag":null,"topics":["archetype","golang","kafka","kafka-processor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adbourne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-04T16:56:47.000Z","updated_at":"2018-04-26T16:24:52.000Z","dependencies_parsed_at":"2022-09-26T16:40:30.847Z","dependency_job_id":null,"html_url":"https://github.com/adbourne/go-archetype-kafka-processor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/adbourne/go-archetype-kafka-processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbourne%2Fgo-archetype-kafka-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbourne%2Fgo-archetype-kafka-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbourne%2Fgo-archetype-kafka-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbourne%2Fgo-archetype-kafka-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adbourne","download_url":"https://codeload.github.com/adbourne/go-archetype-kafka-processor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adbourne%2Fgo-archetype-kafka-processor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archetype","golang","kafka","kafka-processor"],"created_at":"2026-01-14T12:01:21.505Z","updated_at":"2026-01-14T12:01:22.120Z","avatar_url":"https://github.com/adbourne.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/adbourne/go-archetype-kafka-processor.svg?branch=master)](https://travis-ci.org/adbourne/go-archetype-kafka-processor)\n[![codecov](https://codecov.io/gh/adbourne/go-archetype-kafka-processor/branch/master/graph/badge.svg)](https://codecov.io/gh/adbourne/go-archetype-kafka-processor)\n[![Go Report Card](https://goreportcard.com/badge/github.com/adbourne/go-archetype-kafka-processor)](https://goreportcard.com/report/github.com/adbourne/go-archetype-kafka-processor)\n[![GoDoc](https://godoc.org/github.com/adbourne/go-archetype-kafka-processor?status.svg)](https://godoc.org/github.com/adbourne/go-archetype-kafka-processor)\n\n# go-archetype-kafka-processor\n\nA Golang project archetype for a Kafka Processor.\n\nWhat's a Kafka Processor? It's a headless service that consumes messages from an [Apache Kafka](https://kafka.apache.org/)\ntopic, processes the information in some way and then places the resulting message onto another Kafka topic. In this\ninstance the input message contains a seed number, the processing is generation of a random number using the seed and the resulting\nmessage contains the random number. Combining services such as this together is a trait of a [Reactive System](http://www.reactivemanifesto.org/).\n\nWhy Golang? It's richly-featured, relatively simple to learn, produces tiny binaries, and on average consumes\nfar less memory than a JVM application. This final point, in particular, makes running a system of such services less\nresource intensive and if you're running in the cloud, easier on your bank account.\n\n## Dependency Injection\nGolang makes [dependency injection](https://martinfowler.com/articles/injection.html) relatively straightforward\nout of the box. This is mainly due to the fact that structs do not have to declare they implement an interface,\nthey simply have to have the correct function signatures that interface requires.\n\nThe project has a structure similar to that of a [Spring Boot](https://projects.spring.io/spring-boot/) application,\nbut with the concrete implementations declared in `application_context.go` in the root of the project.\n\n## Health Check Endpoint\nThe application responds on a GET requests to `/health` with the following:\n```\n  {\n    \"status\" : \"ok\"\n  }\n```\nThis is a very simple health check endpoint which can be used by Docker or container orchestrators, such as [Kubernetes](https://kubernetes.io/)\nto signal that the service is available.\n\n## Configuration\nThe application sources configuration from a set of environment variables. This compliments running the application in a Docker\ncontainer rather nicely. For the sake of the archetype, each value has a default value.\n\n| Environment Variable                      | Purpose                                         | Default Value  |\n| -----                                     | -----                                           | -----          |\n| `KAFKA_PROCESSOR_ARCHETYPE_PORT`          | The port to run the HTTP health-check on        | 8080           |\n| `KAFKA_PROCESSOR_ARCHETYPE_RANDOM_SEED`   | The seed to use when generating a random number | 1              |\n| `KAFKA_PROCESSOR_ARCHETYPE_KAFKA_BROKERS` | The comma separated list of Kafka brokers       | localhost:9092 |\n| `KAFKA_PROCESSOR_ARCHETYPE_SOURCE_TOPIC`  | The topic to get messages from                  | source-topic   |\n| `KAFKA_PROCESSOR_ARCHETYPE_SINK_TOPIC`    | The topic to place messages onto                | sink-topic     |\n\n## Building\nThis project uses [make](https://www.gnu.org/software/make/) for building the project. The following make tasks exist:\n```\n# Clean built artefacts\nmake clean\n\n# Build the project\nmake build\n\n# Run the tests\nmake test\n\n# Package as a Docker container\nmake package\n```\n\nIn addition to performing a `go install`, building the project also runs [gofmt](https://golang.org/cmd/gofmt/), [govet](https://golang.org/cmd/vet/), [gocyclo](https://github.com/fzipp/gocyclo), [golint](https://github.com/golang/lint), [ineffassign](https://github.com/gordonklaus/ineffassign) and [misspell](https://github.com/client9/misspell). The build does not fail if these tools report an error; it is up to the Developer if they take the advice. The vendor folder is excluded from the analysis.\n\n\n## Testing\nThe testing library of choice for this project is [Testify](https://github.com/stretchr/testify). Testify is a sturdy, assert style framework. \n\nIn addition to usint tests, this project has integration tests that run against a real instance of Kafka by using the [spotify/kafka](https://hub.docker.com/r/spotify/kafka/) Docker image. The kafka instance is spun up fresh for each integration test and then stopped after.\n\n## Docker\nThe application can be packaged as a Docker container by using the following command:\n\n`make package `\n\nThe container is built on [Alpine Linux](https://alpinelinux.org/) and works out to be about 14MB. The container can be\nrun using the following command:\n\n`docker run -it -p8080:8080 adbourne/go-archetype-kafa-processor`\n\n## Dependency Management\nThis project uses [Govendor](https://github.com/kardianos/govendor).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadbourne%2Fgo-archetype-kafka-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadbourne%2Fgo-archetype-kafka-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadbourne%2Fgo-archetype-kafka-processor/lists"}