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

Invalid queue_name with dot #111

Closed
Qu4tro opened this Issue Sep 26, 2018 · 0 comments

Comments

2 participants
@Qu4tro

Qu4tro commented Sep 26, 2018

Checklist

  • [✓] Does your title concisely summarize the problem?
  • [✓] Did you include a minimal, reproducible example?
  • What OS are you using?
  • [✓] What version of Dramatiq are you using?
  • [✓] What did you do?
  • [✓] What did you expect would happen?
  • [✓] What happened?

What version of Dramatiq are you using?

1.3.0

What did you do?

Used the queue_name param in actor.

What did you expect would happen?

It would run without exceptions

What happened?

ValueError: Queue names must start with a letter or an underscore followed by any number of letters, digits, dashes or underscores.

Example code

import dramatiq
import requests
import sys


@dramatiq.actor(queue_name='a.fifo')
def count_words(url):
    response = requests.get(url)
    count = len(response.text.split(" "))
    print(f"There are {count} words at {url!r}.")


if __name__ == "__main__":
    count_words.send(sys.argv[1])

I've looked and found the culprit here (A regex expression to check the queue name):
https://github.com/Bogdanp/dramatiq/blob/master/dramatiq/actor.py#L26

Is there a reason on why it doesn't allow dots? Dots are needed when using fifo queues on AWS SQS. This error message appears otherwise:
Your queue name "a" contains invalid characters. A FIFO queue name must end with the .fifo suffix.

Could the solution be just changing the regex or is there a reason why dots are not permitted?

@Bogdanp Bogdanp added the enhancement label Sep 29, 2018

@Bogdanp Bogdanp closed this in fe1e83d Sep 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment