kithara.middlewares.confirmation-defaults
wrap-confirmation-defaults
(wrap-confirmation-defaults message-handler {:keys [default-confirmation error-confirmation], :or {default-confirmation {:status :ack}, error-confirmation {:status :nack}}})
Wrap the given function, taking a kithara message map, making sure it returns a kithara confirmation map to be processed by wrap-confirmation.
:default-confirmation
will be used if the result is not a map or does not contain a valid:status
key.:error-confirmation
will be used if an exception is encountered (with the exception beingassoc
ed into the map as:error
).
This is a middleware activated by default in the kithara base consumer.