Metadata-Version: 2.1
Name: pubsub-emulator-messaging-setup
Version: 0.1.0
Summary: CLI tool to setup topics and subscriptions on a PubSub emulator from a definition in a YAML file
Home-page: https://github.com/expobrain/pubsub-emulator-messaging-setup
License: MIT
Author: Daniele Esposti
Author-email: daniele.esposti@gmail.com
Requires-Python: >=3.7,<3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: PyYAML (>=6.0)
Requires-Dist: click (>=8.1)
Requires-Dist: google-api-core (>=2.10)
Requires-Dist: google-auth (>=2.13)
Requires-Dist: google-cloud-pubsub (>=2.13)
Requires-Dist: grpcio (>=1.50)
Requires-Dist: loguru (>=0.6)
Requires-Dist: pydantic (>=1.10)
Project-URL: Repository, https://github.com/expobrain/pubsub-emulator-messaging-setup
Description-Content-Type: text/markdown

# pubsub-emulator-messaging-setup

A small tool to create topics and subscriptions on a PubSub emulator in a simple and quick way.

## Usage

Just create a `pubsub.yml` file with the list of topics and topic's subscriptions like this one:

```yaml
topics:
  - name: my_topic
    subscriptions:
      - my_subscription_1
      - my_subscription_2
```

Then run `pubsub_emu_setup`:

```bash
pubsub_emu_setup
```

and it will automatically ensure that all the topics and subscriptions are created in the PubSUb emulator.

## Starting a PubSub emulator in Docker

Google provides a very convenient image to start a PubSub emulator locally with Docker.

A simple Docker Compose file like the one below is suffice to have a working Pubsub emulator:

```yaml
version: "3.8"

services:
  pubsub_emulator:
    image: google/cloud-sdk:emulators
    ports:
      - 8085:8085
    command: |
      gcloud beta emulators pubsub start --project=test-project --host-port=0.0.0.0:8085
```

