Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hden/cloud-pubsub-batch-publisher

Batch publisher for Google Cloud PubSub
https://github.com/hden/cloud-pubsub-batch-publisher

Last synced: 3 months ago
JSON representation

Batch publisher for Google Cloud PubSub

Awesome Lists containing this project

README

        

# cloud-pubsub-batch-publisher

A batch publisher for Google Cloud PubSub.

## Installation

## Usage

```clj
(require '[cloud-pubsub-batch-publisher.core :as pubsub])

(def publisher (pubsub/publisher "TOPIC-NAME")

;; In a single publish request, all messages must have no ordering key
;; or they must all have the same ordering key.
;; See https://cloud.google.com/pubsub/docs/ordering
(def messages
[{:message "MESSAGE" ;; String, required
:metadata {"KEY" "VALUE"} ;; Map, optional
:ordering-key "KEY"}]) ;; String, optional

(pubsub/publish! publisher {:messages messages})

(pubsub/shutdown! publisher {:await-msec 1000})
```

## License

Copyright © 2021 Haokang Den