Class: Qpid::Proton::MessagingHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/core/messaging_handler.rb

Overview

A handler for AMQP messaging events.

Subclass the handler and provide the #on_xxx methods with your event-handling code.

An AMQP endpoint (connection, session or link) must be opened and closed at each end. Normally proton responds automatically to an incoming open/close. You can prevent the automatic response by raising StopAutoResponse from #on_xxx_open or #on_xxx_close. The application becomes responsible for calling #open/#close at a later point.

Note: If a MessagingHandler method raises an exception, it will stop the Container that the handler is running in. See Container#run

Instance Attribute Summary collapse

Most common events collapse

Endpoint lifecycle events collapse

Delivery events collapse

Flow control events collapse

Transport events collapse

Unhandled events collapse

Instance Attribute Details

#optionsHash (readonly)

Returns handler options, see #initialize.

Returns:

  • (Hash)

    handler options, see #initialize



37
38
39
# File 'lib/core/messaging_handler.rb', line 37

def options
  @options
end

Instance Method Details

#on_connection_close(connection) ⇒ Object

The remote peer closed the connection

Parameters:

  • connection


# File 'lib/core/messaging_handler.rb', line 66

#on_connection_error(connection) ⇒ Object

The remote peer closed the connection with an error condition

Parameters:

  • connection


# File 'lib/core/messaging_handler.rb', line 70

#on_connection_open(connection) ⇒ Object

The remote peer opened the connection

Parameters:

  • connection


# File 'lib/core/messaging_handler.rb', line 62

#on_container_start(container) ⇒ Object

The container event loop is started

Parameters:



# File 'lib/core/messaging_handler.rb', line 41

#on_container_stop(container) ⇒ Object

The container event loop is stopped

Parameters:



# File 'lib/core/messaging_handler.rb', line 45

#on_delivery_abort(delivery) ⇒ Object

A message was begun but aborted by the sender, so was not received.

Parameters:



# File 'lib/core/messaging_handler.rb', line 146

#on_delivery_settle(delivery) ⇒ Object

The sending end settled a delivery

Parameters:



# File 'lib/core/messaging_handler.rb', line 142

#on_error(error_condition) ⇒ Object

Called on an error if no more specific on_xxx_error method is provided. If on_error() is also not defined, the connection is closed with error_condition

Parameters:

  • error_condition (Condition)

    Provides information about the error.



# File 'lib/core/messaging_handler.rb', line 182

#on_message(delivery, message) ⇒ Object

A message is received.

Parameters:



# File 'lib/core/messaging_handler.rb', line 49

#on_receiver_close(receiver) ⇒ Object

The remote peer closed the receiver

Parameters:

  • receiver


# File 'lib/core/messaging_handler.rb', line 110

#on_receiver_detach(receiver) ⇒ Object

The remote peer detached the receiver

Parameters:

  • receiver


# File 'lib/core/messaging_handler.rb', line 106

#on_receiver_drain_finish(receiver) ⇒ Object

The remote end of the receiver completed draining

Parameters:



# File 'lib/core/messaging_handler.rb', line 158

#on_receiver_error(receiver) ⇒ Object

The remote peer closed the receiver with an error condition

Parameters:

  • receiver


# File 'lib/core/messaging_handler.rb', line 114

#on_receiver_open(receiver) ⇒ Object

The remote peer opened the receiver

Parameters:

  • receiver


# File 'lib/core/messaging_handler.rb', line 102

#on_sendable(sender) ⇒ Object

A message can be sent

Parameters:

  • sender (Sender)

    The sender.



# File 'lib/core/messaging_handler.rb', line 54

#on_sender_close(sender) ⇒ Object

The remote peer closed the sender

Parameters:

  • sender


# File 'lib/core/messaging_handler.rb', line 94

#on_sender_detach(sender) ⇒ Object

The remote peer detached the sender

Parameters:

  • sender


# File 'lib/core/messaging_handler.rb', line 90

#on_sender_drain_start(sender) ⇒ Object

The remote end of the sender requested draining

Parameters:

  • sender (Sender)

    The sender.



# File 'lib/core/messaging_handler.rb', line 154

#on_sender_error(sender) ⇒ Object

The remote peer closed the sender with an error condition

Parameters:

  • sender


# File 'lib/core/messaging_handler.rb', line 98

#on_sender_open(sender) ⇒ Object

The remote peer opened the sender

Parameters:

  • sender


# File 'lib/core/messaging_handler.rb', line 86

#on_session_close(session) ⇒ Object

The remote peer closed the session

Parameters:

  • session


# File 'lib/core/messaging_handler.rb', line 78

#on_session_error(session) ⇒ Object

The remote peer closed the session with an error condition

Parameters:

  • session


# File 'lib/core/messaging_handler.rb', line 82

#on_session_open(session) ⇒ Object

The remote peer opened the session

Parameters:

  • session


# File 'lib/core/messaging_handler.rb', line 74

#on_tracker_accept(tracker) ⇒ Object

The receiving end accepted a delivery

Parameters:

  • tracker (Tracker)

    The tracker.



# File 'lib/core/messaging_handler.rb', line 122

#on_tracker_modify(tracker) ⇒ Object

The receiving end modified a delivery

Parameters:

  • tracker (Tracker)

    The tracker.



# File 'lib/core/messaging_handler.rb', line 134

#on_tracker_reject(tracker) ⇒ Object

The receiving end rejected a delivery

Parameters:

  • tracker (Tracker)

    The tracker.



# File 'lib/core/messaging_handler.rb', line 126

#on_tracker_release(tracker) ⇒ Object

The receiving end released a delivery

Parameters:

  • tracker (Tracker)

    The tracker.



# File 'lib/core/messaging_handler.rb', line 130

#on_tracker_settle(tracker) ⇒ Object

The receiving end settled a delivery

Parameters:

  • tracker (Tracker)

    The tracker.



# File 'lib/core/messaging_handler.rb', line 138

#on_transport_close(transport) ⇒ Object

The underlying network channel closed

Parameters:



# File 'lib/core/messaging_handler.rb', line 170

#on_transport_error(transport) ⇒ Object

The underlying network channel is closing due to an error.

Parameters:



# File 'lib/core/messaging_handler.rb', line 174

#on_transport_open(transport) ⇒ Object

The underlying network channel opened

Parameters:



# File 'lib/core/messaging_handler.rb', line 166

#on_unhandled(method_name, *args) ⇒ Object

Called for events with no handler. Similar to ruby’s standard #method_

Parameters:

  • method_name (Symbol)

    Name of the event method that would have been called.

  • args (Array)

    Arguments that would have been passed



# File 'lib/core/messaging_handler.rb', line 187