EventStore/EventStoreDB-Client-Java

Make EventData constructor public

roegerle opened this issue · 5 comments

Can we get the package private constructor of EventData public instead? Maybe I'm missing something but I don't see a way to set the mime type to anything of than application/json and application/octet-stream.

Thank you for asking @roegerle, custom mime types are not supported at this time.

Yes. I removed that comment though after looking at the api and the commit history of the project. I missed this method...

EventDataBuilder | json​(java.lang.String eventType, byte[] eventData)

Which I haven't tried but I suspect would suit my needs just fine. My problem is I have tons of custom serialization code in Gson and don't want to mess around with Jackson.

@roegerle That is expected. The UI will only display payload in a json format. Same with user defined projections, those will only work if the events they are dealing with have json payload. You can use any other format, the database doesn't care but all the built-ins visualization tools and the projections I talked about won't be able to process the payload.

Which I haven't tried but I suspect would suit my needs just fine. My problem is I have tons of custom serialization code in Gson and don't want to mess around with Jackson.

Rest assured you won't have to. Use the binary smart constructor/method and store your gson-format events stress-free. it's for usecases like that the binary format or application/octet-stream is meant for :)