Registry / messaging / amphora-event-bus-redis

amphora-event-bus-redis

JSON →
library0.0.1jsnpmunverified

A Redis-based event bus module for Amphora CMS that enriches published messages with additional context. Compatible with Amphora v7.1.0. This is an alternative to the default in-memory or simple bus, providing persistence and cross-process communication via Redis. It uses the same CLAY_BUS_HOST environment variable as Amphora's default bus and respects topic namespaces. The module must be passed to Amphora's eventBus option. It is a small, focused package with minimal dependencies, suited for production deployments requiring reliable event distribution across multiple Amphora instances.

npm install amphora-event-bus-redis
INSTALL
IMPORT
SIG · AMPHORA-EVENT-BUS-
A
amphora-event-bus-redis
messagingjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const eventBus = require('amphora-event-bus-redis')
import eventBus from 'amphora-event-bus-redis'
The package does not provide an ESM export; use CommonJS require().

Initializes Amphora with the Redis event bus module, assuming CLAY_BUS_HOST env var is set.

const express = require('express'); const amphora = require('amphora'); const eventBus = require('amphora-event-bus-redis'); const app = express(); // Ensure CLAY_BUS_HOST is set, e.g., process.env.CLAY_BUS_HOST = 'redis://localhost:6379'; amphora({ app, renderers: {}, providers: [], plugins: [], storage: require('amphora-storage-postgres'), eventBus: eventBus }).then(() => { app.listen(3000, () => console.log('Amphora with Redis event bus running')); });
Debug
Known issues
gotchaMust set CLAY_BUS_HOST environment variable, otherwise the Redis connection will fail silently or use default connection settings.
fix
Set the environment variable before starting the application: export CLAY_BUS_HOST=redis://localhost:6379
affects: >=0.0.1
gotchaOnly compatible with Amphora v7.1.0; using with other versions may cause unexpected behavior or errors.
fix
Ensure Amphora version is exactly ^7.1.0.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Redis connection error: connect ECONNREFUSED 127.0.0.1:6379
Redis server is not running or CLAY_BUS_HOST is not set correctly.
fix
Start Redis server or set CLAY_BUS_HOST to a valid Redis URL.
TypeError: eventBus is not a function
The eventBus option expects a function, not an object. Using require correctly returns the function.
fix
Assign require('amphora-event-bus-redis') directly, without wrapping.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
amphora-event-bus-redis — npm install amphora-event-bus-redis · libregistry