No release in over a year
A client for event services provided by DOR Services App
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 12.3.3
~> 3.0
~> 1.0

Runtime

>= 4.2, < 8
~> 2.17
~> 2.1
 Project Readme

Gem Version CircleCI Code Climate Code Climate Test Coverage

Dor::Event::Client

Dor::Event::Client is a Ruby gem that acts as a client for the event services provided by dor-services-app.

Currently, the client only supports the asynchronous creation of events (via RabbitMQ). In the future, other operations (including synchronous operations via HTTP) may be supported. At present, additional event operations are supported by dor-services-client.

Installation

Add this line to your application's Gemfile:

gem 'dor-event-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dor-event-client

Configuration

To configure and use the client, here's an example for a Rails app:

In config/initializers/dor_event_client.rb:

Dor::Event::Client.configure(hostname: Settings.rabbitmq.hostname,
  vhost: Settings.rabbitmq.vhost,
  username: Settings.rabbitmq.username,
  password: Settings.rabbitmq.password)

Operations

# Create and list events for an object
Dor::Event::Client.create(druid:, type:, data:)

# For example:
Dor::Event::Client.create(
  druid: 'druid:bb408qn5061', 
  type: 'druid_version_replicated', 
  data {
      host: 'preservation-catalog-qa-02.stanford.edu',
      version: 19,
      invoked_by: 'preservation-catalog',
      parts_info: [
        {
          md5: '1a528419dea59d86cfd0c456e9f10024',
          size: 123630,
          s3_key: 'bb/408/qn/5061/bb408qn5061.v0019.zip'
        }
      ],
      endpoint_name: 'aws_s3_east_1'
    }:
  )

Development

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sul-dlss/dor-event-client

Copyright

Copyright (c) 2018 Stanford Libraries. See LICENSE for details.