LOGBOOK

HELP

Quiz Entry - updated: 2026.07.30

How does a developer declare and fire a user-defined notification in NPL, and when is the message actually published?

You declare a typed notification in the protocol scope and fire it with notify — but the Runtime publishes the AMQP message only after the triggering action has committed to the database, guaranteeing transaction safety.

The pattern has three parts:

  1. Declare the notification, with parameters shaped to what the consumer needs: notification PayInterests(iban: Text, amount: Number) returns Unit;
  2. Fire it from inside an action: notify PayInterests(iban, interests);
  3. Publish timing — the Runtime pushes the message to the broker only when the requested action successfully completes and commits to the database.

That last point is the safety guarantee: a notification is never emitted for work that later rolled back. Downstream systems can trust that if they received "pay interests", the interest calculation really did happen and persist. This is why the takeaway is "events are only published when the associated business logic has been successfully executed."

From Quiz: IOTHACK / The Noumena Build Platform | Updated: Jul 30, 2026