From a194e575afeb700f34a26c078090bd4df5b6d891 Mon Sep 17 00:00:00 2001 From: jordan brooks Date: Wed, 28 Feb 2024 13:33:57 +0000 Subject: [PATCH 1/7] Adds license to project.clj --- project.clj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/project.clj b/project.clj index 82051c84..550b5b45 100644 --- a/project.clj +++ b/project.clj @@ -1,6 +1,8 @@ (defproject fundingcircle/jackdaw "_" :description "A Clojure library for the Apache Kafka distributed streaming platform." + :license {:name "BSD 3-clause" :url "http://opensource.org/licenses/BSD-3-Clause"} + :scm {:name "git" :url "https://github.com/fundingcircle/jackdaw"} :url "https://github.com/FundingCircle/jackdaw/" @@ -33,12 +35,13 @@ :aliases {"kaocha" ["run" "-m" "kaocha.runner"]} :aot [jackdaw.serdes.edn2 jackdaw.serdes.fressian jackdaw.serdes.fn-impl] - :plugins [[me.arrdem/lein-git-version "2.0.8"]] + :plugins [[me.arrdem/lein-git-version "2.0.8"] + [com.github.clj-kondo/lein-clj-kondo "0.2.5"]] :git-version {:status-to-version (fn [{:keys [tag branch ahead? dirty?] :as git}] - (if (and tag (not ahead?) (not dirty?)) + (if (and tag (not ahead?) (not dirty?) (= "master" branch)) tag (let [[_ prefix patch] (re-find #"(\d+\.\d+)\.(\d+)" tag) patch (Long/parseLong patch) From 0ae72f1f095312e218fe89d7c0db206d5221d8bc Mon Sep 17 00:00:00 2001 From: jordan brooks Date: Wed, 28 Feb 2024 13:34:56 +0000 Subject: [PATCH 2/7] Use env vars for host resolution in tests --- test/jackdaw/client/partitioning_test.clj | 5 +-- test/jackdaw/client_test.clj | 5 +-- test/jackdaw/serdes/avro/integration_test.clj | 9 ++--- test/jackdaw/serdes/avro_test.clj | 5 +-- .../serdes/json_schema/confluent_test.clj | 3 +- test/jackdaw/test/commands/write_test.clj | 2 +- test/jackdaw/test/fixtures_test.clj | 33 ++++++++++--------- test/jackdaw/test/transports/kafka_test.clj | 5 +-- test/jackdaw/test/transports/mock_test.clj | 11 ++++--- .../test/transports/rest_proxy_test.clj | 9 ++--- test/jackdaw/test_test.clj | 13 ++++---- test/jackdaw/utils.clj | 17 ++++++++++ 12 files changed, 72 insertions(+), 45 deletions(-) create mode 100644 test/jackdaw/utils.clj diff --git a/test/jackdaw/client/partitioning_test.clj b/test/jackdaw/client/partitioning_test.clj index 166335cb..a4f2065f 100644 --- a/test/jackdaw/client/partitioning_test.clj +++ b/test/jackdaw/client/partitioning_test.clj @@ -2,7 +2,8 @@ (:require [clojure.test :refer [deftest is testing]] [jackdaw.client :as client] - [jackdaw.client.partitioning :as part])) + [jackdaw.client.partitioning :as part] + [jackdaw.utils :as utils])) (set! *warn-on-reflection* false) @@ -22,7 +23,7 @@ (deftest test->ProducerRecord - (with-open [p (client/producer {"bootstrap.servers" "localhost:9092" + (with-open [p (client/producer {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "key.serializer" "org.apache.kafka.common.serialization.StringSerializer" "value.serializer" "org.apache.kafka.common.serialization.StringSerializer"})] (testing "absent key-fn" diff --git a/test/jackdaw/client_test.clj b/test/jackdaw/client_test.clj index 9e2eee14..20b3f67f 100644 --- a/test/jackdaw/client_test.clj +++ b/test/jackdaw/client_test.clj @@ -4,6 +4,7 @@ [jackdaw.client :as client] [jackdaw.test.fixtures :as fix] [jackdaw.test.serde :as serde] + [jackdaw.utils :as utils] [jackdaw.data :as data]) (:import [java.util.concurrent LinkedBlockingQueue TimeUnit] java.time.Duration @@ -40,7 +41,7 @@ "high-partition-topic" high-partition-topic}) (defn broker-config [] - {"bootstrap.servers" "localhost:9092"}) + {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092")}) (defn producer-config [] (-> (broker-config) @@ -159,7 +160,7 @@ (deftest ^:integration consumer-test (let [config {"group.id" "jackdaw-client-test-consumer-test" - "bootstrap.servers" "localhost:9092" + "bootstrap.servers" "kafka:9092" "key.deserializer" "org.apache.kafka.common.serialization.StringDeserializer" "value.deserializer" "org.apache.kafka.common.serialization.StringDeserializer"} key-serde (:key-serde foo-topic) diff --git a/test/jackdaw/serdes/avro/integration_test.clj b/test/jackdaw/serdes/avro/integration_test.clj index 1349777f..1acd7293 100644 --- a/test/jackdaw/serdes/avro/integration_test.clj +++ b/test/jackdaw/serdes/avro/integration_test.clj @@ -8,13 +8,14 @@ [jackdaw.data :as jd] [jackdaw.serdes.avro :as avro] [jackdaw.serdes.avro.schema-registry :as reg] - [jackdaw.test.fixtures :as fix]) + [jackdaw.test.fixtures :as fix] + [jackdaw.utils :as utils]) (:import [org.apache.kafka.common.serialization Serde Serdes])) (set! *warn-on-reflection* false) (def +real-schema-registry-url+ - "http://localhost:8081") + (format "http://%s:8081" (utils/schema-registry-host))) (def +type-registry+ (merge avro/+base-schema-type-registry+ @@ -65,8 +66,8 @@ "A Kafka consumer or streams config." (let [id (str "dev-" (java.util.UUID/randomUUID))] {"replication.factor" "1", "group.id" id, "application.id" id, - "bootstrap.servers" "localhost:9092" - "zookeeper.connect" "localhost:2181" + "bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + "zookeeper.connect" (str (utils/zookeeper-host) ":2181") "request.timeout.ms" "1000"})) ;;;; Schemas diff --git a/test/jackdaw/serdes/avro_test.clj b/test/jackdaw/serdes/avro_test.clj index 7f4d4a2b..61a26dbc 100644 --- a/test/jackdaw/serdes/avro_test.clj +++ b/test/jackdaw/serdes/avro_test.clj @@ -4,7 +4,8 @@ [clojure.data :refer [diff]] [clojure.data.json :as json] [jackdaw.serdes.avro :as avro] - [jackdaw.serdes.avro.schema-registry :as reg]) + [jackdaw.serdes.avro.schema-registry :as reg] + [jackdaw.utils :as utils]) (:import [java.nio ByteBuffer] [java.util Collection] [org.apache.avro Schema$Parser Schema] @@ -46,7 +47,7 @@ serde-config) schema-registry-config {:avro.schema-registry/client registry-client - :avro.schema-registry/url "localhost:8081"}] + :avro.schema-registry/url (str (utils/schema-registry-host) ":8081")}] (avro/serde +registry+ schema-registry-config serde-config)))) (defn deserialize [serde topic x] diff --git a/test/jackdaw/serdes/json_schema/confluent_test.clj b/test/jackdaw/serdes/json_schema/confluent_test.clj index 1eb6e9e1..410c8503 100644 --- a/test/jackdaw/serdes/json_schema/confluent_test.clj +++ b/test/jackdaw/serdes/json_schema/confluent_test.clj @@ -1,6 +1,7 @@ (ns jackdaw.serdes.json-schema.confluent-test (:require [jackdaw.serdes.json-schema.confluent :as jsco] [jackdaw.serdes.avro.schema-registry :as reg] + [jackdaw.utils :as utils] [clojure.data.json :as json] [clojure.test :refer [deftest is testing] :as test])) @@ -15,7 +16,7 @@ {"json.fail.invalid.schema" false} :serializer-properties {"json.fail.invalid.schema" false}}))) - schema-registry-url "localhost:8081" + schema-registry-url (str (utils/schema-registry-host) ":8081") key? false] (jsco/serde schema-registry-url schema-str key? serde-config)))) diff --git a/test/jackdaw/test/commands/write_test.clj b/test/jackdaw/test/commands/write_test.clj index 51eae7d1..d4ac8119 100644 --- a/test/jackdaw/test/commands/write_test.clj +++ b/test/jackdaw/test/commands/write_test.clj @@ -40,7 +40,7 @@ :key-serde :long :value-serde :json})) -(def kafka-config {"bootstrap.servers" "localhost:9092" +(def kafka-config {"bootstrap.servers" "kafka:9092" "group.id" "kafka-write-test"}) (defn with-transport diff --git a/test/jackdaw/test/fixtures_test.clj b/test/jackdaw/test/fixtures_test.clj index 5825623d..72160dd5 100644 --- a/test/jackdaw/test/fixtures_test.clj +++ b/test/jackdaw/test/fixtures_test.clj @@ -1,7 +1,8 @@ (ns jackdaw.test.fixtures-test (:require [clojure.test :refer [deftest is]] - [jackdaw.test.fixtures :refer [list-topics reset-application-fixture topic-fixture with-fixtures]]) + [jackdaw.test.fixtures :refer [list-topics reset-application-fixture topic-fixture with-fixtures]] + [jackdaw.utils :as utils]) (:import (org.apache.kafka.clients.admin AdminClient))) @@ -14,7 +15,7 @@ :config {}}) (def kafka-config - {"bootstrap.servers" "localhost:9092"}) + {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092")}) (def test-topics (let [topics {"foo" topic-foo}] @@ -61,18 +62,18 @@ :reset-fn (fn [reset-args rt args] (reset! reset-args [rt args]) 0)} - (fn [{:keys [resetter reset-args error-data]}] - (is (instance? kafka.tools.StreamsResetter resetter)) - (is (= ["--application-id" "yolo" - "--bootstrap-servers" "kafka.test:9092" - "--foo" "foo" - "--bar" "bar"] - reset-args)) - (is (empty? error-data))))) + (fn [{:keys [resetter reset-args error-data]}] + (is (instance? kafka.tools.StreamsResetter resetter)) + (is (= ["--application-id" "yolo" + "--bootstrap-servers" "kafka.test:9092" + "--foo" "foo" + "--bar" "bar"] + reset-args)) + (is (empty? error-data))))) (deftest test-reset-application-fixture-failure (test-resetter {:app-config {"application.id" "yolo" - "bootstrap.servers" "kafka.test:9092"} + "bootstrap.servers" (str (utils/bootstrap-servers) ":9092")} :reset-params ["--foo" "foo" "--bar" "bar"] :reset-fn (fn [reset-args rt args] @@ -80,8 +81,8 @@ (.write *err* "helpful error message\n") (.write *out* "essential application info\n") 1)} - (fn [{:keys [resetter error-data]}] - (is (instance? kafka.tools.StreamsResetter resetter)) - (is (= 1 (:status error-data))) - (is (= "helpful error message\n" (:err error-data))) - (is (= "essential application info\n" (:out error-data)))))) + (fn [{:keys [resetter error-data]}] + (is (instance? kafka.tools.StreamsResetter resetter)) + (is (= 1 (:status error-data))) + (is (= "helpful error message\n" (:err error-data))) + (is (= "essential application info\n" (:out error-data)))))) diff --git a/test/jackdaw/test/transports/kafka_test.clj b/test/jackdaw/test/transports/kafka_test.clj index aa100db5..bd08d572 100644 --- a/test/jackdaw/test/transports/kafka_test.clj +++ b/test/jackdaw/test/transports/kafka_test.clj @@ -8,17 +8,18 @@ [jackdaw.test.journal :refer [watch-for]] [jackdaw.test.serde :as serde] [jackdaw.test.transports.kafka] + [jackdaw.utils :as utils] [manifold.stream :as s])) (set! *warn-on-reflection* false) -(def kafka-config {"bootstrap.servers" "localhost:9092" +(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "group.id" "kafka-write-test"}) (defn kstream-config [app app-id] {:topology app - :config {"bootstrap.servers" "localhost:9092" + :config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "application.id" app-id}}) (defn echo-stream diff --git a/test/jackdaw/test/transports/mock_test.clj b/test/jackdaw/test/transports/mock_test.clj index 92022127..af15f194 100644 --- a/test/jackdaw/test/transports/mock_test.clj +++ b/test/jackdaw/test/transports/mock_test.clj @@ -7,10 +7,11 @@ [jackdaw.test :as jd.test] [jackdaw.test.transports :as trns] [jackdaw.test.serde :as serde] + [jackdaw.utils :as utils] [manifold.stream :as s]) (:import - (java.util Properties) - (org.apache.kafka.streams TopologyTestDriver Topology))) + (java.util Properties) + (org.apache.kafka.streams TopologyTestDriver Topology))) (set! *warn-on-reflection* false) @@ -46,8 +47,8 @@ [f app-config] (let [builder (k/streams-builder) ^Topology topology (let [builder (f builder)] - (-> (k/streams-builder* builder) - (.build))) + (-> (k/streams-builder* builder) + (.build))) ^Properties props (let [props (Properties.)] (doseq [[k v] app-config] (.setProperty props k v)) @@ -58,7 +59,7 @@ [] (trns/transport {:type :mock :driver (test-driver (echo-stream test-in test-out) - {"bootstrap.servers" "localhost:9092" + {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "application.id" "test-echo-stream"}) :topics {"test-in" test-in "test-out" test-out}})) diff --git a/test/jackdaw/test/transports/rest_proxy_test.clj b/test/jackdaw/test/transports/rest_proxy_test.clj index fd0b916a..a8d48060 100644 --- a/test/jackdaw/test/transports/rest_proxy_test.clj +++ b/test/jackdaw/test/transports/rest_proxy_test.clj @@ -11,16 +11,17 @@ [jackdaw.test.journal :refer [watch-for]] [jackdaw.test.transports :as trns] [jackdaw.test.transports.rest-proxy :as proxy] + [jackdaw.utils :as utils] [manifold.stream :as s] [manifold.deferred :as d])) (set! *warn-on-reflection* false) -(def kafka-config {"bootstrap.servers" "localhost:9092" +(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "group.id" "kafka-write-test"}) (def +real-rest-proxy-url+ - "http://localhost:8082") + "http://kafka-rest:8082") (defn rest-proxy-config [group-id] @@ -30,7 +31,7 @@ (defn kstream-config [app app-id] {:topology app - :config {"bootstrap.servers" "localhost:9092" + :config {"bootstrap.servers" "kafka:9092" "application.id" app-id}}) (defn echo-stream @@ -173,7 +174,7 @@ :consumer.fetch.timeout.ms 200}))) (proxy/with-consumer)) [url options] (first @http-reqs)] - (is (= "http://localhost:8082/consumers/test-group-config" url)) + (is (= "http://kafka-rest:8082/consumers/test-group-config" url)) (is (= {"Accept" "application/vnd.kafka.v2+json" "Content-Type" "application/vnd.kafka.v2+json"} (:headers options))) diff --git a/test/jackdaw/test_test.clj b/test/jackdaw/test_test.clj index b188b145..737ca6ad 100644 --- a/test/jackdaw/test_test.clj +++ b/test/jackdaw/test_test.clj @@ -7,7 +7,8 @@ [jackdaw.test.fixtures :as fix] [jackdaw.test.serde :as serde] [jackdaw.test.transports :as trns] - [jackdaw.test.middleware :refer [with-status]])) + [jackdaw.test.middleware :refer [with-status]] + [jackdaw.utils :as utils])) (set! *warn-on-reflection* false) @@ -32,7 +33,7 @@ :key-serde :string :value-serde :json})) -(def kafka-config {"bootstrap.servers" "localhost:9092" +(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "group.id" "kafka-write-test"}) (defn kafka-transport @@ -234,7 +235,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (echo-stream test-in test-out) - {"bootstrap.servers" "localhost:9092" + {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "application.id" "test-echo-stream"}) :topics {:in test-in :out test-out}}) @@ -258,7 +259,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (bad-topology test-in test-out) - {"bootstrap.servers" "localhost:9092" + {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "application.id" "test-echo-stream"}) :topics {:in test-in :out test-out}}) @@ -280,7 +281,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (echo-stream test-in test-out) - {"bootstrap.servers" "localhost:9092" + {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "application.id" "test-echo-stream"}) :topics {:in test-in :out test-out}}) @@ -302,7 +303,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (echo-stream test-in test-out) - {"bootstrap.servers" "localhost:9092" + {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "application.id" "test-echo-stream"}) :topics {:in test-in :out test-out}}) diff --git a/test/jackdaw/utils.clj b/test/jackdaw/utils.clj new file mode 100644 index 00000000..1bef7fe9 --- /dev/null +++ b/test/jackdaw/utils.clj @@ -0,0 +1,17 @@ +(ns jackdaw.utils) + +(defn bootstrap-servers + [] + (or (System/getenv "KAFKA_BOOTSTRAP_SERVERS") "localhost")) + +(defn zookeeper-host + [] + (or (System/getenv "ZOOKEEPER_HOST") "localhost")) + +(defn schema-registry-host + [] + (or (System/getenv "SCHEMA_REGISTRY_HOST") "localhost")) + +(defn kafka-rest-proxy-host + [] + (or (System/getenv "KAFKA_REST_PROXY_HOST") "localhost")) \ No newline at end of file From 4409f80f6910a0c62e0761d2433497792ae8a5b5 Mon Sep 17 00:00:00 2001 From: jordan brooks Date: Wed, 28 Feb 2024 13:35:31 +0000 Subject: [PATCH 3/7] Setup github action workflows --- .github/workflows/build.yaml | 9 +++++ .github/workflows/deploy.yaml | 35 ++++++++++++++++++ .github/workflows/run_checks.yaml | 59 +++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/run_checks.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..903c9672 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,9 @@ +run-name: Run Build + +on: + push + +jobs: + run_checks: + uses: ./.github/workflows/run_checks.yaml + \ No newline at end of file diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..3b3de1f0 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,35 @@ +run-name: Jackdaw build + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '*publish-snapshot*' + +jobs: + run_checks: + uses: ./.github/workflows/run_checks.yaml + deploy: + needs: run_checks + runs-on: ubuntu-latest + container: + image: clojure:latest + environment: clojars_deploy + steps: + - name: checkout + uses: actions/checkout@v4 + - name: deploy + env: + CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} + CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + run: | + # https://github.com/actions/runner/issues/2033 + git config --global --add safe.directory /__w/jackdaw/jackdaw + apt-get update + apt-get install -y gpg + echo $GPG_PRIVATE_KEY |base64 --decode |gpg --yes --batch --import + export LEIN_GPG=/__w/jackdaw/jackdaw/.circleci/bin/gpg + export REAL_GPG=$(which gpg) + lein do jar, pom, deploy clojars + diff --git a/.github/workflows/run_checks.yaml b/.github/workflows/run_checks.yaml new file mode 100644 index 00000000..9b04502b --- /dev/null +++ b/.github/workflows/run_checks.yaml @@ -0,0 +1,59 @@ +run-name: Run checks + +on: + workflow_call: + +jobs: + RunChecks: + runs-on: ubuntu-latest + container: + image: clojure:latest + options: --user 1001 # don't run as root + services: + kafka: + image: confluentinc/cp-kafka:5.1.3 + env: + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_AUTO_CREATE_TOPICS_ENABLE: true + KAFKA_BROKER_ID: 1 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 + KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 + KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 + schema-registry: + image: confluentinc/cp-schema-registry:5.1.2 + env: + SCHEMA_REGISTRY_HOST_NAME: schema-registry + SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181' + kafka-rest: + image: confluentinc/cp-kafka-rest:6.1.1 + env: + KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_REST_BOOTSTRAP_SERVERS: kafka:9092 + KAFKA_REST_LISTENERS: http://0.0.0.0:8082 + KAFKA_REST_SCHEMA_REGISTRY: http://schema-registry:8081 + KAFKA_REST_HOST_NAME: kafka-rest + zookeeper: + image: confluentinc/cp-zookeeper:5.1.3 + env: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + steps: + - name: checkout + uses: actions/checkout@v4 + with: + # do not fetch tags if the trigger event is a tag push + fetch-tags: ${{ startsWith(github.ref, 'refs/tags') != true }} + fetch-depth: 100 + - name: build + run: | + lein kaocha + env: + KAFKA_BOOTSTRAP_SERVERS: kafka + ZOOKEEPER_HOST: zoopkeeper + SCHEMA_REGISTRY_HOST: schema-registry + KAFKA_REST_PROXY_HOST: kafka-rest + - name: lint + run: lein clj-kondo --lint src test || true From 84d79a7c62f70d2f7c45bd18a0bcd8926d1dad66 Mon Sep 17 00:00:00 2001 From: jordan brooks Date: Wed, 28 Feb 2024 13:36:05 +0000 Subject: [PATCH 4/7] Update README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 833d0617..0b429378 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,12 @@ See [an example using jackdaw](https://github.com/FundingCircle/topology-grapher ## Releasing -Anyone with the appropriate credentials can "cut a release" of jackdaw using the following steps. +Anyone with the appropriate credentials can "cut a release" of jackdaw +* Tags are protected, you will need to be a maintainer or admin to apply them +* Clojars deployment uses a protected env, once a tag is created, the CI job to deploy will need to be reviewed by the clojars env owner + +Steps: 1. Review the diff of master vs the latest released tag (e.g. while preparing 0.7.0, I looked at https://github.com/FundingCircle/jackdaw/compare/0.6.9...master to see what was actually merged vs what was in the Changelog). Make a PR to put a date on the version being released and if necessary ensure completeness and consistency of the Changelog 2. Use the [Draft a new release](https://github.com/FundingCircle/jackdaw/releases/new) feature in github to prepare a release 3. In the "tag version" field, enter the proposed version @@ -42,6 +46,10 @@ Anyone with the appropriate credentials can "cut a release" of jackdaw using the Steps 2 to 6 is essentially `git tag $version -m "$title\n\n$description" && git push --tags` +#### Snapshot release + +Snapshot releases can be created by pushing a tag with the format `publish-snapshot-semver` + ## License Copyright © 2017 Funding Circle From deaed50be38f9c6fe6566304b7695c169a99a7f5 Mon Sep 17 00:00:00 2001 From: jordan brooks Date: Wed, 28 Feb 2024 13:38:12 +0000 Subject: [PATCH 5/7] Remove circleci config --- .circleci/config.yml | 206 --------------------------------- .github/workflows/deploy.yaml | 2 +- {.circleci/bin => bin}/add-key | 0 {.circleci/bin => bin}/gpg | 2 +- 4 files changed, 2 insertions(+), 208 deletions(-) delete mode 100644 .circleci/config.yml rename {.circleci/bin => bin}/add-key (100%) rename {.circleci/bin => bin}/gpg (62%) diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6453bfda..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,206 +0,0 @@ ---- -version: 2 - -references: - repo_cache_key: &repo_cache_key - v1-jackdaw-repo-{{ .Branch }}-{{ .Revision }} - - repo_cache_backup_1: &repo_cache_backup_1 - v1-jackdaw-repo-{{ .Branch }} - - repo_cache_backup_2: &repo_cache_backup_2 - v1-jackdaw-repo - - restore_repo: &restore_repo - restore_cache: - keys: - - *repo_cache_key - - *repo_cache_backup_1 - - *repo_cache_backup_2 - - mvn_cache_key: &mvn_cache_key - v1-jackdaw-deps-{{ checksum "project.clj" }} - - mvn_cache_backup: &mvn_cache_backup - v1-jackdaw-deps - - restore_mvn: &restore_mvn - restore_cache: - keys: - - *mvn_cache_key - - *mvn_cache_backup - - build_config: &build_config - docker: - - image: circleci/clojure:lein-2.9.1 - working_directory: /home/circleci/jackdaw - - deploy_config: &deploy_config - docker: - - image: circleci/clojure:lein-2.9.1 - working_directory: /home/circleci/jackdaw - - test_config: &test_config - docker: - - image: circleci/clojure:lein-2.9.1 - - image: confluentinc/cp-zookeeper:6.1.1 - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - - image: confluentinc/cp-kafka:6.1.1 - environment: - KAFKA_BROKER_ID: 1 - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 - KAFKA_ZOOKEEPER_CONNECT: localhost:2181 - - image: confluentinc/cp-schema-registry:6.1.1 - environment: - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: localhost:2181 - SCHEMA_REGISTRY_HOST_NAME: localhost - SCHEMA_REGISTRY_LISTENERS: http://localhost:8081 - - image: confluentinc/cp-kafka-rest:6.1.1 - environment: - KAFKA_REST_ZOOKEEPER_CONNECT: localhost:2181 - KAFKA_REST_BOOTSTRAP_SERVERS: localhost:9092 - KAFKA_REST_LISTENERS: http://0.0.0.0:8082 - KAFKA_REST_SCHEMA_REGISTRY: http://localhost:8081 - KAFKA_REST_HOST_NAME: localhost - working_directory: ~/jackdaw - -jobs: - checkout_code: - <<: *build_config - steps: - - *restore_repo - - checkout - - save_cache: - key: v1-jackdaw-repo-{{ .Branch }}-{{ .Revision }} - paths: - - . - checkout_tags: - <<: *deploy_config - steps: - - *restore_repo - # Workaround required for https://discuss.circleci.com/t/22437 - # - # This is required to prevent the warning that appears about connecting - # to a host for the first time when we attempt to fetch the tags from - # github. - # - # The `add-key` script checks the fingerprint of the ssh key returned - # by github against the fingerprint published below on their website - # to protect against MITM attacks - # - # https://help.github.com/en/articles/githubs-ssh-key-fingerprints - # - - run: | - .circleci/bin/add-key github.com $GITHUB_SSH_FINGERPRINT - git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}" - git checkout --force "$CIRCLE_TAG" - - save_cache: - key: v1-jackdaw-repo-{{ .Branch }}-{{ .Revision }} - paths: - - . - lint: - machine: true - working_directory: /home/circleci/jackdaw - steps: - - checkout - - run: ls -la - - run: docker run --volume `pwd`:/project --rm --workdir /project cljkondo/clj-kondo sh -c 'clj-kondo --lint src test' || true - - deps: - <<: *build_config - steps: - - *restore_repo - - *restore_mvn - - run: - lein with-profiles +test deps - - save_cache: - key: *mvn_cache_key - paths: - - /home/circleci/.m2 - - - test: - <<: *test_config - steps: - - *restore_repo - - *restore_mvn - - setup_remote_docker: - docker_layer_caching: true - - run: - lein kaocha --plugin kaocha.plugin/junit-xml --junit-xml-file test-results/kaocha/results.xml - - store_artifacts: - path: ./logs - - store_artifacts: - path: target/coverage - - store_test_results: - path: test-results - - deploy: - <<: *deploy_config - steps: - - *restore_repo - - *restore_mvn - - run: - name: Prepare signing key - command: | - echo $GPG_PRIVATE_KEY |base64 --decode |gpg --yes --batch --import - - - run: - name: Deploy to Clojars - command: | - export LEIN_GPG=/home/circleci/jackdaw/.circleci/bin/gpg - export REAL_GPG=$(which gpg) - - lein do jar, pom, deploy clojars - - deploy_snapshot: - <<: *deploy_config - steps: - - *restore_repo - - *restore_mvn - - run: - name: Deploy to Clojars - command: | - [ -z "$CLOJARS_USERNAME" ] || lein do jar, pom, deploy clojars - -workflows: - version: 2 - build_and_test: - jobs: - - lint - - checkout_code - - deps: - requires: - - checkout_code - - test: - requires: - - deps - - deploy_snapshot: - context: clojars-deploy - requires: - - test - filters: - tags: - ignore: /.*/ - branches: - ignore: /master/ - - checkout_and_deploy: - jobs: - - checkout_tags: - filters: - tags: - only: /.*/ - branches: - ignore: /.*/ - - deploy: - context: clojars-deploy - requires: - - checkout_tags - filters: - tags: - only: /^\d+\.\d+\.\d+$/ - branches: - ignore: /.*/ diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3b3de1f0..0c8b4c15 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -29,7 +29,7 @@ jobs: apt-get update apt-get install -y gpg echo $GPG_PRIVATE_KEY |base64 --decode |gpg --yes --batch --import - export LEIN_GPG=/__w/jackdaw/jackdaw/.circleci/bin/gpg + export LEIN_GPG=/__w/jackdaw/jackdaw/bin/gpg export REAL_GPG=$(which gpg) lein do jar, pom, deploy clojars diff --git a/.circleci/bin/add-key b/bin/add-key similarity index 100% rename from .circleci/bin/add-key rename to bin/add-key diff --git a/.circleci/bin/gpg b/bin/gpg similarity index 62% rename from .circleci/bin/gpg rename to bin/gpg index 8b41d98f..83b45a37 100755 --- a/.circleci/bin/gpg +++ b/bin/gpg @@ -1,6 +1,6 @@ #!/bin/sh # -# Invoked by `LEIN_GPG=$app/.circleci/bin/gpg lein deploy clojars` +# Invoked by `LEIN_GPG=$app/bin/gpg lein deploy clojars` echo $GPG_PASSPHRASE \ | $REAL_GPG --pinentry-mode loopback --yes --batch --passphrase-fd=0 $@ From 3291ffdf886502d7e26bae4fbf365c66c77416c1 Mon Sep 17 00:00:00 2001 From: jordan brooks Date: Mon, 4 Mar 2024 11:11:05 +0000 Subject: [PATCH 6/7] Address review comments --- test/jackdaw/client_test.clj | 2 +- test/jackdaw/test/commands/write_test.clj | 3 ++- test/jackdaw/test/transports/rest_proxy_test.clj | 4 ++-- test/jackdaw/test_test.clj | 3 +-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/jackdaw/client_test.clj b/test/jackdaw/client_test.clj index 20b3f67f..61e7b7d4 100644 --- a/test/jackdaw/client_test.clj +++ b/test/jackdaw/client_test.clj @@ -160,7 +160,7 @@ (deftest ^:integration consumer-test (let [config {"group.id" "jackdaw-client-test-consumer-test" - "bootstrap.servers" "kafka:9092" + "bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "key.deserializer" "org.apache.kafka.common.serialization.StringDeserializer" "value.deserializer" "org.apache.kafka.common.serialization.StringDeserializer"} key-serde (:key-serde foo-topic) diff --git a/test/jackdaw/test/commands/write_test.clj b/test/jackdaw/test/commands/write_test.clj index d4ac8119..c9d6b1a5 100644 --- a/test/jackdaw/test/commands/write_test.clj +++ b/test/jackdaw/test/commands/write_test.clj @@ -4,6 +4,7 @@ [jackdaw.test.transports :as trns] [jackdaw.test.transports.kafka] [jackdaw.test.serde :as serde] + [jackdaw.utils :as utils] [clojure.test :refer [deftest is testing]]) (:import [clojure.lang ExceptionInfo])) @@ -40,7 +41,7 @@ :key-serde :long :value-serde :json})) -(def kafka-config {"bootstrap.servers" "kafka:9092" +(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "group.id" "kafka-write-test"}) (defn with-transport diff --git a/test/jackdaw/test/transports/rest_proxy_test.clj b/test/jackdaw/test/transports/rest_proxy_test.clj index a8d48060..6dbd473a 100644 --- a/test/jackdaw/test/transports/rest_proxy_test.clj +++ b/test/jackdaw/test/transports/rest_proxy_test.clj @@ -21,7 +21,7 @@ "group.id" "kafka-write-test"}) (def +real-rest-proxy-url+ - "http://kafka-rest:8082") + (format "http://%s:8082" (utils/kafka-rest-proxy-host))) (defn rest-proxy-config [group-id] @@ -31,7 +31,7 @@ (defn kstream-config [app app-id] {:topology app - :config {"bootstrap.servers" "kafka:9092" + :config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") "application.id" app-id}}) (defn echo-stream diff --git a/test/jackdaw/test_test.clj b/test/jackdaw/test_test.clj index 737ca6ad..0e05e821 100644 --- a/test/jackdaw/test_test.clj +++ b/test/jackdaw/test_test.clj @@ -235,8 +235,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (echo-stream test-in test-out) - {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") - "application.id" "test-echo-stream"}) + (assoc kafka-config "application.id" "test-echo-stream")) :topics {:in test-in :out test-out}}) (fn [machine] From 88e227c11f5f84df0e8a739a1f319205eaedcbb6 Mon Sep 17 00:00:00 2001 From: jordan brooks Date: Thu, 7 Mar 2024 10:03:45 +0000 Subject: [PATCH 7/7] Make port configurable in tests via env var --- test/jackdaw/client/partitioning_test.clj | 2 +- test/jackdaw/client_test.clj | 4 ++-- test/jackdaw/serdes/avro/integration_test.clj | 6 ++--- test/jackdaw/serdes/avro_test.clj | 2 +- .../serdes/json_schema/confluent_test.clj | 2 +- test/jackdaw/test/commands/write_test.clj | 2 +- test/jackdaw/test/fixtures_test.clj | 4 ++-- test/jackdaw/test/transports/kafka_test.clj | 4 ++-- test/jackdaw/test/transports/mock_test.clj | 2 +- .../test/transports/rest_proxy_test.clj | 8 +++---- test/jackdaw/test_test.clj | 8 +++---- test/jackdaw/utils.clj | 22 +++++++++++++------ 12 files changed, 37 insertions(+), 29 deletions(-) diff --git a/test/jackdaw/client/partitioning_test.clj b/test/jackdaw/client/partitioning_test.clj index a4f2065f..7babf4b2 100644 --- a/test/jackdaw/client/partitioning_test.clj +++ b/test/jackdaw/client/partitioning_test.clj @@ -23,7 +23,7 @@ (deftest test->ProducerRecord - (with-open [p (client/producer {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + (with-open [p (client/producer {"bootstrap.servers" (utils/bootstrap-servers) "key.serializer" "org.apache.kafka.common.serialization.StringSerializer" "value.serializer" "org.apache.kafka.common.serialization.StringSerializer"})] (testing "absent key-fn" diff --git a/test/jackdaw/client_test.clj b/test/jackdaw/client_test.clj index 61e7b7d4..5374c3bb 100644 --- a/test/jackdaw/client_test.clj +++ b/test/jackdaw/client_test.clj @@ -41,7 +41,7 @@ "high-partition-topic" high-partition-topic}) (defn broker-config [] - {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092")}) + {"bootstrap.servers" (utils/bootstrap-servers)}) (defn producer-config [] (-> (broker-config) @@ -160,7 +160,7 @@ (deftest ^:integration consumer-test (let [config {"group.id" "jackdaw-client-test-consumer-test" - "bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + "bootstrap.servers" (utils/bootstrap-servers) "key.deserializer" "org.apache.kafka.common.serialization.StringDeserializer" "value.deserializer" "org.apache.kafka.common.serialization.StringDeserializer"} key-serde (:key-serde foo-topic) diff --git a/test/jackdaw/serdes/avro/integration_test.clj b/test/jackdaw/serdes/avro/integration_test.clj index 1acd7293..6367ca0c 100644 --- a/test/jackdaw/serdes/avro/integration_test.clj +++ b/test/jackdaw/serdes/avro/integration_test.clj @@ -15,7 +15,7 @@ (set! *warn-on-reflection* false) (def +real-schema-registry-url+ - (format "http://%s:8081" (utils/schema-registry-host))) + (str "http://" (utils/schema-registry-address))) (def +type-registry+ (merge avro/+base-schema-type-registry+ @@ -66,8 +66,8 @@ "A Kafka consumer or streams config." (let [id (str "dev-" (java.util.UUID/randomUUID))] {"replication.factor" "1", "group.id" id, "application.id" id, - "bootstrap.servers" (str (utils/bootstrap-servers) ":9092") - "zookeeper.connect" (str (utils/zookeeper-host) ":2181") + "bootstrap.servers" (utils/bootstrap-servers) + "zookeeper.connect" (utils/zookeeper-address) "request.timeout.ms" "1000"})) ;;;; Schemas diff --git a/test/jackdaw/serdes/avro_test.clj b/test/jackdaw/serdes/avro_test.clj index 61a26dbc..8af997ff 100644 --- a/test/jackdaw/serdes/avro_test.clj +++ b/test/jackdaw/serdes/avro_test.clj @@ -47,7 +47,7 @@ serde-config) schema-registry-config {:avro.schema-registry/client registry-client - :avro.schema-registry/url (str (utils/schema-registry-host) ":8081")}] + :avro.schema-registry/url (utils/schema-registry-address)}] (avro/serde +registry+ schema-registry-config serde-config)))) (defn deserialize [serde topic x] diff --git a/test/jackdaw/serdes/json_schema/confluent_test.clj b/test/jackdaw/serdes/json_schema/confluent_test.clj index 410c8503..a5524f81 100644 --- a/test/jackdaw/serdes/json_schema/confluent_test.clj +++ b/test/jackdaw/serdes/json_schema/confluent_test.clj @@ -16,7 +16,7 @@ {"json.fail.invalid.schema" false} :serializer-properties {"json.fail.invalid.schema" false}}))) - schema-registry-url (str (utils/schema-registry-host) ":8081") + schema-registry-url (utils/schema-registry-address) key? false] (jsco/serde schema-registry-url schema-str key? serde-config)))) diff --git a/test/jackdaw/test/commands/write_test.clj b/test/jackdaw/test/commands/write_test.clj index c9d6b1a5..9736b148 100644 --- a/test/jackdaw/test/commands/write_test.clj +++ b/test/jackdaw/test/commands/write_test.clj @@ -41,7 +41,7 @@ :key-serde :long :value-serde :json})) -(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") +(def kafka-config {"bootstrap.servers" (utils/bootstrap-servers) "group.id" "kafka-write-test"}) (defn with-transport diff --git a/test/jackdaw/test/fixtures_test.clj b/test/jackdaw/test/fixtures_test.clj index 72160dd5..efd60b4f 100644 --- a/test/jackdaw/test/fixtures_test.clj +++ b/test/jackdaw/test/fixtures_test.clj @@ -15,7 +15,7 @@ :config {}}) (def kafka-config - {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092")}) + {"bootstrap.servers" (utils/bootstrap-servers)}) (def test-topics (let [topics {"foo" topic-foo}] @@ -73,7 +73,7 @@ (deftest test-reset-application-fixture-failure (test-resetter {:app-config {"application.id" "yolo" - "bootstrap.servers" (str (utils/bootstrap-servers) ":9092")} + "bootstrap.servers" (utils/bootstrap-servers)} :reset-params ["--foo" "foo" "--bar" "bar"] :reset-fn (fn [reset-args rt args] diff --git a/test/jackdaw/test/transports/kafka_test.clj b/test/jackdaw/test/transports/kafka_test.clj index bd08d572..0f9faa8a 100644 --- a/test/jackdaw/test/transports/kafka_test.clj +++ b/test/jackdaw/test/transports/kafka_test.clj @@ -13,13 +13,13 @@ (set! *warn-on-reflection* false) -(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") +(def kafka-config {"bootstrap.servers" (utils/bootstrap-servers) "group.id" "kafka-write-test"}) (defn kstream-config [app app-id] {:topology app - :config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + :config {"bootstrap.servers" (utils/bootstrap-servers) "application.id" app-id}}) (defn echo-stream diff --git a/test/jackdaw/test/transports/mock_test.clj b/test/jackdaw/test/transports/mock_test.clj index af15f194..17762f87 100644 --- a/test/jackdaw/test/transports/mock_test.clj +++ b/test/jackdaw/test/transports/mock_test.clj @@ -59,7 +59,7 @@ [] (trns/transport {:type :mock :driver (test-driver (echo-stream test-in test-out) - {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + {"bootstrap.servers" (utils/bootstrap-servers) "application.id" "test-echo-stream"}) :topics {"test-in" test-in "test-out" test-out}})) diff --git a/test/jackdaw/test/transports/rest_proxy_test.clj b/test/jackdaw/test/transports/rest_proxy_test.clj index 6dbd473a..04f3b546 100644 --- a/test/jackdaw/test/transports/rest_proxy_test.clj +++ b/test/jackdaw/test/transports/rest_proxy_test.clj @@ -17,11 +17,11 @@ (set! *warn-on-reflection* false) -(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") +(def kafka-config {"bootstrap.servers" (utils/bootstrap-servers) "group.id" "kafka-write-test"}) (def +real-rest-proxy-url+ - (format "http://%s:8082" (utils/kafka-rest-proxy-host))) + (format "http://%s" (utils/kafka-rest-proxy-address))) (defn rest-proxy-config [group-id] @@ -31,7 +31,7 @@ (defn kstream-config [app app-id] {:topology app - :config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + :config {"bootstrap.servers" (utils/bootstrap-servers) "application.id" app-id}}) (defn echo-stream @@ -174,7 +174,7 @@ :consumer.fetch.timeout.ms 200}))) (proxy/with-consumer)) [url options] (first @http-reqs)] - (is (= "http://kafka-rest:8082/consumers/test-group-config" url)) + (is (= (str "http://" (utils/kafka-rest-proxy-address) "/consumers/test-group-config") url)) (is (= {"Accept" "application/vnd.kafka.v2+json" "Content-Type" "application/vnd.kafka.v2+json"} (:headers options))) diff --git a/test/jackdaw/test_test.clj b/test/jackdaw/test_test.clj index 0e05e821..c129ff87 100644 --- a/test/jackdaw/test_test.clj +++ b/test/jackdaw/test_test.clj @@ -33,7 +33,7 @@ :key-serde :string :value-serde :json})) -(def kafka-config {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") +(def kafka-config {"bootstrap.servers" (utils/bootstrap-servers) "group.id" "kafka-write-test"}) (defn kafka-transport @@ -258,7 +258,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (bad-topology test-in test-out) - {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + {"bootstrap.servers" (utils/bootstrap-servers) "application.id" "test-echo-stream"}) :topics {:in test-in :out test-out}}) @@ -280,7 +280,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (echo-stream test-in test-out) - {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + {"bootstrap.servers" (utils/bootstrap-servers) "application.id" "test-echo-stream"}) :topics {:in test-in :out test-out}}) @@ -302,7 +302,7 @@ (try (jd.test/with-test-machine (trns/transport {:type :mock :driver (jd.test/mock-test-driver (echo-stream test-in test-out) - {"bootstrap.servers" (str (utils/bootstrap-servers) ":9092") + {"bootstrap.servers" (utils/bootstrap-servers) "application.id" "test-echo-stream"}) :topics {:in test-in :out test-out}}) diff --git a/test/jackdaw/utils.clj b/test/jackdaw/utils.clj index 1bef7fe9..073dd1e2 100644 --- a/test/jackdaw/utils.clj +++ b/test/jackdaw/utils.clj @@ -2,16 +2,24 @@ (defn bootstrap-servers [] - (or (System/getenv "KAFKA_BOOTSTRAP_SERVERS") "localhost")) + (str (or (System/getenv "KAFKA_BOOTSTRAP_SERVERS") "localhost") + ":" + (or (System/getenv "KAFKA_PORT") "9092"))) -(defn zookeeper-host +(defn zookeeper-address [] - (or (System/getenv "ZOOKEEPER_HOST") "localhost")) + (str (or (System/getenv "ZOOKEEPER_HOST") "localhost") + ":" + (or (System/getenv "ZOOKEEPER_PORT") "2181"))) -(defn schema-registry-host +(defn schema-registry-address [] - (or (System/getenv "SCHEMA_REGISTRY_HOST") "localhost")) + (str (or (System/getenv "SCHEMA_REGISTRY_HOST") "localhost") + ":" + (or (System/getenv "SCHEMA_REGISTRY_PORT") "8081"))) -(defn kafka-rest-proxy-host +(defn kafka-rest-proxy-address [] - (or (System/getenv "KAFKA_REST_PROXY_HOST") "localhost")) \ No newline at end of file + (str (or (System/getenv "KAFKA_REST_PROXY_HOST") "localhost") + ":" + (or (System/getenv "KAFKA_REST_PROXY_PORT") "8082"))) \ No newline at end of file