{"action":"created","issue":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/483","repository_url":"https://api.github.com/repos/phstc/shoryuken","labels_url":"https://api.github.com/repos/phstc/shoryuken/issues/483/labels{/name}","comments_url":"https://api.github.com/repos/phstc/shoryuken/issues/483/comments","events_url":"https://api.github.com/repos/phstc/shoryuken/issues/483/events","html_url":"https://github.com/phstc/shoryuken/issues/483","id":305237686,"number":483,"title":"Not respecting active_job queue name prefix in production environments","user":{"login":"paul","id":184,"avatar_url":"https://avatars1.githubusercontent.com/u/184?v=4","gravatar_id":"","url":"https://api.github.com/users/paul","html_url":"https://github.com/paul","followers_url":"https://api.github.com/users/paul/followers","following_url":"https://api.github.com/users/paul/following{/other_user}","gists_url":"https://api.github.com/users/paul/gists{/gist_id}","starred_url":"https://api.github.com/users/paul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paul/subscriptions","organizations_url":"https://api.github.com/users/paul/orgs","repos_url":"https://api.github.com/users/paul/repos","events_url":"https://api.github.com/users/paul/events{/privacy}","received_events_url":"https://api.github.com/users/paul/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-14T16:37:50Z","updated_at":"2018-04-23T21:13:29Z","closed_at":"2018-04-23T21:05:37Z","author_association":"NONE","body":"I seems like something is different in the load order between dev and prod rails environments. In my local dev, shoryuken correctly constructs the prefixed queue name, pulls messages of the correct queue, and sends them to the right Job class. In prod, it does not construct the correct queue name, and tries to pull messages from that non-existent queue. (I create_queue manually because I need to set attributes and subscribe it to an SNS topic). \r\n\r\nLocal dev environment:\r\n\r\n```\r\n$ rails c\r\n[textus|development|main]> MessageIngressJob.queue_name\r\n=> \"paul-messages-ingress\"\r\n[textus|development|main]> TextUs::Application.config.active_job.queue_name_prefix\r\n=> \"paul\"\r\n```\r\n\r\nHeroku production/staging/review app:\r\n\r\n```\r\nirb(main):001:0> MessageIngressJob.queue_name\r\n=> \"messages-ingress\"\r\nirb(main):002:0> TextUs::Application.config.active_job.queue_name_prefix\r\n=> \"textus-staging-pr-551\"\r\n```\r\n\r\nI am expecting the job's queue_name to be `textus-staging-pr-551-messages-ingress`.\r\n\r\n```\r\n$ cat config/initializers/shoryuken.rb \r\n\r\nTextUs::Application.configure do\r\n  config.active_job.queue_name_prefix = ENV.fetch(\"HEROKU_APP_NAME\", `whoami`.chomp)\r\n  config.active_job.queue_name_delimiter = \"-\"\r\nend\r\n\r\nShoryuken.configure_server do |config|\r\n  config.active_job_queue_name_prefixing = true\r\nend\r\n```\r\n\r\n```\r\n$ cat config/shoryuken.yml \r\naws:\r\n  # access_key_id: <%= ENV[\"AWS_ACCESS_KEY_ID\"] %>\r\n  # secret_access_key: <%= ENV[\"AWS_SECRET_ACCESS_KEY\"] %>\r\n  receive_message:\r\n    # only grab 1 message from the queue at a time\r\n    max_number_of_messages: 1\r\n\r\n# Number for worker threads\r\nconcurrency: 5\r\n# If receive_message comes back empty, how long to wait before trying again\r\ndelay: 0\r\n# When shutting down, how long to wait for a busy worker to finish before killing it\r\n# Heroku gives us 10 seconds, so leave time to clean up\r\ntimeout: 8\r\nqueues:\r\n  - [\"messages-ingress\", 1]\r\n```\r\n\r\nIf I use ERB to try and set the prefixed queue_name within the shoryuken.yml from the config, I get an error, even when using -R on the shoruken cli:\r\n\r\n```\r\n$ tail -3 config/shoryuken.yml\r\nqueues:\r\n  - [\"<%= TextUs::Application.config.active_job.queue_name_prefix %>-messages-ingress\", 1]\r\n\r\n$ shoryuken start -v -R -C config/shoryuken.yml\r\n...snip...\r\n(erb):16:in `<main>': uninitialized constant TextUs (NameError)\r\n"},"comment":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/comments/383725149","html_url":"https://github.com/phstc/shoryuken/issues/483#issuecomment-383725149","issue_url":"https://api.github.com/repos/phstc/shoryuken/issues/483","id":383725149,"user":{"login":"paul","id":184,"avatar_url":"https://avatars1.githubusercontent.com/u/184?v=4","gravatar_id":"","url":"https://api.github.com/users/paul","html_url":"https://github.com/paul","followers_url":"https://api.github.com/users/paul/followers","following_url":"https://api.github.com/users/paul/following{/other_user}","gists_url":"https://api.github.com/users/paul/gists{/gist_id}","starred_url":"https://api.github.com/users/paul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paul/subscriptions","organizations_url":"https://api.github.com/users/paul/orgs","repos_url":"https://api.github.com/users/paul/repos","events_url":"https://api.github.com/users/paul/events{/privacy}","received_events_url":"https://api.github.com/users/paul/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T21:13:29Z","updated_at":"2018-04-23T21:13:29Z","author_association":"NONE","body":"@phstc hrm, ok. thanks. weird that it works fine locally then. /shrug"}}
{"actor":{"display_login":"paul"}}