fernandoteixxeira/stark-bank-challenge/spring-cloud-gcp-pubsub
Claude Code and agent skill by fernandoteixxeira/stark-bank-challenge
- community
Checking that the SKILL.md file is still in the repository.
Use when publishing or subscribing to Google Cloud Pub/Sub from a Spring Boot app with the Spring Cloud GCP starter — the autoconfigured PubSubTemplate, message converters, the emulator, BOM/version alignment, and testing. For message/DLQ design see gcp-pubsub.
Install
npx vskill@latest install fernandoteixxeira/stark-bank-challenge/spring-cloud-gcp-pubsubSKILL.md
The same SKILL.md was published earlier as fernandoteixxeira/stark-bank-challenge/spring-cloud-gcp-pubsub.
Spring Cloud GCP Pub/Sub Starter
The spring-cloud-gcp-starter-pubsub autoconfigures a PubSubTemplate from properties, so you don't build a Publisher/Subscriber by hand. This skill is the wiring; for message contracts, idempotency, and dead-letter design see gcp-pubsub.
Version Alignment
The Spring Cloud GCP line is pinned to a Spring Boot line — mismatches fail in subtle ways. Pick by your Boot version:
| Spring Boot | Spring Cloud GCP | |
|---|---|---|
| 3.2.x, 3.3.x | 5.x | |
| 3.4.x | 6.x / 7.x | |
| 3.5.x | 8.x |
Import the BOM and let it manage the starter version:
If you also import Google's libraries-bom (for google-cloud-* clients used directly, e.g. in tests), declare it before spring-cloud-gcp-dependencies: the first import wins for overlapping google-cloud-* versions, so your chosen libraries-bom stays authoritative while the Spring Cloud GCP BOM manages only the spring-cloud-gcp-* artifacts.
Publishing
The starter provides a PubSubTemplate bean. Inject the narrow publish interface if you only publish:
publish(topic, payload, Map<String,String> headers)returns aCompletableFuture<String>. Call.get()to block until the broker confirms — that is what makes "published" mean durably accepted, so a caller can answer a retry on failure.- The
topicis the short name; the project comes from configuration. headersbecome message attributes — routing/observability a subscriber reads without opening the body.
Serialization: the message converter
Register a PubSubMessageConverter bean and the starter wires it into PubSubTemplate; then you publish the object, not JSON:
Use a custom PubSubMessageConverter when the wire body is not a field-by-field serialization of your object — a reshaped envelope, a sealed/polymorphic type, enum wire values, grouped value objects. A custom converter keeps that shaping in the adapter instead of forcing Jackson annotations onto a framework-free domain:
The converter does not eliminate the serialization — it relocates it out of the publish call. If a plain Jackson shape is acceptable, the stock converter is zero code.
The emulator
Point the whole client at a local emulator with one property — no credentials, plaintext channel, set up for you:
- With
emulator-hostset, the starter usesNoCredentialsProviderand a plaintext channel — the app starts and runs without any GCP credentials. Leave it unset for real Pub/Sub (application-default credentials). - This is the starter's property; the
google-cloud-pubsubclient does not read thePUBSUB_EMULATOR_HOSTenv var on its own. Relaxed binding still lets you set it from the environment asSPRING_CLOUD_GCP_PUBSUB_EMULATOR_HOST. - The emulator holds no topics at start — create the topic (and any subscription) before publishing, e.g.
PUT http://host:8085/v1/projects/{p}/topics/{t}over its REST API.
Testing
- Full context:
@SpringBootTest+ TestcontainersPubSubEmulatorContainer, and in@DynamicPropertySourcesetspring.cloud.gcp.pubsub.emulator-hostto the container endpoint andspring.cloud.gcp.project-id. The autoconfiguredPubSubTemplatethen publishes to the emulator; assert what landed by pulling with aSubscriberStub. - Adapter in isolation: build the publish template by hand against the emulator, mirroring what autoconfig assembles:
- A test
ObjectMappershould disableFAIL_ON_UNKNOWN_PROPERTIESif you convert maps to generated models — Spring Boot's autoconfigured mapper already does.
See also: gcp-pubsub (contracts, DLQ, idempotency), testcontainers (emulator container + Docker API version), gcp-cloud-run (deploying the service).
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.skills/spring-cloud-gcp-pubsub/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/fernandoteixxeira/stark-bank-challenge/spring-cloud-gcp-pubsub)