Closed Isacholm closed 2 years ago
Hi,
REMReM publish doesnot perform any vadilation on the events. It takes the event and publishes it to the configured exchange in messagebus.
We use REMReM generate to generate events and these events are published using publish.
REMReM generate uses eiffel-semantics protocol for generating the events. In eiffel-semantics, schema is defined for each event and generates the event. We always use generate for events generation and if we try to generate EiffelAnnouncementPublishedEvent with missing data.severity field, it will throw an exception.
I'm not sure what you're saying here. Doesn't the /producer/msg endpoint pass the event to REMReM Generate (or the semantics library) for validation? Or are you saying that the bug report is incorrect and that AnnP events with the data.severity field missing actually are rejected?
So the /producer/msg does not do any validation. Have you experienced the same problem when using "generateAndPublish" endpoint?
Oh, that would certainly explain things. This difference isn't clear from the documentation.
Would it be enough to update the documentation for the /producer/msg
endpoint and clarify that it doesn't validate the message?
If the documentation is clear on what the endpoint does I'm happy.
Description
When trying to send events with missing required fields, remrem should respond to the user that the event is invalid. Invalid events should not be published to rabbitmq.
When sending version 3.0.0 of EiffelAnnouncementPublishedEvent with the data.severity field missing (this field is described in the protocol as required), The response from remrem-publish is that the event was published fine (and it was).
response from /version:
Expected response from /producer/msg:
Actual response from /producer/msg:
Motivation
This protects users from sending and reading invalid events on the message broker.
Exemplification
Benefits
Possible Drawbacks