{"id":26155754,"url":"https://github.com/clebsf/spring-pubsub-publisher","last_synced_at":"2025-10-05T22:16:38.027Z","repository":{"id":280900419,"uuid":"943547299","full_name":"clebsf/spring-pubsub-publisher","owner":"clebsf","description":"A Spring Boot application that publishes messages to Google Cloud Pub/Sub.","archived":false,"fork":false,"pushed_at":"2025-03-05T22:21:06.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T18:06:28.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/clebsf.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}},"created_at":"2025-03-05T22:09:22.000Z","updated_at":"2025-03-05T22:16:50.000Z","dependencies_parsed_at":"2025-03-05T23:23:24.313Z","dependency_job_id":"5d0f487d-9020-497b-b768-59403dfa871d","html_url":"https://github.com/clebsf/spring-pubsub-publisher","commit_stats":null,"previous_names":["clebsf/spring-pubsub-publisher"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clebsf/spring-pubsub-publisher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebsf%2Fspring-pubsub-publisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebsf%2Fspring-pubsub-publisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebsf%2Fspring-pubsub-publisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebsf%2Fspring-pubsub-publisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clebsf","download_url":"https://codeload.github.com/clebsf/spring-pubsub-publisher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebsf%2Fspring-pubsub-publisher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261338952,"owners_count":23143892,"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","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":"2025-03-11T08:59:01.051Z","updated_at":"2025-10-05T22:16:32.989Z","avatar_url":"https://github.com/clebsf.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring PubSub - GCP Pub/Sub Messaging Application\n\nThis Spring Boot application provides a simple API for publishing messages to Google Cloud Pub/Sub.\n\n## Prerequisites\n\n- JDK 21\n- Maven 3.6+\n- Google Cloud Platform account\n- Google Cloud CLI (gcloud)\n\n## Installing Google Cloud CLI (gcloud)\n\n### macOS Installation\n\n1. Download the Google Cloud CLI installer:\n\n```bash\ncurl https://sdk.cloud.google.com | bash\n```\n\n2. Restart your terminal or run:\n\n```bash\nsource ~/.zshrc\n```\n\n3. Initialize the gcloud CLI:\n\n```bash\ngcloud init\n```\n\n4. Follow the prompts to:\n    - Log in with your Google account\n    - Select your GCP project\n\n### Setting Up Your GCP Project\n\n1. List your GCP projects:\n\n```bash\ngcloud projects list\n```\n\n2. Set your default project:\n\n```bash\ngcloud config set project YOUR_PROJECT_ID\n```\n\n3. Enable the Pub/Sub API:\n\n```bash\ngcloud services enable pubsub.googleapis.com\n```\n\n4. Create a Pub/Sub topic:\n\n```bash\ngcloud pubsub topics create spring-pubsub\n```\n\n## Running the Application\n\n1. Set the GCP project ID environment variable:\n\n```bash\nexport GCP_PROJECT_ID=YOUR_PROJECT_ID\n```\n\n2. Build and run the application:\n\n```bash\nmvn spring-boot:run\n```\n\n## Using the API\n\nThe application exposes a REST endpoint to publish messages to GCP Pub/Sub:\n\n### Publish a Message\n\n```bash\ncurl -X POST http://localhost:8080/message/publish -H \"Content-Type: text/plain\" -d \"Hello Pub/Sub!\"\n```\n\nThe message will be published to the \"spring-pubsub\" topic in your GCP project.\n\n## Authentication\n\nThe application uses the GCP credentials from your gcloud CLI authentication. If running in a different environment, you may need to set up service account credentials:\n\n```bash\ngcloud auth application-default login\n```\n\n## Project Structure\n\n- `MessageController`: REST controller for publishing messages\n- `application.properties`: Configuration for GCP Pub/Sub integration\n\n## Additional Resources\n\nFor more information on Google Cloud Pub/Sub with Spring, refer to the [Google Cloud Pub/Sub Sample](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-pubsub-sample).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclebsf%2Fspring-pubsub-publisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclebsf%2Fspring-pubsub-publisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclebsf%2Fspring-pubsub-publisher/lists"}