Liking cljdoc? Tell your friends :D

clj-gcp

Clojure utilities for the Google Cloud Platform.

Usage

Mainly used through integrant:

;; ig-config.edn
:common.clients.pub-sub/subscriber
{:metrics-registry     #ig/ref :metrics/registry ;; a iapetos metric registry
 :handler              #ig/ref :pubsub/handler ;; a fn, described below
 :project-id                   "my-gcp-project"
 :topic-id                     "industry-data-lake-file-notifications"
 :pull-max-messages            10
 :subscription-id              "LOCAL_DEV.bucket-notifications.my-service"}

The function :handler takes:

  { ,,, pub-sub message fields (always deserialized as JSON) ,,,
   :pubsub/attributes {:eventType "OBJECT_FINALIZE"}
   :pubsub/ack-id     "0000000ACK"}

... and should return at least:

;; these will be acked:
{:pubsub/ack-id     "0000000ACK"
 :ok? true}
{:pubsub/ack-id     "0000000ACK"
 :ok? false
 :retry? false}

;; this will be nacked:
{:pubsub/ack-id     "0000000ACK"
 :ok? false
 :retry? true}

Running Tests

GCP_PROJECT_ID=my-gcp-project lein test :integration

License

Copyright © 2018 OVO Energy Ltd.

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close