BroadwayCloudPubSub

A Google Cloud Pub/Sub connector for Broadway.

Documentation can be found at https://hexdocs.pm/broadway_cloud_pub_sub.

This project provides:

Installation

Add :broadway_cloud_pub_sub to the list of dependencies in mix.exs, along with the authentication library of your choice (defaults to :goth):

def deps do
  [
    {:broadway_cloud_pub_sub, "~> 0.1.0"},
    {:goth, "~> 0.11"}
  ]
end

By default, :goth will include :hackney as its HTTP client. If you choose to use an alternative authentication library, you may need to explicitly include an HTTP client (such as :hackney):

def deps do
  [
    {:broadway_cloud_pub_sub, "~> 0.1.0"},
    {:hackney, "~> 1.9"}
  ]
end

Usage

Configure Broadway with one or more producers using BroadwayCloudPubSub.Producer:

Broadway.start_link(
  MyBroadway,
  name: MyBroadway,
  producers: [
    default: [
      module:
        {BroadwayCloudPubSub.Producer,
         subscription: "projects/my-project/subscriptions/my-subscription"}
    ]
  ]
)

For more information, please see the docs for Broadway.

There is also an example app available at: https://github.com/mcrumm/broadway_cloud_pub_sub_example