Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Changes to include local file as a valid fake data sink #127

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

emartinezs44
Copy link

Description

Changes are intended to Khermes to provide the capability of creating files with fake data. As the project was closely related to Kafka I include a new Akka Stream-based implementation of the SupervisorActor. Depending on AppConfig parameters, the stream is started with a flow which writes events to a local file or with a flow which sends event to Kafka. Events are generated in a Actor publisher and Twirl compiled template is cached in another actor which is spawn each time the Supervisor receives a Start message. In the last supervisor implementation there is a very bad performance, because each time a event is generated the template is again compiled.

This new implementation uses the Akka Stream api to avoid dealing with Threads. It uses GroupWithin and the Cats State monad to provide context generating events although this is not implemented yet.

The html console is changed to support file configuration and to ask the sink type, Kafka or file, starting the producer actor.

A CateryGenerator is included to support generating fields for a Category. Samples are included in the new Quickstart section.

Scripts to create and start a Khermes docker container and a Zookeeper are included in the directory scripts/quickstart. With that there is no need of Kafka to start generating events quickly.

Testing

  • 91% of code coverage for the new Supervisor implementation

Documentation

  • Changelog modified
  • New quickstart section in Readme.md

Scalastyle

Disabled in EventPublisher class due cyclomatic complexity although class looks very simple

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant