{"id":38953664,"url":"https://github.com/extenda/hiiretail-gcp-pubsub-java","last_synced_at":"2026-01-17T16:12:31.533Z","repository":{"id":205442796,"uuid":"713926830","full_name":"extenda/hiiretail-gcp-pubsub-java","owner":"extenda","description":"Support lib for applications relying on GCP PubSub","archived":false,"fork":false,"pushed_at":"2025-12-20T21:06:05.000Z","size":52,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-12-22T04:53:04.971Z","etag":null,"topics":["java-libs"],"latest_commit_sha":null,"homepage":"","language":"Java","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/extenda.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-03T14:31:17.000Z","updated_at":"2025-12-19T13:32:07.000Z","dependencies_parsed_at":"2025-03-06T11:35:54.518Z","dependency_job_id":null,"html_url":"https://github.com/extenda/hiiretail-gcp-pubsub-java","commit_stats":null,"previous_names":["extenda/hiiretail-gcp-pubsub-java"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/extenda/hiiretail-gcp-pubsub-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extenda%2Fhiiretail-gcp-pubsub-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extenda%2Fhiiretail-gcp-pubsub-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extenda%2Fhiiretail-gcp-pubsub-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extenda%2Fhiiretail-gcp-pubsub-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extenda","download_url":"https://codeload.github.com/extenda/hiiretail-gcp-pubsub-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extenda%2Fhiiretail-gcp-pubsub-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: 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":["java-libs"],"created_at":"2026-01-17T16:12:31.406Z","updated_at":"2026-01-17T16:12:31.481Z","avatar_url":"https://github.com/extenda.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extenda Hii Retail GCP PubSub client\nA Google Cloud Platform PubSub client implemented for JDK 21+ (Virtual threads).\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=extenda_hiiretail-gcp-pubsub-java\u0026metric=alert_status\u0026token=d1b671c86cbc7b6fb028d64c66e94f4bd97ea80f)](https://sonarcloud.io/dashboard?id=extenda_hiiretail-gcp-pubsub-java)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=extenda_hiiretail-gcp-pubsub-java\u0026metric=coverage\u0026token=d1b671c86cbc7b6fb028d64c66e94f4bd97ea80f)](https://sonarcloud.io/dashboard?id=extenda_hiiretail-gcp-pubsub-java)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=extenda_hiiretail-gcp-pubsub-java\u0026metric=code_smells\u0026token=d1b671c86cbc7b6fb028d64c66e94f4bd97ea80f)](https://sonarcloud.io/dashboard?id=extenda_hiiretail-gcp-pubsub-java)\n\n## :nut_and_bolt: Configuration\n\nThe library supports changing these settings, via environmental variables:\n\n* `SERVICE_PROJECT_ID`\n\n  The value of your GCP project id. Using `test-project` if not set.\n\n* `PUBSUB_CLOSE_TIMEOUT_SECONDS`\n\n  The timeout in seconds before forcefully closing the client. Default 10.\n\n* `PUBSUB_WAIT_PUBLISH_SECONDS`\n\n  The timeout in seconds to wait for publish result before throwing an error. Default 30.\n\n* `PUBSUB_EMULATOR_HOST`\n\n  The host url to the PubSub emulator. ***Can also be set as system property, e.g. in tests.***\n\n## :notebook_with_decorative_cover: Usage\n\n```xml\n\u003cdependencyManagement\u003e\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.google.cloud\u003c/groupId\u003e\n      \u003cartifactId\u003elibraries-bom\u003c/artifactId\u003e\n      \u003cversion\u003e${version.google-cloud}\u003c/version\u003e\n      \u003ctype\u003epom\u003c/type\u003e\n      \u003cscope\u003eimport\u003c/scope\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n\u003c/dependencyManagement\u003e\n\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.retailsvc\u003c/groupId\u003e\n    \u003cartifactId\u003ehiiretail-gcp-pubsub-java\u003c/artifactId\u003e\n    \u003cversion\u003ex.y.z\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.google.cloud\u003c/groupId\u003e\n    \u003cartifactId\u003egoogle-cloud-pubsub\u003c/artifactId\u003e\n    \u003cversion\u003e...\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nThe library uses `SLF4J` as logging API, so make sure you have `log4j[2]` or `logback` or other\ncompatible implementation on the classpath.\n\nTo use the PubSub client, you first need to instantiate a `PubSubClientFactory`.\\\nThe factory can take a custom `ObjectToBytesMapper` as parameter. The mapper is used to convert the objects being sent,\nto suitable data to publish. If you want to use Jackson to support JSON you will also need to add `jackson-databind` if not already present:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.fasterxml.jackson.core\u003c/groupId\u003e\n  \u003cartifactId\u003ejackson-databind\u003c/artifactId\u003e\n  \u003cversion\u003e...\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Cached clients\n\nAny client that is created via the factory is also cached internally by its topic.\n\n## :scroll: Usage\n\n```java\nimport com.retailsvc.gcp.pubsub.ObjectToBytesMapper;\nimport com.retailsvc.gcp.pubsub.PooledPublisherFactory;\nimport com.retailsvc.gcp.pubsub.PubSubClientConfig;\n\nObjectMapper jsonMapper = new ObjectMapper();\nObjectToBytesMapper objectMapper = v -\u003e ByteBuffer.wrap(jsonMapper.writeValueAsBytes(v));\nPubSubClientConfig clientConfig = new PubSubClientConfig().setMessageOrderingEnabled(true);\n\nPubSubClientFactory factory =\n  new PubSubClientFactory(objectMapper, PooledPublisherFactory.defaultPool())\n      .setClientConfig(clientConfig);\n\nPubSubClient pubSubClient = factory.create(\"example.entities.v1\");\n\nObject payload = ...\n/*\n 'payload' could be any of the supported types:\n  - String, such as \"{ .. }\", \"my text\" etc.\n  - ByteBuffer\n  - InputStream\n  - Any Jackson serializable type such as Record class, List etc.\n*/\nMap\u003cString, String\u003e attributes = Map.of(\"Tenant-Id\", \"...\", \"key\", \"value\");\npubSubClient.publish(payload, attributes);\n\n// Publish with message ordering so that messages with 'myTenantId' is processed in order\nString orderingKey = \"myTenantId\";\npubSubClient.publishOrdered(payload, attributes, orderingKey);\n```\n\n## :wrench: Local development environment\n\n* JDK 21+\n* Python / pre-commit\n\n### Building\n\n```bash\n$ mvn clean package\n```\n\n```bash\n$ mvn verify\n```\n\n#### Install and run the pre-commit hooks before you submit code:\n\n```bash\n$ pre-commit install -t pre-commit -t commit-msg\n```\n\n## :information_desk_person: Contribution\n\nContributions to the project are welcome, but must adhere to a few guidelines:\n\n * [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) should be followed\n * Install and use a `editorconfig` plugin to use the project supplied settings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextenda%2Fhiiretail-gcp-pubsub-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextenda%2Fhiiretail-gcp-pubsub-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextenda%2Fhiiretail-gcp-pubsub-java/lists"}