Method: Bunny::Channel#topic

Defined in:
lib/bunny/channel.rb

#topic(name, opts = {}) ⇒ Bunny::Exchange

Declares a topic exchange or looks it up in the cache of previously declared exchanges.

Parameters:

  • name (String)

    Exchange name

  • opts (Hash) (defaults to: {})

    Exchange parameters

Options Hash (opts):

  • :durable (Boolean) — default: false

    Should the exchange be durable?

  • :auto_delete (Boolean) — default: false

    Should the exchange be automatically deleted when no longer in use?

  • :arguments (Hash) — default: {}

    Optional exchange arguments (used by RabbitMQ extensions)

Returns:

See Also:



390
391
392
# File 'lib/bunny/channel.rb', line 390

def topic(name, opts = {})
  find_exchange(name) || Exchange.new(self, :topic, name, opts)
end