Package io.nitric.api.event

Provides the Event Service API.

The example below illustrates the Event API.


  import io.nitric.api.Event;
  import io.nitric.api.Events;

  // Create an order completed event
  var payload = Map.of("id", id, "status", "completed");
  var event = Event.build(payload);

  // Publish the event to the orders topic
  Events.topic("orders").publish(event);

  // Get the list of available topics
  List<Topic> topics = Events.topics();