{"id":43052750,"url":"https://github.com/cloud-native-toolkit/inventory-kafka-nodejs","last_synced_at":"2026-01-31T10:38:18.260Z","repository":{"id":40781526,"uuid":"335690163","full_name":"cloud-native-toolkit/inventory-kafka-nodejs","owner":"cloud-native-toolkit","description":"Inventory Service Application using NodeJS to interact with Kafka Event Streams","archived":false,"fork":false,"pushed_at":"2025-05-07T05:10:26.000Z","size":2945,"stargazers_count":0,"open_issues_count":74,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-22T03:02:56.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloud-native-toolkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-03T16:43:04.000Z","updated_at":"2021-06-02T17:57:55.000Z","dependencies_parsed_at":"2024-11-03T01:17:40.119Z","dependency_job_id":"a32e1078-5845-4ec2-824d-a91e67135646","html_url":"https://github.com/cloud-native-toolkit/inventory-kafka-nodejs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cloud-native-toolkit/inventory-kafka-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Finventory-kafka-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Finventory-kafka-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Finventory-kafka-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Finventory-kafka-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloud-native-toolkit","download_url":"https://codeload.github.com/cloud-native-toolkit/inventory-kafka-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Finventory-kafka-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28938840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T10:18:23.202Z","status":"ssl_error","status_checked_at":"2026-01-31T10:18:22.693Z","response_time":128,"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":[],"created_at":"2026-01-31T10:38:18.144Z","updated_at":"2026-01-31T10:38:18.255Z","avatar_url":"https://github.com/cloud-native-toolkit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e Inventory Service Kafka Producer \u003c/h1\u003e\n\nThis Node.JS Application is part of the Inventory Service for the IBM Cloud Native Toolkit Journey. This application allows users to produce a message to a kafka topic notifying all consumers that an update to an item in inventory has occured.\n\nThis application supports the following platforms:\n  - Confluent\n  - Local Kafka\n  - Strimzi\n\u003ch2 align=\"Left\"\u003e\nConfluent Setup\n\u003c/h2\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eOperator Setup\u003c/span\u003e\u003c/summary\u003e\n  \u003cbr /\u003e\n  Follow the Instructions at the following link to setup [confluent](https://github.ibm.com/ben-cornwell/confluent-operator/) on OpenShift.\n\n  Be sure to record the `global.sasl.plain.username` and `global.sasl.plain.password` from the `values` file in the `confluent-operator` directory for the `Secret Creation` step below.\n\n  Once the operator has finished installing, **copy** the `confluentCA.key` and `confluentCA.pem` and move it to a convient location for you to access. Both will be needed for the `Secret Creation` step as well.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eSecret Creation\u003c/span\u003e\u003c/summary\u003e\n  \u003cbr /\u003e\n  Secrets will be needed in order to connect your Kafka Client to the running instance of Kafka. **Two** secrets will need to be created.\n\n  First will be named `confluent-kafka-cert`. Use the following command to create the secret:\n\n  ```bash\n  oc create secret tls confluent-kafka-cert --cert='./~PATH TO PEM~/confluentCA.pem' --key='./~PATH TO KEY~/confluentCA.key' -n NAMESPACE\n  ```\n\n  *Replace the `PATH TO` with the proper directory path to the file and `NAMESPACE` with the namespace you want it to be deployed.*\n\n  The second key to create will be named `kafka-operator-key`. Use the following command to create the secret:\n\n  ```bash\n  oc create secret generic kafka-operator-key --from-literal=username=GLOBAL.SASL.PLAIN.USERNAME --from-literal=password=GLOBAL.SASL.PLAIN.PASSWORD -n NAMESPACE\n  ```\n\n  *Replace the `GLOBAL.SASL.PLAIN.*` with the value from the previous step and `NAMESPACE` with the namespace you want it to be deployed.*\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eClient Configuration\u003c/span\u003e\u003c/summary\u003e\n  \u003cbr /\u003e\n  First we need to setup the `clusterDev` configuration for the new deployed services.\n\n  Open the file `/src/env/clusterDev.js`. **Modify** the following capitalized parameters to match your deployment.\n\n  ```javascript\n    kafka: {\n        TOPIC: 'YOUR TOPIC',\n        BROKERS: ['kafka.NAMESPACE.svc:9071'],\n        GROUPID: 'GROUPID',\n        CLIENTID: 'CLIENTID',\n        SASLMECH:'plain',\n        CONNECTIONTIMEOUT: 3000,\n        AUTHENTICATIONTIMEOUT: 1000,\n        REAUTHENTICATIONTHRESHOLD: 10000,\n        RETRIES: 3,\n        MAXRETRYTIME: 5\n      }\n  ```\n\n  Check out the [documentation](https://kafka.js.org/docs/configuration) for details about the other parameters.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eRunning the Client\u003c/span\u003e\u003c/summary\u003e\n  \u003cbr /\u003e\n  Deploying to Openshift\n\n  ```bash\n    oc apply -f openshift/deployment.yaml -n NAMESPACE\n  ```\n\n  Once the Deployment is *ready*, Access the swagger page via through the Route that was created. You can find the route through:\n\n  ```bash\n    oc get route -n NAMESPACE | grep test-kafka  \n  ```\n  \n  Go to the link that looks like: `test-kafka-NAMESPACE.---.us-east.containers.appdomain.cloud `\n\n\u003c/details\u003e\n\n\u003ch2 align=\"Left\"\u003e\nLocal Kafka Setup\n\u003c/h2\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eKafka Setup\u003c/span\u003e\u003c/summary\u003e\n  \u003cbr /\u003e\n  Make sure you have an instance of kafka running either locally or remotely.\n\n  Following the instruction [here](https://kafka.apache.org/quickstart) for running kafka locally.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eLocal Client Configuration\u003c/span\u003e\u003c/summary\u003e\n  \u003cbr /\u003e\n  First we need to setup the `localDev` configuration for the new deployed services.\n\n  Open the file `/src/env/localDev.js`. **Modify** the following capitalized parameters to match your deployment.\n\n  ```javascript\n    kafka: {\n        TOPIC: 'YOUR TOPIC',\n        BROKERS: ['localhost:9092'],\n        GROUPID: 'GROUPID',\n        CLIENTID: 'CLIENTID',\n        CONNECTIONTIMEOUT: 3000,\n        AUTHENTICATIONTIMEOUT: 1000,\n        REAUTHENTICATIONTHRESHOLD: 10000,\n        RETRIES: 3,\n        MAXRETRYTIME: 5\n      }\n  ```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eRunning the Client\u003c/span\u003e\u003c/summary\u003e\n  \u003cbr /\u003e\n  Install the dependencies\n\n  ```bash\n  npm install\n  ```\n\n  To start the server run:\n\n  ```bash\n  npm run dev\n  ```\n\n  Access the swagger page via [http:localhost:3000](http://localhost:3000/)\n\n\u003c/details\u003e\n\n\u003ch2 align=\"Left\"\u003e\nStrimzi Setup\n\u003c/h2\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cspan style=\"font-size:18px\"\u003eComing Soon...\u003c/span\u003e\u003c/summary\u003e\n\n\u003c/details\u003e\n\n\u003ch2 align=\"Left\"\u003e\nContributors\n\u003c/h2\u003e\n\n- Bryan Kribbs (bakribbs@us.ibm.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-native-toolkit%2Finventory-kafka-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloud-native-toolkit%2Finventory-kafka-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-native-toolkit%2Finventory-kafka-nodejs/lists"}