MQConsumer

MQConsumer

class DIRAC.Resources.MessageQueue.MQConsumer.MQConsumer(mqManager, mqURI, consumerId, callback=<function generateDefaultCallback.<locals>.callback>)

Bases: object

__init__(mqManager, mqURI, consumerId, callback=<function generateDefaultCallback.<locals>.callback>)
close()
Function closes the connection for this client.

The producer id is removed from the connection storage. It is not guaranteed that the connection will be removed cause other messengers can be still using it.

Returns

Error appears in case if the connection was already

closed for this consumer.

Return type

S_OK or S_ERROR

get()
Function gets the message

using the default callback machinery. This function can be called only if the the default callback function was used !!!!

Returns

Error in case if there are no messages in the

queue or other error appeared. S_OK with the message content otherwise.

Return type

S_OK or S_ERROR