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

SQS polling without an SNS topic #1547

Open
pmioulet opened this issue Dec 6, 2021 · 0 comments
Open

SQS polling without an SNS topic #1547

pmioulet opened this issue Dec 6, 2021 · 0 comments

Comments

@pmioulet
Copy link

pmioulet commented Dec 6, 2021

I have a scenario where I want to subscribe one SQS queues to many topics, hence handling the creation of topics and subscriptions externaly to tomadashi.

The doc seems to imply it it possible to set the topic to None. I tried doing this. However if I set the topic to None, none of the messages get passed to the tomodashi function decorated:

@tomodachi.service
class SqsConsumer(tomodachi.Service):

    # tomodachi process name
    name = "sqs_consumer"

    options = {
        "aws_sns_sqs.region_name": get_from_environment("AWS_REGION"),
        "aws_sns_sqs.aws_access_key_id": get_from_environment("AWS_ACCESS_KEY"),
        "aws_sns_sqs.aws_secret_access_key": get_from_environment("AWS_SECRET_KEY"),
    }
    @aws_sns_sqs(topic=None, queue_name=queue_name, competing=True)
    async def new_message(self, data: Any) -> None:
        self._logger.info("Received a payload from SNS")
        ...

I also tried using regex to match all topics with no luck. It looks like there is some kind of a filter using the topic name in the decorator.

Version used is the latest 0.21.8.

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

No branches or pull requests

1 participant