Events
An order was accepted. Inventory or another subscriber may need to react, but Orders does not need their answer to this publication. The EventBus connects typed protobuf events to consuming handlers through an adapter.
One publication
Given a generated OrderCreatedSchema and a started eventBus:
typescript
import { create } from '@bufbuild/protobuf';
await eventBus.publish(
OrderCreatedSchema,
create(OrderCreatedSchema, { orderId: 'order-42' }),
);The adapter determines publication confirmation and delivery behavior. Subscribers must account for failures and repeated deliveries; publishing does not create a distributed transaction.
Go deeper
- Build a publisher and subscriber.
- Choose the broker adapter.
- Routing, EventContext and shutdown drain.
- Retry, dead letters and consuming middleware.
Features marked Since 1.3.0 in the detailed guides require that package at 1.3.0 or later.
Find a section from the full guide
The detailed material is preserved on a separate page. Earlier section links still work here.