No commit activity in last 3 years
No release in over 3 years
Category and stream consumer for EventStore
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Usage

Defining an EventStore Consumer Class

class SomeConsumer
  include Consumer::EventStore

  # Optional identifier that allows multiple consumers to maintain their
  # position offsets independently
  identifier 'someConsumerName'

  # Specifies a handler implementation for handling messages
  handler SomeHandler

  # Errors are handled by this method. If this method is omitted, the default
  # action when an error is raised during the handling of a message is to
  # re-raise the error.
  def error_raised(error, event_data)
    SomeErrorNotificationService.(error)

    WriteNotProcessable.(event_data)
  end
end

Using a Consumer Class

The consumer can be started directly or through the use of component-host. Use of ComponentHost is recommended for services deployed to a production environment.

Starting a Consumer Directly

SomeConsumer.start("someCategory")

Starting via ComponentHost

See the documentation for information on how to use ComponentHost with consumers.

License

The consumer-event_store library is released under the MIT License.