Thanks for the quick reply.
This the function that actually adds the events to event store:
`
public Task Add(Message message)
{
_logger.DebugFormat("Adding message to Event Store Message Store: {0}", JsonConvert.SerializeObject(message));
var eventBody = Encoding.UTF8.GetBytes(message.Body.Value);
var headerBagJson = JsonConvert.SerializeObject(message.Header, new KeyValuePairConverter());
var eventHeader = Encoding.UTF8.GetBytes(headerBagJson);
var eventData = new[] { new EventData(message.Id, message.Header.Topic, true, eventBody, eventHeader) };
var numberOfPreviousEvent = GetEventNumber(message.Header) - 1;
return _eventStore.AppendToStreamAsync(GetStreamId(message.Header), numberOfPreviousEvent, eventData);
}
`
This function is called in this context:
_messageStore.Add(message).Wait(_messageStoreWriteTimeout);
``
This is called once per message that I want to store.
I know this is not ideal in terms of not batching the events and calling wait, but the above are part of a library we’re using and so the application code does not have direct access to the Event Store API.
We’re using a client connected to a server. Anything else that would be useful to know?
Ta