Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rabbitmq, nats and rest as relay services #127

Merged
merged 8 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ If provided in the call to `init()`, this will be a subject to listen for messag
- `warn(message: string): void`: Logs a warning message.
- `error(message: string | Error): void`: Logs an error message.

- **Interface**: IRelayService
- **Methods**:
- `relay(data: Uint8Array): void'`: Relays a message

- **Interface**: IRelayConfig
- **Properties**:
- `destinationType: 'nats' | 'rabbitmq' | 'rest'`: The type of service to relay to.
- `destinationUrl: string`: Endpoint to relay messages to
- `producerStream: string`: Read from the startup config
4. **Types**

- **onMessageFunction**
Expand Down Expand Up @@ -244,6 +253,21 @@ The `frms-coe-startup-lib` library uses environment variables to configure the s
- `PRODUCER_STREAM`: The name of the producer stream.
- `CONSUMER_STREAM`: The name of the consumer stream.

### Relay Environment Variables

- `DESTINATION_URL`: Specifies the startup type (`nats`).
- `DESTINATION_TYPE`: The node environment (`development`, `production`, etc.).

#### NATS-Specific Relay Variables
- `PRODUCER_STREAM`: The destination to relay messages to

#### Rest-Specific Relay Variables
- `JSON_PAYLOAD`: Convert the message to json before relaying
- `MAX_SOCKETS`: Max http/https sockets limit

#### RabbitMQ-Specific Relay Variables
- `QUEUE`: Name of the queue for the RabbitMQ producer

### Configuration Files

The library supports configuration through [`.env`](.env.template.nats) files or other configuration file formats. These files can be used to set environment variables and other settings.
Expand Down
Loading
Loading