我正在尝试设置actionmailer与rabbitmq一起工作。
in development.rb
:
config.action_mailer.queue = Messaging::AmqpClient.instance
和在邮件中:
class OrdersNotifier < ActionMailer::Base
default from: "me <noreply@e.me.com>"
def queue
Messaging::AmqpClient.instance.publish('ddd', 'test_msg')
end
发送我正在使用的邮件:
OrdersNotifier.new_order_email_to_seller(self).deliver
但是我得到:
undefined method `queue=' for ActionMailer::Base:Class
我可能错了,但"queue"是rails 4的唯一功能,现在已经从主分支中删除了。
看到:
http://blog.remarkablelabs.com/2012/12/asynchronous -行动-梅勒- rails - 4倒计时- 2013
The queue feature has been removed from the master branch, which means it will not be making the initial Rails 4.0 release.