https://github.com/hyper63/hyper-adapter-bullmq
BullMQ Queue Adapter for the Hyper Queue Port
https://github.com/hyper63/hyper-adapter-bullmq
bullmq clean-architecture deno hyper ports-and-adapters queue redis service-framework
Last synced: about 2 months ago
JSON representation
BullMQ Queue Adapter for the Hyper Queue Port
- Host: GitHub
- URL: https://github.com/hyper63/hyper-adapter-bullmq
- Owner: hyper63
- License: apache-2.0
- Created: 2023-11-01T14:16:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-25T19:55:11.000Z (over 1 year ago)
- Last Synced: 2025-01-13T05:41:40.489Z (3 months ago)
- Topics: bullmq, clean-architecture, deno, hyper, ports-and-adapters, queue, redis, service-framework
- Language: TypeScript
- Homepage:
- Size: 195 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
hyper-adapter-bullmq
A Queue port adapter for BullMQ in the hyper service framework
---
- [Getting Started](#getting-started)
- [Methods](#methods)
- [Testing](#testing)
- [License](#license)## Getting Started
```ts
import { default as bullmq } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-bullmq/v1.0.1/mod.ts'export default {
app,
adapter: [
{
port: 'queue',
plugins: [
bullmq({
url: 'http://user@[email protected]:6379',
}),
],
},
],
}
```You can pass the following configuration to the adapter:
```ts
export type AdapterConfig = {
/**
* The redis server connection string
*/
url: string
options?: {
/**
* How many Workers to spawn in order to process jobs.
*
* Defaults to 10
*/
concurrency?: number
/**
* The Time-To-Live for jobs whose processing fails. The job payload,
* along with the error is stored in redis.
*
* Defaults to 7 days.
*/
failedTtl?: number
/**
* A prefix you'd like all keys created by the adapter to use.
*
* Defaults to no prefix ie. ''
*/
keyPrefix?: string
/**
* Whether the Redis Server being used is clustered.
*
* Defaults to false
*/
cluster?: boolean
}
}
```## Methods
This adapter fully implements the Queue port and can be used as the
[hyper Queue service](https://hyper63.github.io/docs/docs/api-reference/rest/queue.html) adapterSee the full port [here](https://github.com/hyper63/hyper/tree/main/packages/port-queue)
## Testing
Run Tests
```sh
deno task test
```To lint, check formatting, and run unit tests
Run Integration Tests
> You will need a Redis Server running and `REDIS_URL` set to your Redis server connection string
```sh
deno task test:integration
```Run Test Harness
```sh
deno task test:harness
```## License
Apache-2.0