Skip to content
Event Sourcing and Microservices Stack for Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/consumer
settings
test
tmp
.gitignore
Gemfile
MIT-License.txt
README.md
consumer-event_store.gemspec
init.rb
install-gems.sh
library-symlinks.sh
load_path.rb
remove-lib-symlinks.sh
symlink-lib.sh

README.md

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.

You can’t perform that action at this time.