Class: SenderClient

Inherits:
Object
  • Object
show all
Defined in:
lib/sender_client.rb

Overview

SenderClient parses arguments and runs sender

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ SenderClient

Initialization of sender client, parsing sender client arguments and sender client run

Parameters

args

sender client arguments



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/sender_client.rb', line 30

def initialize(args)
  # Parse arguments
  sender_options_parser = Options::SenderOptionParser.new(args)
  # Create sender handler
  sender_handler = Handlers::SenderHandler.new(
    sender_options_parser.options.broker,
    sender_options_parser.options.log_msgs,
    sender_options_parser.options.msg_content_hashed,
    sender_options_parser.options.count,
    sender_options_parser.options.msg_properties,
    sender_options_parser.options.msg_content,
    sender_options_parser.options.msg_content_type,
    sender_options_parser.options.msg_durable,
    sender_options_parser.options.msg_ttl,
    sender_options_parser.options.msg_correlation_id,
    sender_options_parser.options.msg_reply_to,
    sender_options_parser.options.msg_group_id,
    sender_options_parser.options.msg_to,
    sender_options_parser.options.msg_priority,
    sender_options_parser.options.msg_id,
    sender_options_parser.options.msg_user_id,
    sender_options_parser.options.msg_subject,
    sender_options_parser.options.anonymous,
    sender_options_parser.options.sasl_mechs,
    sender_options_parser.options.idle_timeout,
    sender_options_parser.options.max_frame_size,
    sender_options_parser.options.sasl_enabled,
    sender_options_parser.options.log_lib,
    sender_options_parser.options.auto_settle_off,
    sender_options_parser.options.exit_timer,
    sender_options_parser.options.duration,
    sender_options_parser.options.duration_mode
  )
  # Run sender client
  Qpid::Proton::Container.new(sender_handler).run
end