-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Closed
MVP proposal #26
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ber) at project level
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theAttributeNamingPolicy
- must be used on publication side.The plural versions
ConsumesRawStrings
andConsumesRawObjects
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 genericsIHandle<T>
interface.jsonb
message data are read as stream and desarialised asT
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.