Class: Torquebox::Messaging::EchoProcessor Private

Inherits:
TorqueBox::Messaging::MessageProcessor show all
Defined in:
lib/torquebox/messaging/echo_processor.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A message processor that echos any messages sent to it back to another queue specified by the response_queue configuration option

Instance Attribute Summary

Attributes inherited from TorqueBox::Messaging::MessageProcessor

#message

Instance Method Summary collapse

Methods inherited from TorqueBox::Messaging::MessageProcessor

#initialize_proxy, list, lookup, #method_missing, #on_error, #process!, #reply

Methods included from TorqueBox::Messaging::ProcessorMiddleware::DefaultMiddleware

default, #middleware

Constructor Details

#initialize(options = {}) ⇒ EchoProcessor

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EchoProcessor.



25
26
27
# File 'lib/torquebox/messaging/echo_processor.rb', line 25

def initialize(options={})
  @response_queue = TorqueBox::Messaging::Queue.new(options['response_queue'])
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TorqueBox::Messaging::MessageProcessor

Instance Method Details

#on_message(body) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/torquebox/messaging/echo_processor.rb', line 29

def on_message(body)
  @response_queue.publish(body)
end