I see a difference when sending events as either a single event, or in a batch.
My contents for a single event looks like:
{
“eventType”:“TestEvent”,
“eventId”:“2c5706e5-60f0-47cc-8865-41b15eee6b89”,
“data”:{
“name”:“Name of the first event”
}
}
``
I post it to the Event Store using:
curl -i -d @es_single_test.txt “http://192.168.59.103:2113/streams/newstream” -H “Content-Type:application/json” -H “ES-EventType:TestEvent” -L
``
In the Event Store I see data received is:
{
"eventType": "TestEvent",
"eventId": "2c5706e5-60f0-47cc-8865-41b15eee6b89",
"data": {
"name": "Name of the first event"
}
}
``
… which is just what I expected.
BUT!
My contents for a batch of three events looks like:
[
{
“eventType”:“TestEvent”,
“eventId”:“405706e5-60f0-47cc-8865-41b15eee6b89”,
“data”:{
“name”:“Name of the first event”
}
},
{
“eventType”:“TestEvent”,
“eventId”:“0cbbb514-6c7f-447c-90a8-fcb65104d143”,
“data”:{
“name”:“Name of the second event”
}
},
{
“eventType”:“TestEvent”,
“eventId”:“3b802922-7496-4b2c-b0a6-7bf9b7b8ad2f”,
“data”:{
“name”:“Name of the third event”
}
}
]
``
I post it to the Event Store using:
curl -i -d @es_batch_test.txt “http://192.168.59.103:2113/streams/newstream” -H “Content-Type:application/vnd.eventstore.events+json” -L
``
In the Event Store I see data received are three separate events (which is perfect). However, each event has the following data (taken the first one only here):
{
"name": "Name of the first event"
}
``
… What happened with the “eventType”, “eventId”? Why is it different than when I send a single event?