{"id":19417986,"url":"https://github.com/americanexpress/jakapu","last_synced_at":"2025-08-18T04:10:42.218Z","repository":{"id":45175549,"uuid":"256347685","full_name":"americanexpress/jakapu","owner":"americanexpress","description":"Config driven SDK to publish events into any Kafka topic without writing code","archived":false,"fork":false,"pushed_at":"2025-07-12T01:51:39.000Z","size":96,"stargazers_count":3,"open_issues_count":2,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-17T23:17:15.714Z","etag":null,"topics":["java","kafka","rest","spring"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/americanexpress.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-04-16T22:52:53.000Z","updated_at":"2022-11-01T22:01:08.000Z","dependencies_parsed_at":"2022-07-22T13:32:09.393Z","dependency_job_id":null,"html_url":"https://github.com/americanexpress/jakapu","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/americanexpress/jakapu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjakapu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjakapu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjakapu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjakapu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/americanexpress","download_url":"https://codeload.github.com/americanexpress/jakapu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjakapu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270941107,"owners_count":24671788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["java","kafka","rest","spring"],"created_at":"2024-11-10T13:12:19.128Z","updated_at":"2025-08-18T04:10:42.201Z","avatar_url":"https://github.com/americanexpress.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\nJava Kafka Publisher (JaKaPu)\n\u003c/h1\u003e\n\u003ch1 align=\"center\"\u003e\n  \u003cimg src='images/jakapu.png' alt=\"Jakapu - Amex\" width='50%'/\u003e\n\u003c/h1\u003e\n\n**Jakapu is a config driven SDK to publish events into any Kafka topic without writing code**\n\n\n## ✨ Features\n\n- Build a Kafka Publisher with a single @annotation\n- Convert your existing Springboot app to a Kafka publisher\n- Publish message into multiple kafka topics\n- Route messages into multiple kafka topics based on a header key\n- Validate the kafka header and their values before publishing message into kafka\n- Configuration driven Kafka broker, topic configuration\n- Publish to kafka with ssl enabled or disabled \n- Also provides a REST API end point @/jakapu/publish to publish messages into kakfa\n\n\n## 📖 Prerequisites\n\n- Maven 3+\n- Java 8+\n- Spring framework\n- Kafka Topic\n\n            \n## 🤹‍ Getting Started\n\n\n##### Add maven dependency\n\n```java\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.americanexpress.jakapu\u003c/groupId\u003e\n    \u003cartifactId\u003ejakapu\u003c/artifactId\u003e\n    \u003cversion\u003e${latest.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\n##### Add @EnableJakapu as a dependency annotation on Spring Boot Main Application class.\n\n```java\n     @EnableJakapu\n      public class SampleSpringApplication {\n\n      public static void main(String[] args) {\n          logger.info(\"Spring Boot Sample App Started.............\");\n          ApplicationContext app = SpringApplication.run(SampleSpringApplication.class);\n      }\n  }\n```\n\n\n##### Configure :\n    - dynamically add any number of topics to your configuration under **jakapu.psf.publisher.topics** \n    - define mandatory kafka header attribute names and their validation pattern(**jakapu.psf.publisher.payload.headerAtribute**)\n    - header-based topic routing can be added in the configuration under **Jakapu.psf.publisher.headerTopicMap**\n\n```yaml\njakapu:\n  psf:\n    publisher:\n      topics:\n      - name: Topic1\n        id: t1\n        numPartitions: 4\n        replication-factor: 1\n      - name: Topic2\n        id: t2\n        numPartitions: 8\n        replication-factor: 1\n    \n    payload:\n      headerAttribute:\n        source-type: \"re(jakapu.psf.payload.headerTopicMap)\"\n        event-type: \"rx(\\\\w{1,})\" #Java Regex to validate the type of event. Accepts any string size more than 1.\n        source-uniqueid: \"rx(\\\\w{1,})\" #Java Regex to validate string. Accepts any string size more than 1. \n        source-timestamp: \"rx(\\\\d{13})\" #Java Regex to validate timestamp. 13 digit number.\n      headerTopicMap:\n        MySource1: t1\n        MySource2: t2\n\n ### kafka config related to broker, ssl, keystores etc\n\n  kafka:\n    security:\n      enabled: false\n      protocol: SSL\n    ssl:\n      protocol: TLSv1.2\n      keystore:\n        type: JKS\n        location: your-private-keystore.jks\n        password: $$$$\n      key:\n        password: $$$$\n      truststore:\n        location: client-truststore.jks\n        password: $$$$\n    bootstrap-servers: \"yourkafka.domain.com\"\n```\n\n\n##### To publish a message, autowire Publisher interface and then use the API call - **publisher.publish()**\n\n```java\npublic class SampleKafkaPublisher {\n\n    @Autowired\n    private Publisher publisher;\n\n    public send(String message) {\n        Map\u003cString,String\u003e headerMap = ... ; // add kafka headers that are mandatory/needed\n        publisher.publish(headerMap, message);\n    }\n}\n```\n\n##### Example Publish Message using Curl to the inbuilt REST endpoint:\n\n```unix\ncurl -H 'content-type: application/json' \\\n-H 'source-type: MySource1' \\\n-H 'event-type: TestEventType' \\\n-H 'source-uniqueid: 231324' \\\n-H 'source-timestamp: 1576020324880' \\\n--data '{\"message\":\"test\"}' \\\nhttps://hostname/jakapu/publish\n```\n\n## 🏆 Contributing\n\nWe welcome Your interest in the American Express Open Source Community on Github. Any Contributor to\nany Open Source Project managed by the American Express Open Source Community must accept and sign\nan Agreement indicating agreement to the terms below. Except for the rights granted in this \nAgreement to American Express and to recipients of software distributed by American Express, You\nreserve all right, title, and interest, if any, in and to Your Contributions. Please\n[fill out the Agreement](https://cla-assistant.io/americanexpress/jakapu).\n\n\n## 🗝️ License\n\nAny contributions made under this project will be governed by the\n[Apache License 2.0](./LICENSE.txt).\n\n\n## 🗣️ Code of Conduct\n\nThis project adheres to the [American Express Community Guidelines](./CODE_OF_CONDUCT.md). \nBy participating, you are expected to honor these guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanexpress%2Fjakapu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famericanexpress%2Fjakapu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanexpress%2Fjakapu/lists"}