Sign inSign up

indritvaka/pubsub-emulator-console

By indritvaka

Updated about 1 month ago

Web UI for the Google Pub/Sub emulator: publish, peek, pull, ack/nack, purge, manage topics & subs

Image
Developer tools
1

4.7K

indritvaka/pubsub-emulator-console repository overview

pubsub-emulator-console

A single-container web console for a Google Pub/Sub emulator. Publish, peek (non-destructive), pull, ack (delete) / nack (requeue), purge, and manage topics and subscriptions. Built for local development — no auth, localhost only.

This file is the source of the Docker Hub overview text and is pushed by CI. Edit it in the repository, not in the Docker Hub web form.

Ports

WhatPort
Console UI8680http://localhost:8680 — override with PORT
Pub/Sub emulator8086not Google's default 8085 — see below

The console listens on 8680.

Why the emulator is on 8086 rather than Google's documented default of 8085: gcloud already uses 8085 itself — gcloud auth login starts a local callback server on that port to complete the browser sign-in flow. An emulator sitting on 8085 clashes with it, so everything here defaults to 8086 instead. If you do run the emulator on 8085, just point the console at it: PUBSUB_EMULATOR_HOST=localhost:8085.

Run

docker run -d -p 127.0.0.1:8680:8680 \
  -e PUBSUB_EMULATOR_HOST=<emulator-host>:8086 \
  -e GCP_PROJECT_IDS=local-dev \
  indritvaka/pubsub-emulator-console:latest

Open http://localhost:8680.

Bind to loopback. This console has no authentication and can delete topics/subscriptions and purge backlogs, so keep it off public interfaces. The example binds to 127.0.0.1 on purpose — a plain -p 8680:8680 publishes on 0.0.0.0 (all interfaces).

Docker Compose

Point the console at the emulator by service name (pubsub-emulator:8086), not localhost:8086.

services:
  pubsub-emulator:
    image: gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators
    container_name: pubsub-emulator
    ports:
      - "8086:8086"
    environment:
      CLOUDSDK_CORE_DISABLE_FILE_LOGGING: "true"
    command: >
      gcloud beta emulators pubsub start
      --host-port=0.0.0.0:8086
      --project=local-dev
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:8086 || exit 1"]
      interval: 5s
      timeout: 3s
      retries: 12
      start_period: 10s
    networks:
      - pubsub-network

  pubsub-console:
    image: ${PUBSUB_UI_IMAGE:-indritvaka/pubsub-emulator-console:latest}
    container_name: pubsub-console
    depends_on:
      pubsub-emulator:
        condition: service_healthy
    ports:
      - "127.0.0.1:${PUBSUB_UI_PORT:-8680}:8680"
    environment:
      PUBSUB_EMULATOR_HOST: pubsub-emulator:8086
      GCP_PROJECT_IDS: local-dev
    networks:
      - pubsub-network

networks:
  pubsub-network:

Configuration

VarDefaultMeaning
PUBSUB_EMULATOR_HOSTlocalhost:8086host:port of the emulator
GCP_PROJECT_IDS(required)comma-separated project ids to show
PORT8680port the console listens on

Tags

  • latest — most recent tagged release
  • vX.Y.Z — a specific release
  • main — built from the tip of the default branch

What it does

This project exists because the Pub/Sub emulator UIs available at the time were mostly read-only: they showed topics, subscriptions and message state, but not the operations you actually need while developing — no non-destructive peek, no pull workflow, no purge, no quick create/delete of topics and subscriptions.

  • Publish messages to topics
  • Peek messages non-destructively
  • Pull messages from subscriptions
  • Ack messages
  • Nack / requeue messages
  • Bulk-select messages (select-all) to ack or nack in one click
  • Copy a message body to the clipboard
  • "Quick use" a pulled message to pre-fill the publish form on its topic
  • Keep an unsent publish draft per topic, so a half-written message (data, attributes, ordering key) survives navigating away, or a page reload
  • "Keep values after publishing" to resend the same message without retyping it
  • Purge subscription backlogs
  • Create and delete topics
  • Create and delete subscriptions
  • View topic → subscription relationships

The image bundles a React frontend with an Express backend that serves the UI and proxies browser requests to the emulator API.

Screenshots

Topic view — compose a message with attributes and an ordering key, keep the values to resend, and see the subscriptions attached to the topic:

Topic view: publish form holding a JSON body, a source=checkout attribute, an ordering key, and the "Keep values after publishing" option, above the list of subscriptions on the topic

Subscription view — peek or pull, then ack, nack or purge; select rows to act on them in bulk, or copy and "quick use" a single message:

Subscription view: four pulled messages listed by id, publish time, ordering key, attributes and data, all selected, with "Ack selected" and "Nack selected" bulk actions and per-row Copy and Quick use links

Limitations

The emulator does not expose exact backlog/undelivered counts (a Cloud Monitoring metric, absent locally). The console shows the count of messages a peek/pull returned, never a fabricated "N in backlog" badge.

Ordering keys are passed through and displayed faithfully, but subscriptions created here are not made ordering-enabled, so ordered delivery is not guaranteed for console-created subscriptions.

MIT-licensed. Created and maintained by Indrit Vaka.

Tag summary

Content type

Image

Digest

sha256:8dd5be6d1

Size

56.9 MB

Last updated

about 2 months ago

docker pull indritvaka/pubsub-emulator-console