Skip to content

Latest commit

 

History

History
69 lines (58 loc) · 2 KB

File metadata and controls

69 lines (58 loc) · 2 KB

embedded-google-pubsub

Maven dependency

pom.xml
<dependency>
    <groupId>com.playtika.testcontainers</groupId>
    <artifactId>embedded-google-pubsub</artifactId>
    <scope>test</scope>
</dependency>

Consumes (via bootstrap.yaml)

  • embedded.google.pubsub.enabled (true|false, default is true)

  • embedded.google.pubsub.reuseContainer (true|false, default is false)

  • embedded.google.pubsub.dockerImage (default is set to 'google/cloud-sdk:523.0.1')

Google cloud sdk docker image does not support ARM

  • embedded.google.pubsub.host (default is 0.0.0.0)

  • embedded.google.pubsub.port (default is 8089)

  • embedded.google.pubsub.project-id (default is my-project-id)

  • embedded.toxiproxy.proxies.google.pubsub.enabled Enables both creation of the container with ToxiProxy TCP proxy and a proxy to the embedded-google-pubsub container.

  • Topics and subscriptions:

    /src/test/resources/bootstrap.yaml
    embedded.google.pubsub:
      topics-and-subscriptions:
        - topic: topic0
          subscription: subscription0
        - topic: topic1
          subscription: subscription1
          enable-message-ordering: true
          dead-letter:
            topic: topic0
            max-attempts: 10

Produces

  • embedded.google.pubsub.host

  • embedded.google.pubsub.port

  • embedded.google.pubsub.project-id

  • embedded.google.pubsub.toxiproxy.host

  • embedded.google.pubsub.toxiproxy.port

  • embedded.google.pubsub.networkAlias

  • embedded.google.pubsub.internalPort

  • Bean ToxiproxyContainer.ContainerProxy googlePubSubContainerProxy

Example

To auto-configure spring-cloud-gcp-starter-pubsub use these properties in your test application.yaml:

/src/test/resources/application.yaml
spring.cloud.gcp:
  project-id: ${embedded.google.pubsub.project-id}
  pubsub.emulatorHost: ${embedded.google.pubsub.host}:${embedded.google.pubsub.port}