event_hub_aws 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d3c7401b3851c2637639028138ddf94cb783c776a5dc4d97039f7000a14cd4e6
4
+ data.tar.gz: 8af5a65ca4bbf444160836aeb23a2d60c41c8c2b05d8bed319fe3f448c6110af
5
+ SHA512:
6
+ metadata.gz: 82fcb23b41a84ba0a3ac54816f32d949338765cb013ca22936f2a90d71caee1fc56c85bb1b4b34724d2bd4727146b938ccca41d84a156543a765a7504a82ebf4
7
+ data.tar.gz: b4d0c28833549ac73ca5698db13f1b474a2f245e229d7967cf4b643fa04ce92c62f3dcd32d2b7176b856817ef2b0804e85170838e0036b9f63138dadd6ef80a9
data/.env.test ADDED
@@ -0,0 +1,6 @@
1
+ QUEUE_URL=https://sqs.us-west-2.amazonaws.com/744522205193/market-data-events.fifo
2
+ QUEUE_ARN=arn:aws:sqs:us-west-2:744522205193:market-data-events.fifo
3
+ EXCHANGE_ARN=arn:aws:sns:us-west-2:744522205193:event-hub.fifo
4
+ ACCOUNT_NUMBER=744522205193
5
+ ACCESS_KEY_ID=123
6
+ SECRET_ACCESS_KEY=321
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,52 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ TargetRubyVersion: 2.6.0
4
+ NewCops: enable
5
+
6
+ require:
7
+ - rubocop-rake
8
+
9
+ Style/Documentation:
10
+ Enabled: false
11
+
12
+ Style/TrailingCommaInHashLiteral:
13
+ Enabled: false
14
+
15
+ Style/SymbolArray:
16
+ Enabled: false
17
+
18
+ Style/NumericLiterals:
19
+ Enabled: false
20
+
21
+ Style/TrailingCommaInArguments:
22
+ Enabled: false
23
+
24
+ Style/FormatStringToken:
25
+ Enabled: false
26
+
27
+ Metrics/MethodLength:
28
+ Max: 35
29
+
30
+ Metrics/AbcSize:
31
+ Max: 40
32
+
33
+ Style/WordArray:
34
+ Enabled: false
35
+
36
+ Metrics/ClassLength:
37
+ Max: 110
38
+
39
+ Metrics/CyclomaticComplexity:
40
+ Max: 10
41
+
42
+ Style/Lambda:
43
+ EnforcedStyle: literal
44
+
45
+ Lint/AmbiguousOperatorPrecedence:
46
+ Enabled: false
47
+
48
+ Bundler/OrderedGems:
49
+ Enabled: false
50
+
51
+ Lint/MissingSuper:
52
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-06-20
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at bogdan@seekingalpha.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in event_hub_aws.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+
10
+ gem 'rspec', '~> 3.0'
11
+
12
+ gem 'rubocop', '~> 1.21'
13
+ gem 'rubocop-rake'
14
+ gem 'rubocop-rspec'
15
+ gem 'dotenv'
16
+
17
+ group :test do
18
+ gem 'simplecov', require: false
19
+ gem 'vcr'
20
+ gem 'webmock'
21
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,113 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ event_hub_aws (1.0.0)
5
+ aws-sdk-sns (~> 1.0)
6
+ aws-sdk-sqs (~> 1.0)
7
+ event_hub (~> 1.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.8.4)
13
+ public_suffix (>= 2.0.2, < 6.0)
14
+ ast (2.4.2)
15
+ aws-eventstream (1.2.0)
16
+ aws-partitions (1.770.0)
17
+ aws-sdk-core (3.173.1)
18
+ aws-eventstream (~> 1, >= 1.0.2)
19
+ aws-partitions (~> 1, >= 1.651.0)
20
+ aws-sigv4 (~> 1.5)
21
+ jmespath (~> 1, >= 1.6.1)
22
+ aws-sdk-sns (1.60.0)
23
+ aws-sdk-core (~> 3, >= 3.165.0)
24
+ aws-sigv4 (~> 1.1)
25
+ aws-sdk-sqs (1.55.0)
26
+ aws-sdk-core (~> 3, >= 3.165.0)
27
+ aws-sigv4 (~> 1.1)
28
+ aws-sigv4 (1.5.2)
29
+ aws-eventstream (~> 1, >= 1.0.2)
30
+ crack (0.4.5)
31
+ rexml
32
+ diff-lcs (1.5.0)
33
+ docile (1.4.0)
34
+ dotenv (2.8.1)
35
+ event_hub (1.0.0)
36
+ hashdiff (1.0.1)
37
+ jmespath (1.6.2)
38
+ json (2.6.3)
39
+ parallel (1.23.0)
40
+ parser (3.2.2.1)
41
+ ast (~> 2.4.1)
42
+ public_suffix (5.0.1)
43
+ rainbow (3.1.1)
44
+ rake (13.0.6)
45
+ regexp_parser (2.8.0)
46
+ rexml (3.2.5)
47
+ rspec (3.12.0)
48
+ rspec-core (~> 3.12.0)
49
+ rspec-expectations (~> 3.12.0)
50
+ rspec-mocks (~> 3.12.0)
51
+ rspec-core (3.12.2)
52
+ rspec-support (~> 3.12.0)
53
+ rspec-expectations (3.12.3)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.12.0)
56
+ rspec-mocks (3.12.5)
57
+ diff-lcs (>= 1.2.0, < 2.0)
58
+ rspec-support (~> 3.12.0)
59
+ rspec-support (3.12.0)
60
+ rubocop (1.51.0)
61
+ json (~> 2.3)
62
+ parallel (~> 1.10)
63
+ parser (>= 3.2.0.0)
64
+ rainbow (>= 2.2.2, < 4.0)
65
+ regexp_parser (>= 1.8, < 3.0)
66
+ rexml (>= 3.2.5, < 4.0)
67
+ rubocop-ast (>= 1.28.0, < 2.0)
68
+ ruby-progressbar (~> 1.7)
69
+ unicode-display_width (>= 2.4.0, < 3.0)
70
+ rubocop-ast (1.28.1)
71
+ parser (>= 3.2.1.0)
72
+ rubocop-capybara (2.18.0)
73
+ rubocop (~> 1.41)
74
+ rubocop-factory_bot (2.23.1)
75
+ rubocop (~> 1.33)
76
+ rubocop-rake (0.6.0)
77
+ rubocop (~> 1.0)
78
+ rubocop-rspec (2.22.0)
79
+ rubocop (~> 1.33)
80
+ rubocop-capybara (~> 2.17)
81
+ rubocop-factory_bot (~> 2.22)
82
+ ruby-progressbar (1.13.0)
83
+ simplecov (0.22.0)
84
+ docile (~> 1.1)
85
+ simplecov-html (~> 0.11)
86
+ simplecov_json_formatter (~> 0.1)
87
+ simplecov-html (0.12.3)
88
+ simplecov_json_formatter (0.1.4)
89
+ unicode-display_width (2.4.2)
90
+ vcr (6.1.0)
91
+ webmock (3.18.1)
92
+ addressable (>= 2.8.0)
93
+ crack (>= 0.3.2)
94
+ hashdiff (>= 0.4.0, < 2.0.0)
95
+
96
+ PLATFORMS
97
+ x86_64-darwin-21
98
+ x86_64-linux
99
+
100
+ DEPENDENCIES
101
+ dotenv
102
+ event_hub_aws!
103
+ rake (~> 13.0)
104
+ rspec (~> 3.0)
105
+ rubocop (~> 1.21)
106
+ rubocop-rake
107
+ rubocop-rspec
108
+ simplecov
109
+ vcr
110
+ webmock
111
+
112
+ BUNDLED WITH
113
+ 2.4.13
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 SeekingAlpha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # EventHubAws
2
+
3
+ AWS adapter for the [event_hub](https://github.com/seekingalpha/event_hub) gem.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add event_hub_aws
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install event_hub_aws
14
+
15
+ ## Usage
16
+
17
+ You can read the the general idea of the `event_hub` gem [here](https://github.com/seekingalpha/event_hub).
18
+ The AWS adapter has its specific config:
19
+
20
+ ```yaml
21
+ # config/event_hub.yml
22
+ development:
23
+ credentials:
24
+ region: us-west-2
25
+ access_key_id: 123
26
+ secret_access_key: 321
27
+ adapter: Aws
28
+ queue_url: https://sqs.us-west-2.amazonaws.com/1234567890/events.fifo
29
+ queue_arn: arn:aws:sqs:us-west-2:1234567890:events.fifo
30
+ exchange_arn: arn:aws:sns:us-west-2:1234567890:event-hub.fifo
31
+ subscribe:
32
+ user_registered:
33
+ handler: Handlers::UserRegistered
34
+ ```
35
+
36
+ ## Development
37
+
38
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
39
+
40
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
41
+
42
+ ## Contributing
43
+
44
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/event_hub_aws. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/event_hub_aws/blob/master/CODE_OF_CONDUCT.md).
45
+
46
+ ## License
47
+
48
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
49
+
50
+ ## Code of Conduct
51
+
52
+ Everyone interacting in the EventHubAws project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/event_hub_aws/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/event_hub_aws/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'event_hub_aws'
7
+ spec.version = EventHubAws::VERSION
8
+ spec.authors = ['Bogdan Guban']
9
+ spec.email = ['bogdan@seekingalpha.com']
10
+
11
+ spec.summary = 'Write a short summary, because RubyGems requires one.'
12
+ spec.description = 'Write a longer description or delete this line.'
13
+ spec.homepage = 'https://github.com/seekingalpha/event_hub_aws'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = '>= 2.6.0'
16
+
17
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
18
+
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = spec.homepage
21
+ spec.metadata['changelog_uri'] = spec.homepage
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
28
+ end
29
+ end
30
+ spec.bindir = 'exe'
31
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ['lib']
33
+
34
+ spec.add_dependency 'aws-sdk-sns', '~> 1.0'
35
+ spec.add_dependency 'aws-sdk-sqs', '~> 1.0'
36
+ spec.add_dependency 'event_hub', '~> 1.0'
37
+
38
+ # For more information and examples about making a new gem, check out our
39
+ # guide at: https://bundler.io/guides/creating_gem.html
40
+ spec.metadata['rubygems_mfa_required'] = 'true'
41
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EventHub
4
+ module Adapters
5
+ class Aws
6
+ class Message < EventHub::Message
7
+ def initialize(adapter, message)
8
+ @adapter = adapter
9
+ @message = message
10
+ end
11
+
12
+ def attributes
13
+ @attributes ||= parsed_body['MessageAttributes'].transform_values { |v| v['Value'] }
14
+ end
15
+
16
+ def body
17
+ parsed_body['Message']
18
+ end
19
+
20
+ def event
21
+ attributes['event']
22
+ end
23
+
24
+ def version
25
+ attributes['version']
26
+ end
27
+
28
+ def ack
29
+ # Delete the message from the queue.
30
+ @adapter.delete_message(@message.receipt_handle)
31
+ end
32
+
33
+ def reject
34
+ if @adapter.config[:dead_queue_url]
35
+ # TODO: publish the message to the dead_queue
36
+ end
37
+ ack
38
+ end
39
+
40
+ private
41
+
42
+ # {
43
+ # "Type" : "Notification",
44
+ # "MessageId" : "025727dd-bb27-5c53-8a79-7b38f0cfe19a",
45
+ # "SequenceNumber" : "10000000000000020000",
46
+ # "TopicArn" : "arn:aws:sns:us-west-2:744522205193:event-hub.fifo",
47
+ # "Subject" : "subject",
48
+ # "Message" : "body",
49
+ # "Timestamp" : "2023-05-22T10:53:28.806Z",
50
+ # "UnsubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-2:744522205193:event-hub.fifo:c8e1a595-4b0d-44b4-8087-094e7b0de09a",
51
+ # "MessageAttributes" : {
52
+ # "str_attr" : {"Type":"String","Value":"string_attr_val"}
53
+ # }
54
+ # }
55
+ def parsed_body
56
+ @parsed_body ||= JSON.parse(@message.body)
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'aws-sdk-sns'
4
+ require 'aws-sdk-sqs'
5
+
6
+ class EventHub
7
+ module Adapters
8
+ class Aws
9
+ attr_reader :config
10
+
11
+ def initialize(config)
12
+ @config = config
13
+ end
14
+
15
+ def subscribe(&block)
16
+ loop do
17
+ receive_message_result = sqs.receive_message(
18
+ queue_url: @config[:queue_url],
19
+ message_attribute_names: ['All'], # Receive all custom attributes.
20
+ max_number_of_messages: 10, # Receive at most one message.
21
+ wait_time_seconds: 15 # Do not wait to check for the message.
22
+ )
23
+
24
+ # Display information about the message.
25
+ # Display the message's body and each custom attribute value.
26
+ receive_message_result.messages.each do |aws_msg|
27
+ message = Message.new(self, aws_msg)
28
+ block.call(message)
29
+ end
30
+ end
31
+ end
32
+
33
+ def publish(event)
34
+ topic.publish({
35
+ message: event.body,
36
+ message_attributes: {
37
+ event: { data_type: 'String', string_value: event.class.event },
38
+ version: { data_type: 'String', string_value: event.class.version },
39
+ },
40
+ message_group_id: 'message_group_id',
41
+ message_deduplication_id: SecureRandom.uuid
42
+ })
43
+ end
44
+
45
+ def setup_bindings
46
+ events = @config[:subscribe].keys
47
+ events = ['__nothing__'] if events.empty? # AWS doesn't allow blank filters
48
+ policy = { event: events }.to_json
49
+ subscription = topic.subscriptions.find { |s| s.attributes['Endpoint'] == @config[:queue_arn] }
50
+ if subscription
51
+ subscription.set_attributes({
52
+ attribute_name: 'FilterPolicy',
53
+ attribute_value: policy
54
+ })
55
+ else
56
+ topic.subscribe({
57
+ protocol: 'sqs',
58
+ attributes: { 'FilterPolicy' => policy },
59
+ endpoint: @config[:queue_arn]
60
+ })
61
+ end
62
+ end
63
+
64
+ def delete_message(receipt_handle)
65
+ sqs.delete_message(
66
+ queue_url: @config[:queue_url],
67
+ receipt_handle: receipt_handle
68
+ )
69
+ end
70
+
71
+ def topic
72
+ @topic ||= sns.topic(@config[:exchange_arn])
73
+ end
74
+
75
+ def sns
76
+ @sns ||= ::Aws::SNS::Resource.new(@config[:credentials] || {})
77
+ end
78
+
79
+ def sqs
80
+ @sqs ||= ::Aws::SQS::Client.new(@config[:credentials] || {})
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EventHubAws
4
+ VERSION = '1.0.0'
5
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'event_hub'
4
+ require_relative 'event_hub_aws/version'
5
+ require_relative 'event_hub_aws/adapters/aws'
6
+ require_relative 'event_hub_aws/adapters/aws/message'
7
+
8
+ module EventHubAws
9
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: event_hub_aws
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Bogdan Guban
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-sns
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk-sqs
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: event_hub
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ description: Write a longer description or delete this line.
56
+ email:
57
+ - bogdan@seekingalpha.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".env.test"
63
+ - ".rspec"
64
+ - ".rubocop.yml"
65
+ - CHANGELOG.md
66
+ - CODE_OF_CONDUCT.md
67
+ - Gemfile
68
+ - Gemfile.lock
69
+ - LICENSE.txt
70
+ - README.md
71
+ - Rakefile
72
+ - event_hub_aws.gemspec
73
+ - lib/event_hub_aws.rb
74
+ - lib/event_hub_aws/adapters/aws.rb
75
+ - lib/event_hub_aws/adapters/aws/message.rb
76
+ - lib/event_hub_aws/version.rb
77
+ homepage: https://github.com/seekingalpha/event_hub_aws
78
+ licenses:
79
+ - MIT
80
+ metadata:
81
+ allowed_push_host: https://rubygems.org/
82
+ homepage_uri: https://github.com/seekingalpha/event_hub_aws
83
+ source_code_uri: https://github.com/seekingalpha/event_hub_aws
84
+ changelog_uri: https://github.com/seekingalpha/event_hub_aws
85
+ rubygems_mfa_required: 'true'
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 2.6.0
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubygems_version: 3.4.6
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: Write a short summary, because RubyGems requires one.
105
+ test_files: []