rebus-org / Rebus.PostgreSql

:bus: PostgreSQL persistence for Rebus
https://mookid.dk/category/rebus
Other
17 stars 19 forks source link

Make saga serializer configurable #30

Closed mmdevterm closed 1 year ago

mmdevterm commented 2 years ago

Hello! While there is an option to pass JSON serializer settings when configuring Bus, these settings are only applied for transport, not for Saga.

var jsonSerializerSettings = new JsonSerializerSettings(); ... containerBuilder.RegisterRebus((configurer, context) => configurer .Serialization(s => s.UseNewtonsoftJson(jsonSerializerSettings)).

It would be great to be able to configure Saga serializer for postgres, similarly to Rebus.SqlServer: https://github.com/rebus-org/Rebus.SqlServer/issues/59.

Would it be something you could achieve with a simple copy&paste? Maybe I could support you with this somehow?

Thanks in advance!

mookid8000 commented 1 year ago

Yes definitely, as you've already discovered, Rebus' SQL Server saga persister allows for configuring the saga serializer, and I'm pretty sure a similar approach would work just fine with the Postgres persister.

If you're willing to make this change yourself, I'd be happy to assist you with submitting a PR.

You could start by forking the Rebus.PostgreSql repository and see if you can make the tests run. 🙂 Then it should be possible to use the same approach as with Rebus' SQL Server saga persister.

mmdevterm commented 1 year ago

Closing in favour of a created PR https://github.com/rebus-org/Rebus.PostgreSql/pull/31.