All notable changes to this project will be documented in this file.
- Required fields validation for the Raw and Batch publishers.
- Fix sort in receiving (#79).
- Send all original attributes for
delete
events instead of just PK.
rabbit_messaging
gem version is locked on~> 0.13
in order to provide a way to keep "up-to-date" the actual rabbit_messaging gem version on our projects with table_sync update;
- Instead of using
object_class
forTableSync::Publishing::Raw
, usemodel_name
, which acceptsString
instead ofClass
. - Can manually disable notifications by setting
TableSync.notify = false
. TableSync::Publishing::Raw
accepts two additional optional arguments:table_name
andschema
, this attributes only used to fill information for the notification.
Debouncer
calculates propernext_sync_time
Fixed bug when routing key is nil.
- Fixed bug: skip publish when object is new and event is destroy for ActiveRecord
- fixed docs
- A lot of specs for all the refactoring.
- Docs
- 100% coverage
- Heavy refactoring of Publisher and BatchPublisher. All code is separated in different modules and classes.
- Job callables are now called:
- single_publishing_job_class_callable
- batch_publishing_job_class_callable
- Now there are three main classes for messaging:
- TableSync::Publishing::Single - sends one row with initialization
- TableSync::Publishing::Batch - sends batch of rows with initialization
- TableSync::Publishing::Raw - sends raw data without checks
Separate classes for publishing, object data, Rabbit params, debounce, serialization.
-
Jobs are not constrained by being ActiveJob anymore. Just need to have #perform_at method
-
Changed some method names towards consistency:
- attrs_for_routing_key -> attributes_for_routing_key
- attrs_for_metadata -> attributes_for_headers
-
Moved TableSync setup into separate classes.
-
Changed ORMAdapters.
-
Destroyed objects are initialized. Now custom attributes for destruction will be called on instances.
- Obj.table_sync_destroy_attributes() -> Obj#attributes_for_destroy
- Event constants are now kept in one place.
- Plugin Errors
- Provide current fired event to wrap receiver. You'll be able to get it with
wrap_receiving(event:, **rest) {}
as usual fordata, target_keys, version_key
- Update rails dependencies with patch version
- documentation
- update gems
- Fix
delete
events being broken when either#attrs_for_routing_key
or#attrs_for_metadata
was defined on a model.
- Instead of original attributes (default raw model attributes), use published attributes (as defined by
#attributes_for_sync
or.table_sync_destroy_attributes
) forTableSync.routing_key_callable
andTableSync.routing_metadata_callable
. - Send all original attributes for
delete
events instead of just PK.
- potential data corruption with batches
- bug with sorting data in handler, it was bad idea to use
.hash
replaced to.to_s
- No changes. Just stabilization release.
- bug with sorting data in handler
- dead locks in receiving module (see:
spec/receiving/handler_spec.rb#avoid dead locks
)
- move
TableSync::Instrument.notify
from models to the handler - fire
TableSync::Instrument.notify
after commit insted of in transaction
- config inheritance
- TableSync::Plugins
- option
except
to_model
in receive method- TableSync::Utils::InterfaceChecker
- .rubocop.yml
- documentation
- modules hierarchy (split receiving and publishing)
TableSync::Publisher
->TableSync::Publishing::Publisher
TableSync::BatchPublisher
->TableSync::Publishing::BatchPublisher
TableSync::ReceivingHandler
->TableSync::Receiving::Handler
- made data batches processing as native
- implemented callbacks as options
- implemented
wrap_receiving
as option - type checking in options
before_commit on: event, &block
->before_update(&block)
orbefore_destroy(&block)
after_commit on: event, &block
->after_commit_on_update(&block)
orafter_commit_on_destroy(&block)
- changed parameters in some options:
add
raw_data
current_row
->row
... see documents for details
- TableSync::Config::CallbackRegistry
- TableSync::EventActions
- TableSync::EventActions::DataWrapper
- config option
on_destroy
- config option
partitions
- config option
first_sync_time_key
- ruby 2.7 in Travis
- Gemfile.lock
- some fixes to get rid of warnings for ruby 2.7 (implicit conversion of hashes into kwargs will be dropped)
- TableSync.sync now explicitly expects klass and kwargs (it converts them into hash)
- TableSync::Instrument.notify now explicitly expects kwargs and delegates them further as kwargs
- ruby 2.3, 2.4 from Travis
- Introduce Plugin ecosystem (TableSync::Plugins);
- Updated docs for batch_publishing to fully reflect changes in 2.1.0
- TableSync::BatchPublisher: custom headers;
- TableSync::BatchPublisher: custom events;
- Slight changes to specs
- Sequel publishing hooks: checking for
:destroy
events inside:if
/:unless
predicates
- TableSync::BatchPublisher: incorrect
attrs_for_metadata
definition (typo in method name);
- Wrapping interface around receiving logic (
wrap_receiving
);
- The
default_values
option no longer overrides original values.
- Payload for existing ActiveSupport adapter contains both
table
andschema
fields now.
- Receiving: inconsistent events raises
TableSync::UnprovidedEventTargetKeysError
(events that include only some of the target keys (or none))
- convert symbolic values to strings in hashes to support older versions of activejob
- add notifications
debounce_time
option for publishing
on_destroy
return value for manipulation withafter_commit
callback;
on_destroy
- defines a custom logic and behavior fordestroy
event;