Skip to content

Commit 5a69f30

Browse files
feat: improve distributed message bus + fix readme
1 parent 4988097 commit 5a69f30

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class AppController {
159159
- This implementation illustrates an entry point triggered via an HTTP request, showcasing how simple it is to connect the messaging system to a web interface.
160160

161161
### ⚠️ Warning!
162-
🚨 Important Notice: You can return responses from handlers, but currently, it only works with the `InMemoryChannel`. This behavior may not function as expected if multiple handlers are processing a single message.
162+
🚨 Important Notice: You can **return responses from handlers**, but currently, it only works with the `InMemoryChannel`. This behavior may not function as expected if multiple handlers are processing a single message.
163163

164164
🛠️ Please ensure you're using a compatible setup when working with multiple handlers, as this could result in unexpected behavior.
165165

@@ -453,6 +453,3 @@ export class YourMessageOptions implements MessageOptions {
453453
Classes with `Injectable()` decorator must be defined as providers in somewhere in application.
454454

455455
---
456-
457-
### Future features
458-
* INBOX & OUTBOX Pattern

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestjstools/messaging",
3-
"version": "2.17.1",
3+
"version": "2.18.0",
44
"description": "Simplifies asynchronous and synchronous message handling with support for buses, handlers, channels, and consumers. Build scalable, decoupled applications with ease and reliability.",
55
"author": "Sebastian Iwanczyszyn",
66
"license": "MIT",
@@ -21,13 +21,15 @@
2121
"package.json"
2222
],
2323
"keywords": [
24-
"nestjs-tools",
24+
"nestjstools",
2525
"nestjs",
2626
"distributed",
2727
"messaging",
2828
"nestjs-messaging",
2929
"message-bus",
3030
"service-bus",
31+
"nestjs-service-bus",
32+
"nestjs-message-bus",
3133
"microservices"
3234
],
3335
"scripts": {
@@ -52,7 +54,7 @@
5254
"peerDependencies": {
5355
"@nestjs/common": "^10.x||^11.x",
5456
"@nestjs/core": "^10.x||^11.x",
55-
"reflect-metadata": "^0.2.0",
57+
"reflect-metadata": "^0.2.x",
5658
"rxjs": "^7.x"
5759
},
5860
"devDependencies": {

src/bus/distributed-message.bus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { NormalizerRegistry } from '../normalizer/normalizer.registry';
1010
export class DistributedMessageBus implements IMessageBus {
1111
constructor(private messageBusCollection: MessageBusCollection, private normalizerRegistry: NormalizerRegistry) {}
1212

13-
async dispatch(message: RoutingMessage): Promise<MessageResponse | void> {
13+
async dispatch(message: RoutingMessage): Promise<MessageResponse> {
1414
if (!(message instanceof RoutingMessage)) {
1515
throw new Error(`Message must be instance of ${RoutingMessage.name}`);
1616
}

src/message/message-response.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export class MessageResponse {
99
return this.responses[0];
1010
}
1111

12+
isEmpty(): boolean {
13+
return 0 === this.responses.length;
14+
}
15+
1216
getAll(): object[] {
1317
return this.responses;
1418
}

0 commit comments

Comments
 (0)