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

context.markIdempotent(), .markNonIdempotent(), .markReadOnly(), .markSafe() #49

Open
stolsvik opened this issue Jan 31, 2022 · 0 comments
Labels
thoughts Issues describing some thoughts around a subject

Comments

@stolsvik
Copy link
Contributor

stolsvik commented Jan 31, 2022

Provide a way for the developer to tell Mats whether this initiation/stage is idempotent or non-idempotent.

This could be the clue for Mats to enable inbox/outbox if available.

It would also aid in setting the "tone" of the log messages, i.e. "VERY BAD": It isn't very bad if the initiation or stage is idempotent.

(Also refer to #78, where this is set on the entire Stage via StageConfig)

For an initiation, this could denote that a failure to get the messages out will be handled by a later run: If e.g. a message is initiated every 10 minutes to grab batches of messages, it doesn't matter much if one of the slots fails. As such, the severity of the loglines could be reduced.
(Is it also a mark of whether an initiation is "important"? That is, a "GET style" to present for users: In the extremely odd case where this fails, the world doesn't crash. Or is this already deduced by "nonPersistent"?)

For stages, it could control:

  1. Whether to enable the inbox/outbox: If nonIdempotent, it means that this stage doesn't handle double deliveries: It might fail out on the second attempt (due to some entity already being inserted in a database, and it will fail the second round thus not send its outgoing messages).
  2. What to write in the logs: If idempotent, the severity of the log lines could be reduced, from error-VERYBAD, to warn-"Sorry".

Relevant section in HTTP/1.1 spec wrt. "safe" and "idempotent" methods:
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - section 9.1

@stolsvik stolsvik changed the title context.markIdemptotent() and .markNonIdempotent() context.markIdempotent() and .markNonIdempotent() Jan 31, 2022
@stolsvik stolsvik added the thoughts Issues describing some thoughts around a subject label Sep 25, 2022
@stolsvik stolsvik changed the title context.markIdempotent() and .markNonIdempotent() context.markIdempotent(), .markNonIdempotent(), .markReadOnly(), .markSafe() Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
thoughts Issues describing some thoughts around a subject
Projects
None yet
Development

No branches or pull requests

1 participant