Skip to content

Elixir client for the PGMQ extension, built for Ecto

Notifications You must be signed in to change notification settings

v0idpwn/pgmq-elixir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pgmq

Thin elixir client for the pgmq postgres extension.

Installation

For instructions on installing the pgmq extension, or getting a docker image with the extension installed, check the official pgmq repo.

The package can be installed by adding pgmq to your list of dependencies in mix.exs:

def deps do
  [
    {:pgmq, "~> 0.1.0"}
  ]
end

If needed, you can create a migration to create the extension in your database:

defmodule MyApp.Repo.Migrations.CreatePgmqExtension do
  use Ecto.Migration

  def change do
    execute("CREATE EXTENSION pgmq CASCADE")
  end
end

And to create queues:

defmodule MyApp.Repo.Migrations.CreateSomeQueues do
  use Ecto.Migration

  def up do
    Pgmq.create_queue(repo(), "queue_a")
    Pgmq.create_queue(repo(), "queue_b")
    Pgmq.create_queue(repo(), "queue_c")
  end

  def down do
    Pgmq.drop_queue(repo(), "queue_a")
    Pgmq.drop_queue(repo(), "queue_b")
    Pgmq.drop_queue(repo(), "queue_c")
  end
end

Documentation

Check our documentation in Hexdocs.

Usage with Broadway

The OffBroadwayPgmq package provides a configurable Broadway adapter that manages reading, acking and archiving failing messages.

Stability warning

This package (and pgmq) are both pre-1.0 and might have breaking changes.

About

Elixir client for the PGMQ extension, built for Ecto

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages