Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c3d1162
Bump rack from 2.2.4 to 2.2.6.2
dependabot[bot] Jan 19, 2023
dd39c77
Bump nokogiri from 1.13.9 to 1.14.0
dependabot[bot] Jan 19, 2023
4ede587
feat(workflows): enable ghaction-dependabot-automerge
EtienneM Feb 2, 2023
f0c341b
feat(dependabot): configure for GitHub Actions dependencies
EtienneM Feb 2, 2023
9b6cfd3
Bump rack from 2.2.6.2 to 2.2.6.3
dependabot[bot] Mar 9, 2023
24980a4
Bump rack from 2.2.6.3 to 2.2.6.4
dependabot[bot] Mar 16, 2023
7b591eb
Bump nokogiri from 1.14.0 to 1.14.3
dependabot[bot] Apr 12, 2023
a936c64
deps: upgrade ruby & bundler
May 12, 2023
f9f3f5f
Bump nsq-cluster from 2.1.0 to 2.2.0
dependabot[bot] Dec 1, 2023
78b8da7
fix(NsqdsProducer): implement connected? method
SCKevinO Jan 8, 2024
8dc02dd
Bump nokogiri from 1.14.3 to 1.16.2
dependabot[bot] Feb 6, 2024
608705f
build(dependabot): replace 'Soulou' with 'leo-scalingo'
EtienneM Dec 23, 2024
e0f96e8
build(asgard): update ownership from IST to UFS
EtienneM May 5, 2026
f81824b
build(asgard): this lib is tier 1
EtienneM May 5, 2026
6c62fcc
refactor(workflows): use the new action
EtienneM May 5, 2026
d714aac
docs(Backstage): add a catalog-info.yaml file
okize Mar 11, 2022
8fb1380
docs(Backstage): add a mkdocs.yaml file
okize Mar 11, 2022
d477f29
Update catalog-info.yaml
okize Mar 11, 2022
5934ee8
Update Gemfile + gemspec to get specs runnable on Ruby 2.7-3.2 (#66)
chen-anders Nov 30, 2023
a43f8c2
support an array of nsqds (same as the producer does)
leklund Jun 21, 2019
5041605
Update README.md
chen-anders Nov 30, 2023
8362448
spec_helper: new_producer can use an array of nsqds
chen-anders Nov 30, 2023
17642b9
Fix README.md copy
chen-anders Nov 30, 2023
cf9cbdd
Prep for 2.4.0 Release: Update CHANGELOG.md (#67)
chen-anders Dec 5, 2023
6df812e
2.4.1: Fix NSQ connection version string number (#68)
chen-anders Dec 15, 2023
5731deb
ci(github): Update actions/checkout action to v6 (#73)
wistia-gha-security-bot[bot] May 4, 2026
5616334
chore(GHA): Pin setup-ruby step to ruby/setup-ruby@0cb964fd540e0a24c9…
chen-anders May 5, 2026
c694676
GHA/run-tests: Bump ruby/nsq versions (#75)
chen-anders May 5, 2026
0604cf6
Fix some tests
aurelien-reeves-scalingo Jun 29, 2026
89dc3a6
Reduce downtime duration in sync producer specs
aurelien-reeves-scalingo Jun 29, 2026
c12faf0
Make nsqd_producer tests less flaky
aurelien-reeves-scalingo Jun 29, 2026
72ede13
Merge remote-tracking branch 'origin' into chore/dept/backport-upstre…
aurelien-reeves-scalingo Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run Tests
on: push

jobs:
test:
strategy:
matrix:
ruby_version: ['3.2', '3.3', '3.4', '4.0']
runs-on: ubuntu-24.04
steps:
- name: Install NSQ
shell: bash
run: |
wget https://github.com/nsqio/nsq/releases/download/v1.3.0/nsq-1.3.0.linux-amd64.go1.21.5.tar.gz
tar xvzf nsq-1.3.0.linux-amd64.go1.21.5.tar.gz
mv nsq-1.3.0.linux-amd64.go1.21.5/bin/* /usr/local/bin

- name: Check out Git repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- uses: ruby/setup-ruby@0cb964fd540e0a24c900370abf38a33466142735 # v1.305.0
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Run tests
shell: bash
run: |
echo "path: $PATH"
bundle exec rspec spec
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 2.7.6
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Changelog

## To be Released
## 2.4.1

* Bump nokogiri from 1.11.5 to 1.13.4
* Bump git from 1.3.0 to 1.11.0
* Client version connection string should also read from the VERSION file

## 2.4.0

* Remove jeweler gem in favor of using a dynamic gemspec [#66](https://github.com/wistia/nsq-ruby/pull/66)
* Use `URI.encode_www_form_component` instead of `URI.escape` to ensure compatibility with Ruby 3.0+ and fix deprecation warnings in Ruby 2.7. [#65](https://github.com/wistia/nsq-ruby/pull/65)
* Update version of `nsq-cluster` used for tests [#66](https://github.com/wistia/nsq-ruby/pull/66)
* Update TLS certificates used for tests [#66](https://github.com/wistia/nsq-ruby/pull/66)
* GitHub Actions workflow for testing the gem against a matrix of Ruby versions (2.7, 3.0, 3.1, 3.2) introduced [#66](https://github.com/wistia/nsq-ruby/pull/66)
* Support specifying multiple nsqd's when creating a consumer. [#54](https://github.com/wistia/nsq-ruby/pull/54)

## 2.3.1

Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source 'http://rubygems.org'

gem 'logger', '~> 1.6'

group :development do
gem 'bundler', '~> 1.0'
gem 'jeweler', '~> 2.0'
gem 'nsq-cluster', '~> 2.1'
gem 'rspec', '~> 3.0'
gem 'nsq-cluster', '~> 2.2'
gem 'rspec', '~> 3.10'
end
91 changes: 19 additions & 72 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,87 +1,34 @@
GEM
remote: http://rubygems.org/
specs:
addressable (2.4.0)
builder (3.2.3)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.5.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.16.3)
git (1.11.0)
rchardet (~> 1.8)
github_api (0.16.0)
addressable (~> 2.4.0)
descendants_tracker (~> 0.0.4)
faraday (~> 0.8, < 0.10)
hashie (>= 3.4)
mime-types (>= 1.16, < 3.0)
oauth2 (~> 1.0)
hashie (3.5.7)
highline (1.7.10)
jeweler (2.3.9)
builder
bundler
git (>= 1.2.5)
github_api (~> 0.16.0)
highline (>= 1.6.15)
nokogiri (>= 1.5.10)
psych
rake
rdoc
semver2
jwt (1.5.6)
mime-types (2.99.3)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nokogiri (1.16.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
diff-lcs (1.6.2)
ffi (1.17.4)
logger (1.7.0)
nsq-cluster (2.2.0)
sys-proctable (~> 1.3)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
psych (3.0.2)
racc (1.7.3)
rack (2.2.6.4)
rake (13.0.3)
rchardet (1.8.0)
rdoc (6.3.2)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.0)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
semver2 (3.4.2)
rspec-support (~> 3.13.0)
rspec-support (3.13.7)
sys-proctable (1.3.0)
ffi (~> 1.1)
thread_safe (0.3.6)

PLATFORMS
x86_64-darwin-16
x86_64-darwin-17
x86_64-linux
ruby

DEPENDENCIES
bundler (~> 1.0)
jeweler (~> 2.0)
nsq-cluster (~> 2.1)
rspec (~> 3.0)
logger (~> 1.6)
nsq-cluster (~> 2.2)
rspec (~> 3.10)

BUNDLED WITH
2.4.13
2.6.3
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nsq-ruby is a simple NSQ client library written in Ruby.
```Ruby
require 'nsq'
producer = Nsq::Producer.new(
nsqd: '127.0.0.1:4150',
nsqd: '127.0.0.1:4150', # or ['127.0.0.1:4150']
topic: 'some-topic'
)

Expand Down Expand Up @@ -77,7 +77,7 @@ For example, if you'd like to publish messages to a single nsqd.

```Ruby
producer = Nsq::Producer.new(
nsqd: '6.7.8.9:4150',
nsqd: '6.7.8.9:4150', # or ['6.7.8.9:4150']
topic: 'topic-of-great-esteem'
)
```
Expand Down Expand Up @@ -418,4 +418,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

20 changes: 0 additions & 20 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@ end

require 'rake'

###########
# Jeweler #
###########
require 'jeweler'
require_relative 'lib/version'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
gem.name = "nsq-ruby"
gem.version = Nsq::Version::STRING
gem.homepage = "http://github.com/wistia/nsq-ruby"
gem.license = "MIT"
gem.summary = %Q{Ruby client library for NSQ}
gem.description = %Q{}
gem.email = "dev@wistia.com"
gem.authors = ["Wistia"]
gem.files = Dir.glob('lib/**/*.rb') + ['README.md']
# dependencies defined in Gemfile
end
Jeweler::RubygemsDotOrgTasks.new

#########
# Rspec #
#########
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.0
18 changes: 18 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# this is a catalog entity descriptor file for our Backstage instance (https://backstage.wistia.cloud)

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: nsq-ruby
description: A worker framework for processing messages from an NSQ topic and channel.
annotations:
github.com/project-slug: wistia/nsq-ruby
backstage.io/techdocs-ref: dir:.
tags:
- lang#ruby
- pkg#rubygem
spec:
type: library
owner: infrastructure
lifecycle: production
system: VMA
10 changes: 7 additions & 3 deletions lib/nsq/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ def initialize(opts = {})
topic: @topic,
interval: @discovery_interval
)

elsif opts[:nsqd]
nsqds = [opts[:nsqd]].flatten
max_per_conn = max_in_flight_per_connection(nsqds.size)
nsqds.each{|d| add_connection(d, max_in_flight: max_per_conn)}

else
# normally, we find nsqd instances to connect to via nsqlookupd(s)
# in this case let's connect to an nsqd instance directly
add_connection(opts[:nsqd] || '127.0.0.1:4150', max_in_flight: @max_in_flight)
add_connection('127.0.0.1:4150', max_in_flight: @max_in_flight)
end
end

Expand Down
6 changes: 1 addition & 5 deletions lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
module Nsq
module Version
MAJOR = 2
MINOR = 3
PATCH = 1
BUILD = nil
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
STRING = File.read(File.expand_path('../../VERSION', __FILE__)).strip
end
end
10 changes: 10 additions & 0 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# this file exists to generate techdocs for Backstage (https://backstage.wistia.cloud)

site_name: nsq-ruby
docs_dir: .
plugins:
- techdocs-core
- same-dir
- exclude:
glob:
- node_modules/*
48 changes: 5 additions & 43 deletions nsq-ruby.gemspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: nsq-ruby 2.3.1 ruby lib

Gem::Specification.new do |s|
s.name = "nsq-ruby".freeze
s.version = "2.3.1"
s.version = File.read('VERSION')

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
Expand All @@ -18,46 +12,14 @@ Gem::Specification.new do |s|
"LICENSE.txt",
"README.md"
]
s.files = [
"README.md",
"lib/nsq.rb",
"lib/nsq/client_base.rb",
"lib/nsq/connection.rb",
"lib/nsq/consumer.rb",
"lib/nsq/discovery.rb",
"lib/nsq/exceptions.rb",
"lib/nsq/frames/error.rb",
"lib/nsq/frames/frame.rb",
"lib/nsq/frames/message.rb",
"lib/nsq/frames/response.rb",
"lib/nsq/logger.rb",
"lib/nsq/producer.rb",
"lib/version.rb"
]
s.files = Dir.glob('lib/**/*.rb') + ['README.md', 'VERSION']
s.homepage = "http://github.com/wistia/nsq-ruby".freeze
s.licenses = ["MIT".freeze]
s.rubygems_version = "2.6.8".freeze
s.summary = "Ruby client library for NSQ".freeze

if s.respond_to? :specification_version then
s.specification_version = 4
s.add_dependency(%q<logger>.freeze)

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<bundler>.freeze, ["~> 1.0"])
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.0"])
s.add_development_dependency(%q<nsq-cluster>.freeze, ["~> 2.1"])
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.0"])
else
s.add_dependency(%q<bundler>.freeze, ["~> 1.0"])
s.add_dependency(%q<jeweler>.freeze, ["~> 2.0"])
s.add_dependency(%q<nsq-cluster>.freeze, ["~> 2.1"])
s.add_dependency(%q<rspec>.freeze, ["~> 3.0"])
end
else
s.add_dependency(%q<bundler>.freeze, ["~> 1.0"])
s.add_dependency(%q<jeweler>.freeze, ["~> 2.0"])
s.add_dependency(%q<nsq-cluster>.freeze, ["~> 2.1"])
s.add_dependency(%q<rspec>.freeze, ["~> 3.0"])
end
s.add_development_dependency(%q<nsq-cluster>.freeze, ["~> 2.1"])
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.0"])
end

Loading