Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store event data and metadata as JSON #4

Open
slashdotdash opened this issue Sep 22, 2017 · 2 comments
Open

Store event data and metadata as JSON #4

slashdotdash opened this issue Sep 22, 2017 · 2 comments

Comments

@slashdotdash
Copy link
Member

slashdotdash commented Sep 22, 2017

Issue originally raised in Commanded by @drozzy (#81).

Need to investigate whether it is possible to persist event data & metadata as JSON when using a JSON event serializer.

Example

Persisted events from Event Store:

{
    "correlationId": "ccf88746-06ba-459f-b93a-9ccce1cebdf1",
    "readerPosition": {
        "$s": {
            "$ce-account": 6
        }
    },
    "events": [
        {
            "eventStreamId": "account-333-121-568-3245",
            "eventType": "Elixir.Bank.Events.AccountOpened",
            "data": "{\"timestamp_utc\":1506096118,\"initial_balance\":0,\"client_id\":\"3324-john.oliver\",\"account_id\":\"333-121-568-3245\"}",
            "metadata": "{\"$correlationId\":\"7e083e9e-bcf6-4cc5-8cc8-47d84f14ec50\"}",
            "readerPosition": {
                "$s": {
                    "$ce-account": 0
                }
            }
        },
   ]
}

Possible solution

Set the data_content_type and metadata_content_type to 1 for Extreme's ExMsg.NewEvent message (source).

@drozzy
Copy link

drozzy commented Sep 22, 2017

It would be nice if these were parameters we could set ourselves, and not hard-corded (to 0 or 1).

@drozzy
Copy link

drozzy commented Sep 22, 2017

Parameter for possibly to write_events, but I don't know where that is being called.
It should probably be set in the config:

config :commanded_extreme_adapter,
  serializer: Commanded.Serialization.JsonSerializer,
  stream_prefix: "commandeddev"
  data_content_type: 1

Or, per stream (somehow).

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

No branches or pull requests

2 participants