@iceberg-dev/nest-sqs-consumer
v1.0.9
Published
A utility package
Downloads
5
Readme
nest-sqs-consumer
main.ts
async function bootstrap() {
const { sqs } = config();
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
strategy: new SQSServer({
queueName: sqs.queueName,
sqsClient: new SQSClient(sqs),
}),
},
);
await app.listen();
}
bootstrap();
cfg
Something like:
export const config = (): IConfig => ({
port: parseInt(process.env.PORT, 10) || 8080,
secret: process.env.SECRET_KEY,
sqs: {
queueName: process.env.QUEUE_NAME,
region: process.env.EKS_REGION,
credentials: {
accessKeyId: process.env.SQS_ACCOUNT_ACCESS_KEY_ID,
secretAccessKey: process.env.SQS_ACCOUNT_SECRET_ACCESS_KEY,
},
},
});