Class RMQDomainDataLoaderTask

Inheritance Relationships

Base Type

Derived Type

Class Documentation

stage.RMQDomainDataLoaderTask : public stage.Task
A RMQDomainDataLoaderTask consumes 'AMSMessages' from RabbitMQ bundles the data of
the files into batches and forwards them to the next task waiting on the
output queuee.

Attributes:
    o_queue: The output queue to write the transformed messages
    credentials: A JSON file with the credentials to log on the RabbitMQ server.
    certificates: TLS certificates
    rmq_queue: The RabbitMQ queue to listen to.
    prefetch_count: Number of messages prefected by RMQ (impact performance)

Subclassed by stage.RMQControlMessageTask

Public Functions

__init__(self, o_queue, host, port, vhost, user, password, cert, rmq_queue, policy, prefetch_count=1, signals=[signal.SIGINT, signal.SIGUSR1])
callback_close(self)
Callback that will be called when RabbitMQ will close
the connection (or if a problem happened with the connection).
callback_message(self, ch, basic_deliver, properties, body)
Callback that will be called each time a message will be consummed.
the connection (or if a problem happened with the connection).
signal_wrapper(self, name, pid)
stop(self)
__call__(self)
Busy loop of consuming messages from RMQ queue

Public Members

o_queue = o_queue
cert = cert
rmq_queue = rmq_queue
prefetch_count = prefetch_count
datasize_byte = 0
total_time_ns = 0
signals = signals
orig_sig_handlers = {}
policy = policy
rmq_consumer = AsyncConsumer(host=host,port=port,vhost=vhost,user=user,password=password,cert=self.cert,queue=self.rmq_queue,on_message_cb=self.callback_message,on_close_cb=self.callback_close,prefetch_count=self.prefetch_count,)