Extreme event store adapter for Commanded
Use Greg Young's Event Store with Commanded using the Extreme Elixir TCP client.
MIT License
Overview
Getting started
The package can be installed from hex as follows.
Add
commanded_extreme_adapterto your list of dependencies inmix.exs:def deps do[{:commanded_extreme_adapter, "~> 0.4"}]endConfigure Commanded to use the event store adapter:
config :commanded,event_store_adapter: Commanded.EventStore.Adapters.ExtremeConfigure the
extremelibrary connection with your Event Store connection details:config :extreme, :event_store,db_type: :node,host: "localhost",port: 1113,username: "admin",password: "changeit",reconnect_delay: 2_000,max_attempts: :infinityConfigure the
commanded_extreme_adapterto specify the JSON serializer and a stream prefix to be used by all Commanded event streams:config :commanded_extreme_adapter,serializer: Commanded.Serialization.JsonSerializer,stream_prefix: "commandeddev"Note Stream prefix must not contain a dash character ("-").
You must run the Event Store with all projections enabled and standard projections started. Use the --run-projections=all --start-standard-projections=true flags when running the Event Store executable.
Testing
The test suite uses Docker to run the official Event Store container.
You will need to install Docker. For Mac uses, you may also need to install socat to expose the Docker API via a TCP port from its default Unix socket.
socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock
Getting started
Pull the docker image:
docker pull eventstore/eventstore
Run the container using:
docker run --name eventstore-node -it -p 2113:2113 -p 1113:1113 eventstore/eventstore
Note: The admin UI and atom feeds will only work if you publish the node's http port to a matching port on the host. (i.e. you need to run the container with -p 2113:2113).
Web UI
Get the docker ip address:
docker-machine ip default
Using the ip address and the external http port (defaults to 2113) you can use the browser to view the event store admin UI.
Username and password is admin and changeit respectively.
Contributing
Pull requests to contribute new or improved features, and extend documentation are most welcome.
Please follow the existing coding conventions, or refer to the Elixir style guide.
You should include unit tests to cover any changes. Run mix test to execute the test suite.