EventStore / EventStoreDB-Client-Java

Official Asynchronous Java 8+ Client Library for EventStoreDB 20.6+
https://eventstore.com
Apache License 2.0
61 stars 19 forks source link

Make EventData constructor public #252

Closed roegerle closed 8 months ago

roegerle commented 8 months ago

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.

cdevarenne commented 8 months ago

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

cdevarenne commented 8 months ago

Hey Robert,

Thanks for providing some context. By dashboard do you mean the web UI? I understand what you are saying now. Let me get back to you on this ASAP. Thanks

On Wed, Nov 8, 2023 at 2:21 PM Robert Oegerle @.***> wrote:

I'm evaluating EventStore so bear with me.

The end goal was to use something other than jackson for Java serialization.

Not using any of the json methods on the client and just using byte arrays obviously works just fine but the dash board doesnt format the json very well with a mime type of ther than json.

Any suggestions?

— Reply to this email directly, view it on GitHub https://github.com/EventStore/EventStoreDB-Client-Java/issues/252#issuecomment-1802773236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPGTUFWF657ZFF6FLO7XN3YDQAYPAVCNFSM6AAAAAA7DHGPM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBSG43TGMRTGY . You are receiving this because you modified the open/close state.Message ID: @.***>

roegerle commented 8 months ago

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.

YoEight commented 8 months ago

@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.

YoEight commented 8 months ago

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 :)