Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add multi instance for consumer #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

draganemilian
Copy link

No description provided.

@udithrooverr
Copy link

merge soon

@throberto
Copy link

eagerly waiting for this...

@ciandt-JEFFERSONSILVERIO

Any news?

@rbonestell
Copy link

Isn't this a non-issue if you simply use different names for the consumers you implement?
Providing the same configuration for N instances of consumers, each with different names, would accomplish the same goal:

SqsModule.registerAsync({
	imports: [ConfigModule],
	useFactory: (configService: ConfigService, logger: Logger) => {
		const region = configService.get('AWS.DEFAULT_REGION');
		const queueUrl = configService.get('AWS.JOBS_QUEUE_URL');
		return {
			consumers: [
				{
					name: 'JobsInbound',
					region,
					queueUrl,
				},
				{
					name: 'JobsInboundAlt',
					region,
					queueUrl,
				},
			],
		};
	},
	inject: [ConfigService],
}),

You can then decorate different classes as consumers for JobsInbound and JobsInboundAlt, and they'll both connect and consume from the same queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants