Adding an Event Endpoint

Create outbound event endpoints with Go signatures and MulticastTrigger publishing.

172|5|Updated Sep 9, 2022
One-click install
npx skills add https://github.com/microbus-io/fabric --skill adding-an-event-endpoint
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Adding an Event Endpoint
Source: https://github.com/microbus-io/fabric/tree/main/.claude/skills/microbus/add-event
Command: npx skills add https://github.com/microbus-io/fabric --skill adding-an-event-endpoint

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineers create or modify outbound event endpoints of a microservice when explicitly requested, enabling reliable event-driven communication across services.

Core Features & Use Cases

  • Define outbound event in service.yaml with a signature starting with On and without context or error as required.
  • Generate boilerplate code via go generate to reflect the event and keep code in sync.
  • Define custom types as needed in the API to support event payloads.
  • Trigger outbound events using MulticastTrigger to publish to all subscribers.
  • Test and document the microservice, updating AGENTS.md as needed.

Quick Start

Define the outbound event in your service.yaml, run go generate to update boilerplate, implement the trigger using MulticastTrigger, and test the event flow.

Frequently Asked Questions about Adding an Event Endpoint

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an outbound event endpoint to a Go microservice?

Defining an outbound event in Go requires adding an On* signature to service.yaml and running go generate to create boilerplate. You then implement the event trigger using MulticastTrigger to publish messages to all subscribers.

What is the correct Go syntax for defining a microservice event signature in service.yaml?

The correct syntax requires the event signature to start with On and must not include context or error as required parameters. This enforces a clean contract for triggering outbound events from your microservice.

How does MulticastTrigger work for publishing outbound events?

MulticastTrigger works by publishing the outbound event payload to all subscribed services simultaneously. It is called within your generated boilerplate code to ensure reliable event-driven communication across microservices.

Do I need to run go generate after updating service.yaml for a new event?

Yes, you must run go generate after updating service.yaml. This command refreshes the boilerplate code to reflect the newly defined On* event signature and keeps your microservice implementation in sync.

Should I update AGENTS.md when adding an outbound event endpoint?

Yes, you should update AGENTS.md when adding an outbound event endpoint. The process includes reading the local AGENTS.md initially and updating it as needed to document the new event flow and microservice changes.

What are the limitations when defining custom types for event payloads in Go microservices?

You can define custom types in the API to support event payloads, but event signatures must strictly follow the On* naming convention and exclude context or error parameters to comply with the boilerplate generation rules.