3.0.1 • Published 9 months ago
sqs-nest v3.0.1
Queue registration
SqsModule.registerAsync({
useFactory: () => {
return {
region: 'ua';,
sandbox: true,
queues: [
'nameQuean1',
'nameQuean2',
],
}
}
}),
Url sandbox: http://localhost:9324
Send message
constructor(
@Inject('SqsServiceInterface')
private readonly sqsService: SqsService,
) {}
await this.sqsService.sendMessage<T>(
{
data: {
test: 'test',
}
},
'nameQuean1',
);
Send message ResponseRequest(Experimental)
constructor(
@Inject('SqsServiceInterface')
private readonly sqsService: SqsService,
) {}
onModuleInit() {
this.sqsService.consume('nameQuean1', (message) => this.test(message));
}
async test(message) {
this.sqsService.sendResponse({
data: {
test: 'test',
},
replyTo: message.id,
});
}
async testQuean() {
const response = await this.sqsService.sendRequestResponse({
data: {
test: "test",
}
}, 'nameQuean1');
console.log(response);
}
Consumer listener
onModuleInit() {
this.sqsService.consume('nameQuean1', (message) => this.handleQuean(message));
}
3.0.1
9 months ago
3.0.0
11 months ago
2.0.4
2 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.3.1
3 years ago
1.3.0
3 years ago
1.2.7
3 years ago
1.2.6
3 years ago
1.2.5
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.2.0
3 years ago
1.1.0
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago