jondot / sneakers

A fast background processing framework for Ruby and RabbitMQ

Home Page:https://github.com/jondot/sneakers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If there is a `@` in RabbitMQ password, you may have an `Unexpected error bad URI`.

gazeldx opened this issue · comments

Hi lead.

Sneakers.configure(
  amqp: "amqp://#{Settings.rabbitmq.username}:#{Settings.rabbitmq.password}@#{Settings.rabbitmq.host}:5672",
)

If there is a @ in Settings.rabbitmq.password, then you may got an issue:

/Users/lanezhang/.rbenv/versions/3.0.2/bin/sneakers:23:in `<main>'
Unexpected error bad URI(is not URI?): "amqp://my_mq_user:aa10c83b571557349a@19c060153de133@127.0.0.1:5672"
  /Users/lanezhang/.rbenv/versions/3.0.2/lib/ruby/3.0.0/uri/rfc3986_parser.rb:67:in `split'

So finally I changed the RabbitMQ password to contain no @. And it works for me then.

Would you consider this an issue?

its not a bug, if you use the hash options to specify the password it'll work, or if you want to use the URL method, then you have to encode your password

This is a limitation that any URI-based library would run into.