Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVP proposal #26

Closed
wants to merge 67 commits into from
Closed

MVP proposal #26

wants to merge 67 commits into from

Conversation

lsfera
Copy link
Contributor

@lsfera lsfera commented Jul 21, 2024

This PR covers all basic usage I was able to think about.
Messages are always stored in PostgreSql jsonb data type, hence publisher process is constrained on json serialization.

Consuming messages is instead more flexible since we are able to read data as string, object, or stream.
The former require subscriber(s) to subscribe publication(s) through one of the prefixed ConsumesRaw( String<>|Object<>| Strings | Objects ) methods.
The generics version require the RawUrn attributes to decorate the POCO class( no body required here, since it's nothing but a placeholder). RawUrn Urn property will be used to constraint publication creation, providing the row filter where clause(*).
Since we need to conform to a common standard shared by producer and consumer, the only supported NamingPolicy for this use case is the AttributeNamingPolicy - must be used on publication side.

The plural versions ConsumesRawStrings and ConsumesRawObjects won't provide any filter on publication, thus providing a single message sink for all published data.

Last but not least the Consumes<> subscription method provides the hook to the generics IHandle<T> interface.
jsonb message data are read as stream and desarialised as T using System.Text.Json.JsonSerializer through the (mandatory) JsonSerializerContext.

Message table creation is enforced at subscription time ( but can also be assured at publication time) and support a few customization on column names/size see related tests.

(*) Remark Publication and subscription are managed by subscriber process.

@lsfera lsfera mentioned this pull request Jul 21, 2024
@lsfera lsfera changed the title honest MVP MVP proposal Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant