No commit activity in last 3 years
No release in over 3 years
Use this gem to publish JSON API events to RabbitMQ.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

JsonapiPublisher

Use this gem to publish events as JSON API to RabbitMQ. It requires ActiveModelSerializers with JSONAPI enabled as the adapter.

Usage

routing_key = "this.is.your.standard.rabbitmq.routing.key"
object = YourActiveRecordModel.create(...)
JsonapiPublisher.publish(routing_key, object, "CREATED")

Installation

Choose sqs or rabbit mq with
gem 'bunny', '~> 2.7'
or
gem 'aws-sdk', '~> 2'

Add this line to your application's Gemfile:

gem 'jsonapi_publisher'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jsonapi_publisher

Configuration

Inside config\initializers\jsonapi_publisher.rb put

JsonapiPublisher.configure do |config|
  config.qservice = XXX # XXX can be 'sqs' or 'rmq'
end

Testing

Run docker run -p 9324:9324 lightspeedretail/fake-sqs docker run -d -p 5672:5672 rabbitmq:latest rake test

License

The gem is available as open source under the terms of the MIT License.