Skip to content
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
7 changes: 6 additions & 1 deletion email_service/src/email/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ export class EmailService implements OnModuleInit, OnModuleDestroy {
'x-message-ttl': 86400000, // 24 hours
},
});
await channel.assertQueue('failed.queue', { durable: true });
await channel.assertQueue('failed.queue', {
durable: true,
arguments: {
'x-message-ttl': 86400000, // 24 hours
},
});

console.log('📬 Queues asserted');
const queueInfo = await channel.checkQueue('email.queue');
Expand Down
10 changes: 6 additions & 4 deletions push-service/src/push/push.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ export class PushService implements OnModuleInit, OnModuleDestroy {
'x-message-ttl': 86400000,
},
});
await channel.assertQueue('failed.queue', { durable: true });
await channel.assertQueue('failed.queue', {
durable: true,
arguments: {
'x-message-ttl': 86400000, // 24 hours
},
});

const queueInfo = await channel.checkQueue('push.queue');
console.log('📊 Queue Status BEFORE consuming:');
Expand Down Expand Up @@ -196,7 +201,6 @@ export class PushService implements OnModuleInit, OnModuleDestroy {
data: message.metadata,
});


await this.updateStatus(
correlationId,
NotificationStatus.DELIVERED,
Expand All @@ -211,7 +215,6 @@ export class PushService implements OnModuleInit, OnModuleDestroy {

channel.ack(msg);
this.retryAttempts.delete(correlationId);

} catch (error: any) {
const attempts = this.retryAttempts.get(correlationId) || 0;

Expand Down Expand Up @@ -331,7 +334,6 @@ export class PushService implements OnModuleInit, OnModuleDestroy {
JSON.stringify(updatedStatus),
);


const apiGatewayUrl =
process.env.API_GATEWAY_URL || 'http://localhost:3000';

Expand Down