Transport
Can use DB Transaction to record whether an event has been published to a queue.
Means saving two items per tranaction. One to the entity of interest the other to the event audit table. See detailed explanation
Checklist
What checklist do you need to evolve when selecting a transport layer for your dev stack?
Listeners
Standard signiture for a listener is:
import { Message } from "node-nats-streaming";
import { Subjects, Listener, TicketCreatedEvent } from "@stackmates/common";
export class TicketCreatedListener extends Listener<TicketCreatedEvent> {
subject: Subjects.TicketCreated = Subjects.TicketCreated;
queueGroupName = "orders-service";
onMessage(data: TicketCreatedEvent["data"], msg: Message) {
// extract data
// take action to persist
// if success acknowledge the message
msg.ack();
}
}
Questions
Which message bus design decision — topic partitioning, consumer group strategy, or at-least-once versus exactly-once delivery — has the most downstream impact on system reliability?
- At what event volume does a message bus become essential versus direct HTTP calls being sufficient?
- How does real-time event streaming change the architecture for agent-native applications that need to react to on-chain events?
- Which message bus technology (Kafka, Convex, or SQS) is most appropriate for a DePIN application that needs to process sensor data from thousands of devices?