Module: EventHub

Defined in:
lib/eventhub/helper.rb,
lib/eventhub/logger.rb,
lib/eventhub/message.rb,
lib/eventhub/sleeper.rb,
lib/eventhub/version.rb,
lib/eventhub/constant.rb,
lib/eventhub/consumer.rb,
lib/eventhub/processor2.rb,
lib/eventhub/configuration.rb,
lib/eventhub/actor_listener.rb,
lib/eventhub/actor_watchdog.rb,
lib/eventhub/base_exception.rb,
lib/eventhub/actor_heartbeat.rb,
lib/eventhub/actor_publisher.rb

Overview

EventHub module

Defined Under Namespace

Modules: Configuration, Helper Classes: ActorHeartbeat, ActorListener, ActorPublisher, ActorWatchdog, BaseException, Consumer, Message, Processor2, Sleeper, Statistics

Constant Summary collapse

VERSION =
"1.20.0".freeze
EH_X_INBOUND =
"event_hub.inbound"
STATUS_INITIAL =

To be set when dispatcher needs to dispatch to first process step.

0
STATUS_SUCCESS =

To be set to indicate successful processed message. Dispatcher will routes message to the next step.

200
STATUS_RETRY =

To be set to trigger retry cycle controlled by the dispatcher

300
STATUS_RETRY_PENDING =

Set and used by the dispatcher only.

301
STATUS_INVALID =

Set before putting the message into a retry queue. Once message has been retried it will sent do the same step with status.code = STATUS_SUCCESS

400
STATUS_DEADLETTER =

Dispatcher will publish message to the invalid queue.

500
STATUS_SCHEDULE =

that message needs to be dead-lettered. Rejected messages could miss the status.code = STATUS_DEADLETTER due to the RabbitMQ deadletter exchange mechanism.

600
STATUS_SCHEDULE_RETRY =

To be set to trigger scheduler based on schedule block, proceses next process step

601
STATUS_SCHEDULE_PENDING =

To be set to trigger scheduler based on schedule block, retry actual process step

602
STATUS_CODE_TRANSLATION =

Set and used by the dispatcher only. Set before putting the scheduled message to the schedule queue.

{
  STATUS_INITIAL => "STATUS_INITIAL",
  STATUS_SUCCESS => "STATUS_SUCCESS",
  STATUS_RETRY => "STATUS_RETRY",
  STATUS_RETRY_PENDING => "STATUS_RETRY_PENDING",
  STATUS_INVALID => "STATUS_INVALID",
  STATUS_DEADLETTER => "STATUS_DEADLETTER",
  STATUS_SCHEDULE => "STATUS_SCHEDULE",
  STATUS_SCHEDULE_RETRY => "STATUS_SCHEDULE_RETRY",
  STATUS_SCHEDULE_PENDING => "STATUS_SCHEDULE_PENDING"
}

Class Method Summary collapse

Class Method Details

.loggerObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/eventhub/logger.rb', line 3

def self.logger
  unless defined?(@logger)
    @logger = ::EventHub::Components::MultiLogger.new
    @logger.add_device(Logger.new($stdout))

    unless Configuration.console_log_only
      @logger.add_device(
        EventHub::Components::Logger.logstash(Configuration.name,
          Configuration.environment)
      )
    end
  end
  @logger
end