Stomppy helper

This class add support for Message module in stomppy default listener. It can be passed directly to Connection.set_listener().

Copyright (C) 2013-2016 CERN

class messaging.stomppy.MessageListener

This class add support for Message module in stomppy default listener. It can be passed directly to Connection.set_listener().

connected(message)

Called by the STOMP connection when a CONNECTED frame is received, that is after a connection has been established or re-established.

Parameters:message – the message received from server
error(message)

Called by the STOMP connection when an ERROR frame is received.

Parameters:message – the message received from server
message(message)

Called by the STOMP connection when a MESSAGE frame is received.

Parameters:message – the message received from server
on_connected(headers, body)

Translate standard call to custom one.

on_connecting(host_and_port)

Called by the STOMP connection once a TCP/IP connection to the STOMP server has been established or re-established. Note that at this point, no connection has been established on the STOMP protocol level. For this, you need to invoke the “connect” method on the connection.

Parameters:host_and_port – a tuple containing the host name and port

number to which the connection has been established

on_disconnected()

Called by the STOMP connection when a TCP/IP connection to the STOMP server has been lost. No messages should be sent via the connection until it has been reestablished.

on_error(headers, body)

Translate standard call to custom one.

on_heartbeat_timeout()

Called by the STOMP connection when a heartbeat message has not been received beyond the specified period.

on_message(headers, body)

Translate standard call to custom one.

on_receipt(headers, body)

Translate standard call to custom one.

on_send(headers, body)

Translate standard call to custom one.

receipt(message)

Called by the STOMP connection when a RECEIPT frame is received, sent by the server if requested by the client using the ‘receipt’ header.

Parameters:message – the message received from server
send(message)

Called by the STOMP connection when it is in the process of sending a message.

Parameters:message – the message being sent to server