0

我正在尝试设置 actionmailer 以与 rabbitmq 一起使用。

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

尝试投递邮件时。

4

1 回答 1

1

我可能错了,但“队列”是 rails 4 唯一的功能,现在已从 master 分支中删除。

看这里:

http://blog.remarkablelabs.com/2012/12/asynchronous-action-mailer-rails-4-countdown-to-2013

The queue feature has been removed from the master branch, which means it will not be making the initial Rails 4.0 release.
于 2013-06-10T16:00:12.100 回答