rabbit_force package

Main package of the rabbit_force application

Submodules

rabbit_force.amqp_broker module

rabbit_force.app module

rabbit_force.config module

rabbit_force.exceptions module

Exception types

Exception hierarchy:

RabbitForceError
    InvalidOperation
    SpecificationError
    NetworkError
    ServerError
        SalesforceRestError
            SalesforceMultipleChoicesError
            SalesforceNotModifiedError
            SalesforceBadRequestError
            SalesforceUnauthorizedError
            SalesforceForbiddenError
            SalesforceNotFoundError
            SalesforceMethodNotAllowedError
            SalesforceUnsupportedMediaTypeError
            SalesforceInternalServerError
    MessageSourceError
    InvalidRoutingConditionError
    MessageSinkError
    ConfigurationError
    ReplayStorageError
exception rabbit_force.exceptions.ConfigurationError

Bases: rabbit_force.exceptions.RabbitForceError

Application configuration error

exception rabbit_force.exceptions.InvalidOperation

Bases: rabbit_force.exceptions.RabbitForceError

An invalid operation

exception rabbit_force.exceptions.InvalidRoutingConditionError

Bases: rabbit_force.exceptions.RabbitForceError

Failed to parse routing condition

exception rabbit_force.exceptions.MessageSinkError

Bases: rabbit_force.exceptions.RabbitForceError

Message sink related error

exception rabbit_force.exceptions.MessageSourceError

Bases: rabbit_force.exceptions.RabbitForceError

Message source related error

exception rabbit_force.exceptions.NetworkError

Bases: rabbit_force.exceptions.RabbitForceError

Network related error

exception rabbit_force.exceptions.RabbitForceError

Bases: Exception

Base exception type.

All exceptions of the package inherit from this class.

exception rabbit_force.exceptions.ReplayStorageError

Bases: rabbit_force.exceptions.RabbitForceError

Replay storage error

exception rabbit_force.exceptions.SalesforceBadRequestError

Bases: rabbit_force.exceptions.SalesforceRestError

The request couldn’t be understood

exception rabbit_force.exceptions.SalesforceForbiddenError

Bases: rabbit_force.exceptions.SalesforceRestError

The request has been refused

exception rabbit_force.exceptions.SalesforceInternalServerError

Bases: rabbit_force.exceptions.SalesforceRestError

An error has occurred within Lightning Platform, so the request couldn’t be completed

exception rabbit_force.exceptions.SalesforceMethodNotAllowedError

Bases: rabbit_force.exceptions.SalesforceRestError

The method specified in the Request-Line isn’t allowed for the resource specified in the URI

exception rabbit_force.exceptions.SalesforceMultipleChoicesError

Bases: rabbit_force.exceptions.SalesforceRestError

When an external ID exists in more than one record

exception rabbit_force.exceptions.SalesforceNotFoundError

Bases: rabbit_force.exceptions.SalesforceRestError

The requested resource couldn’t be found

exception rabbit_force.exceptions.SalesforceNotModifiedError

Bases: rabbit_force.exceptions.SalesforceRestError

The request content has not changed since a specified date and time

exception rabbit_force.exceptions.SalesforceRestError

Bases: rabbit_force.exceptions.ServerError

Salesforce REST API error

exception rabbit_force.exceptions.SalesforceUnauthorizedError

Bases: rabbit_force.exceptions.SalesforceRestError

The _session ID or OAuth token used has expired or is invalid

exception rabbit_force.exceptions.SalesforceUnsupportedMediaTypeError

Bases: rabbit_force.exceptions.SalesforceRestError

The entity in the request is in a format that’s not supported by the specified method

exception rabbit_force.exceptions.ServerError

Bases: rabbit_force.exceptions.RabbitForceError

Server side error

exception rabbit_force.exceptions.SpecificationError

Bases: rabbit_force.exceptions.RabbitForceError

Invalid value or type in the config specification

rabbit_force.factories module

rabbit_force.message_sink module

Definition of MessageSink classes and their collaborator classes

class rabbit_force.message_sink.AmqpBrokerMessageSink(broker, json_dumps=<function dumps>)

Bases: rabbit_force.message_sink.MessageSink

Message sink for publishing the consumed messages with AMQP

Parameters
  • broker (AmqpBroker) – An amqp message broker object

  • json_dumps (callable()) – Function for JSON serialization, the default is json.dumps()

Raises

NetworkError – If a network related error occurs

CONTENT_TYPE = 'application/json'
ENCODING = 'utf-8'
close()

Close the message sink

consume_message(message, sink_name, exchange_name, routing_key, properties=None)

Forward the message with the sink specified with sink_name

Parameters
  • message (dict) – An outgoing message

  • sink_name (str) – The name of the sink that should consume the message

  • exchange_name (str) – The name of the exchange which should receive the message

  • routing_key (str) – The message’s routing key parameter

  • properties (dict) – Additional message properties. Every additional property will be forwarded by the sink except for content_type and content_encoding which will be overwritten

class rabbit_force.message_sink.MessageSink

Bases: abc.ABC

Abstract message sink base class

A message sink’s responsibility is to consume outgoing messages

close()

Close the message sink

consume_message(message, sink_name, exchange_name, routing_key, properties=None)

Forward the message with the sink specified with sink_name

Parameters
  • message (dict) – An outgoing message

  • sink_name (str) – The name of the sink that should consume the message

  • exchange_name (str) – The name of the exchange which should receive the message

  • routing_key (str) – The message’s routing key parameter

  • properties (dict) – Additional message properties. Every additional property will be forwarded by the sink except for content_type and content_encoding which will be overwritten

class rabbit_force.message_sink.MultiMessageSink(sinks, loop=None)

Bases: rabbit_force.message_sink.MessageSink

Message sink to route consumed messages between multiple message sinks

Parameters
  • sources (list[MessageSource]) – A list of message sources

  • loop – Event loop used to schedule tasks. If loop is None then asyncio.get_event_loop() is used to get the default event loop.

close()

Close the message sink

consume_message(message, sink_name, exchange_name, routing_key, properties=None)

Forward the message with the sink specified with sink_name

Parameters
  • message (dict) – An outgoing message

  • sink_name (str) – The name of the sink that should consume the message

  • exchange_name (str) – The name of the exchange which should receive the message

  • routing_key (str) – The message’s routing key parameter

  • properties (dict) – Additional message properties. Every additional property will be forwarded by the sink except for content_type and content_encoding which will be overwritten

sinks = None

Message sink list

rabbit_force.message_source module

rabbit_force.routing module