Categorygithub.com/xtracdev/orapub
modulepackage
1.0.0
Repository: https://github.com/xtracdev/orapub.git
Documentation: pkg.go.dev

# README

OraPub

CircleCI

This project provides code to process events to publish in the Oracle event store, with hooks for adding processing functions to be invoked for each published event.

Usage

Packages that wish to process published events need to provide implementations of the Initialize and Processor function types in an EventProcessor structure, and register them with the package.

Once everything is registered, an OraPub instance can be instantiated, its Connect method called, the processors initialized via the InitializeProcessors method, then the event loop instantiated using ProcessEvents.

The es-data-pub project performs all the steps needed to process published events. Using the es-data-pub project, all a packge needs to do for processing events is to import the event processing packages, register them if they don't register themselves in their package init methods, then invoke the es-data-pub ProcessEventMethod function.

Limitations

The current implementation doesn't have a clean way to shutdown the processing loop.

Event processing is done within a transaction, which is used to isolate the processing of events amidst concurrent event processors. The transaction does not extend to the event processors - if they return errors they will not get another shot at processing the event. Also, if an error occurs causing the transaction to rollback, it is possible the event processor could be invoked with the same event at a later time.

Dependencies

go get github.com/Sirupsen/logrus
go get github.com/xtracdev/goes
go get github.com/rjeczalik/pkgconfig/cmd/pkg-config
go get github.com/mattn/go-oci8

Contributing

To contribute, you must certify you agree with the Developer Certificate of Origin by signing your commits via git -s. To create a signature, configure your user name and email address in git. Sign with your real name, do not use pseudonyms or submit anonymous commits.

In terms of workflow:

  1. For significant changes or improvement, create an issue before commencing work.
  2. Fork the respository, and create a branch for your edits.
  3. Add tests that cover your changes, unit tests for smaller changes, acceptance test for more significant functionality.
  4. Run gofmt on each file you change before committing your changes.
  5. Run golint on each file you change before committing your changes.
  6. Make sure all the tests pass before committing your changes.
  7. Commit your changes and issue a pull request.

License

(c) 2016 Fidelity Investments Licensed under the Apache License, Version 2.0

# Functions

ClearRegisteredEventProcessors clears out the registered event processors.
RegisterEventProcessor registers an event processor with OraPub.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

EventProcessor is implemented for hooking into the processing of the eventsin the event store publish table.
EventSpec is the specification of a published event.
OraPub provides the ability to process the events in the event store publish table.