NixBus is an HTTP-based event bus designed to simplify event-driven development and empower microservice architectures. It provides secure, robust, and efficient inter-service communication, helping developers decouple application services, follow SOLID principles, and avoid the complexity of traditional event bus systems.
Key Capabilities
- Implements an event bus over HTTP, supporting decoupling of services and event-driven architecture.
- Provides an npm package
@nixbus/event-bus, making it easy to integrate into Node.js projects. - Supports subscribing to events and publishing events, and allows configuring retry count, timeout, and concurrency.
- Provides token and passphrase for secure authentication.
- Optional regional storage (such as London, Los Angeles, with more regions coming soon) to reduce latency and speed up processing.
Usage
- Install dependencies:
npm install @nixbus/event-bus --save -E - Create an event bus file (such as
event-bus.ts), obtain an HTTP event bus instance, pass in the token and passphrase, subscribe to events, and run:
import { getNixBusHttp } from '@nixbus/event-bus'
async function main() {
const nixbus = getNixBusHttp({
token: 'your_token',
passphrase: 'your_passphrase',
})
await nixbus.subscribe('event_type', {
id: 'subscriber_id',
action: async (event) => {
console.log('subscriber_id:', event)
},
config: {
maxRetries: 3,
timeout: 10,
concurrency: 5,
},
})
nixbus.run()
}
main().catch(console.error)
- Publish events anywhere in the application (such as
app.ts):
import { getNixBusHttp } from '@nixbus/event-bus'
async function runYourApp() {
const nixbus = getNixBusHttp({
token: 'your_token',
passphrase: 'your_passphrase',
})
await nixbus.publish({
type: 'event_type',
payload: { welcome: 'to the event bus 0' },
})
// Simulate a delay before publishing another event
await new Promise((resolve) => setTimeout(resolve, 2000))
await nixbus.publish({
type: 'event_type',
payload: { welcome: 'to the event bus 1' },
})
}
runYourApp().catch(console.error)
- Run the event bus:
tsx event-bus.ts - Run the application:
tsx app.ts
Use Cases
- Service decoupling and event-driven communication in microservice architectures.
- When a lightweight, HTTP-based event bus is needed to avoid the operational overhead of traditional systems.
- Node.js applications that need rapid integration and on-demand scaling of event processing capabilities.
Limitations and Notes
- The official text does not provide specific pricing, performance metrics, supported programming languages (only TypeScript/Node.js is shown in examples), or integration details with other systems; these are not currently provided.
- Specific service tiers and quota information (such as standard access, event reserve, retention period, number of subscribers, etc.) are mentioned in the official text, but corresponding prices are not given, so pricing is not currently provided.
- You can start sending events without a credit card; specific trial limits are not currently provided.