Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codec c short support edits #775

Closed
wants to merge 112 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
5df39a0
added support for 'U' and 'u' to codec
Apr 23, 2021
afca47a
Drop support for node.js engines below v10
xamgore Apr 3, 2021
50dac25
Remove the upper bound of node engines
xamgore Apr 22, 2021
60aa02d
Alter supported nodejs versions in readme
xamgore May 14, 2021
fd8d115
Fix broken links in readme
jonaskello May 17, 2021
6f99086
set SNI hostname for TLS connections
carlhoerberg Mar 31, 2020
dcce9ef
Drop safe-buffer dependency
kibertoad May 18, 2021
4ab7885
Drop CI for unsupported versions
kibertoad May 18, 2021
f8cfb78
Update package version and changelog for v0.8.0
squaremo May 19, 2021
ce33b1e
Remove old NodeJS versions from CI matrix
squaremo May 19, 2021
5fe1a1b
modernize bitset to use class/const/let
jimmywarting Jun 29, 2021
f2da96c
added jsDoc
jimmywarting Jun 29, 2021
d2e1d4b
auto format
jimmywarting Jun 29, 2021
6311821
destruct
jimmywarting Jun 29, 2021
2b3e669
mv import to top
jimmywarting Jun 29, 2021
edaaa49
GitHub Actions workflow for tests
squaremo Oct 15, 2021
38ba1ce
update url-parse package
giorgioatanasov Oct 15, 2021
f331657
Bring package-lock.json up to date
squaremo Oct 18, 2021
85260e8
auto format code
jimmywarting Jun 29, 2021
df67c97
rm inherit
jimmywarting Jun 29, 2021
66467fe
rm circular ref
jimmywarting Jun 29, 2021
82b722c
destruct imports
jimmywarting Jun 29, 2021
e66acff
sort on node, npm own packages
jimmywarting Jun 29, 2021
71f649b
rm some self variable
jimmywarting Jun 29, 2021
a57a353
rm unnecessary constructor
jimmywarting Jun 29, 2021
2484993
mv exports to bottom
jimmywarting Jun 29, 2021
8e6129e
inspect was undefined and used
jimmywarting Jun 29, 2021
85bb5ad
start using async where it may fit
jimmywarting Jun 29, 2021
0d3ec99
revert some failing test
jimmywarting Jul 6, 2021
99a9058
Close connection to server on connect errors (#647)
luddd3 Dec 28, 2021
11d4706
fix: done called twice on invalid options (#667)
luddd3 Dec 28, 2021
eb93c8a
chore: :lock: amqplib will use the security patched version of urlpar…
suhail-n Mar 20, 2022
e2dc08f
Update README.md
cressie176 May 4, 2022
6f9cd7f
Replace the deprecated istanbul with nyc
cressie176 May 5, 2022
4279549
Update mocha to latest version still compatible with node 10
cressie176 May 5, 2022
c71b89d
Update CHANGELOG
cressie176 May 9, 2022
fb042cf
0.9.0
cressie176 May 9, 2022
c41a09c
Update README references
cressie176 May 15, 2022
ad39bc8
Retire travis as per #684
cressie176 May 15, 2022
644ebd2
Test against recent node versions
cressie176 May 15, 2022
68b1534
Add readme badges
cressie176 May 15, 2022
153a40e
Add troubleshooting link to the readme
cressie176 May 15, 2022
f6bfc55
Update README promise example
renarsvilnis Oct 31, 2018
375560c
Fix readme example unneeded async-await and convert more examples to …
renarsvilnis Feb 28, 2019
8228062
Make README examples more consistent
cressie176 May 15, 2022
21a31ac
Update links in package.json
cressie176 May 15, 2022
8da6d4a
Update README with more recent node version
cressie176 May 15, 2022
f4c3189
use .push.apply instead of concat in Mux _readIncoming
Uzlopak Nov 4, 2021
d5e1a10
fix wrong implementation of push.apply
Uzlopak Nov 4, 2021
b1dec78
Update changelog
cressie176 May 15, 2022
899affe
transform throws string into throw Error
Uzlopak Nov 5, 2021
d99c305
Revert "Merge pull request #661 from Uzlopak/code-smells-throw-errors"
cressie176 May 15, 2022
fd9525a
Use Map instead of Object for BaseChannel.consumers
Uzlopak Nov 4, 2021
cc4add5
update changelog
cressie176 May 15, 2022
8c498e9
call unregisterConsumer in handleCancel
Uzlopak Nov 4, 2021
9eeefff
update changelog
cressie176 May 15, 2022
0924cf0
Add version to changelog
cressie176 May 21, 2022
ef94852
0.9.1
cressie176 May 21, 2022
476cf9d
Use native promises
mohd-akram May 19, 2022
0201e89
Address review comments
mohd-akram May 23, 2022
1230f14
Update CHANGELOG
cressie176 Jun 2, 2022
876ddc8
0.10.0
cressie176 Jun 2, 2022
d02216d
Allow servername to be specified via socket options
cressie176 Jul 26, 2022
54460ea
Fix changelog
cressie176 Jul 26, 2022
ebd125d
0.10.1
cressie176 Jul 26, 2022
a98ad81
Use Buffer.allocUnsafe to reduce allocations
chkimes Jul 13, 2022
2b32550
Update connection.js
chkimes Aug 4, 2022
85e9051
Link to PR from allocUnsafe comment
cressie176 Aug 7, 2022
27b1e8e
Update CHANGELOG
cressie176 Aug 7, 2022
2d324b7
0.10.2
cressie176 Aug 7, 2022
c160cce
Experiment with issue templates
cressie176 Aug 10, 2022
038524b
Update bug_report.md
cressie176 Aug 10, 2022
267fe5a
Update bug_report.md
cressie176 Aug 10, 2022
0f83f30
Use @acuminous/bitsytnax fork
cressie176 Sep 1, 2022
6cb0ea6
Update bitsyntax
cressie176 Sep 1, 2022
996eac6
0.10.3
cressie176 Sep 1, 2022
55851b4
Update bug_report.md
cressie176 Sep 1, 2022
72c1ac7
Update bug_report.md
cressie176 Sep 2, 2022
1599248
Update CHANGELOG.md
cressie176 Sep 3, 2022
a9a41e5
fix(docs): typo
CaioAugustoo Oct 31, 2022
c5699ff
Update examples
cressie176 Dec 9, 2022
dd1c9fb
Update callback examples
cressie176 Dec 10, 2022
3f53f97
Update other examples
cressie176 Dec 10, 2022
8aab456
Update other examples
cressie176 Dec 10, 2022
5ff264a
Add direct reply to example
cressie176 Dec 10, 2022
b9ed9c9
Update bug_report.md
cressie176 Dec 31, 2022
222ee77
Update bug_report.md
cressie176 Dec 31, 2022
c7b6b1d
classify callback model (#691)
jimmywarting Jan 16, 2023
3abcf0d
Add example for RabbitMQ stream queues (#668)
Gsantomaggio Jan 16, 2023
678b9df
Improve stream example
cressie176 Jun 12, 2023
d819bcf
Improve stream example
cressie176 Jun 12, 2023
2288abc
Update README.md
cressie176 Jun 12, 2023
2886ca7
refactor to es-class (#712)
jimmywarting Jun 25, 2023
a87f240
chore: classify mux (#731)
jimmywarting Jun 25, 2023
ad2af44
Make CI more robust
cressie176 Nov 28, 2023
c89c0e3
chore: remove circular ref (#732)
jimmywarting Nov 28, 2023
85be2ec
chore: slice -> subarray (#730)
jimmywarting Nov 28, 2023
312e3f7
Test using Node 20
cressie176 Nov 28, 2023
a5f1f17
Add connection-update-secret
cressie176 Feb 22, 2024
cb8d2db
Automatically remove update-secret-ok event handler
cressie176 Feb 22, 2024
d76a142
Make quotes in updateSecret consistent with other tests
cressie176 Feb 22, 2024
676cb24
Update changelog in preparation for release
cressie176 Apr 11, 2024
48552ed
0.10.4
cressie176 Apr 11, 2024
b2d80ab
Touch readme
cressie176 Apr 11, 2024
38c4d59
Update repo url
cressie176 Apr 11, 2024
03b4240
Add publish workflow
cressie176 Apr 11, 2024
115e52a
Commit defs
cressie176 Apr 11, 2024
89abcb8
Nolonger need prepare
cressie176 Apr 11, 2024
22e948a
Add encode and decode support for unsigned short
Jul 8, 2024
0b43ba9
Add support for 'B" as unsigned byte and 'i' as unsigned int
Jul 8, 2024
16a7d33
Complete support for unsigned integers
cressie176 Nov 18, 2024
89fdcd0
Remove duplicate type tag
cressie176 Nov 24, 2024
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
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report / Support request
about: Report a bug or ask for help
title: ''
labels: ''
assignees: ''

---

Before reporting a bug or requesting support please...

1. Read the troubleshooting guide

- https://amqp-node.github.io/amqplib/#troubleshooting

2. Search for existing open and closed issues

- https://github.com/amqp-node/amqplib/issues?q=is%3Aissue+TYPE+YOUR+KEYWORDS+HERE

3. Ensure you are familiar with the amqplib Channel API and RabbitMQ basics

- https://amqp-node.github.io/amqplib/channel_api.html
- https://www.cloudamqp.com/blog/part1-rabbitmq-for-beginners-what-is-rabbitmq.html
- https://www.rabbitmq.com/tutorials/amqp-concepts.html

If the above does not help, please provide as much of the following information as is relevant...

- A clear and concise description of the problem
- RabbitMQ version
- amqplib version
- Node.js version
- The simplest possible code snippet that demonstrates the problem
- A stack trace

Please format code snippets and/or stack traces using GitHub Markdown

- https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks).

Thank you


59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-alpine
ports:
- 5672:5672

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- run: npm ci

- run: |
n=0
while :
do
sleep 5
echo 'HELO\n\n\n\n' | nc localhost 5672 | grep AMQP
[[ $? = 0 ]] && break || ((n++))
(( n >= 5 )) && break
done

- run: echo 'HELO\n\n\n\n' | nc localhost 5672 | grep AMQP

- run: make test

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: "npm"
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3.12-alpine
ports:
- 5672:5672

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

# Install all prerequisites
- run: npm ci

# Ensure RabbitMQ is available before continuing
- run: |
n=0
while :
do
sleep 5
echo 'HELO\n\n\n\n' | nc localhost 5672 | grep AMQP
[[ $? = 0 ]] && break || ((n++))
(( n >= 5 )) && break
done

- run: echo 'HELO\n\n\n\n' | nc localhost 5672 | grep AMQP

# Run the tests
- run: make test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*~
lib/defs.js
scratch
node_modules/
bin/amqp-rabbitmq-0.9.1.json
etc/
coverage/
/.idea/
.nyc_output/
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ scratch
# do not ignore lib/defs.js, we need that
# node_modules is ignored anyway
.travis.yml
bin/amqp-rabbitmq-0.9.1.json
etc/
coverage/
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

98 changes: 98 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,103 @@
# Change log for amqplib

## Changes in v0.10.4

- Improve stream example as per https://github.com/amqp-node/amqplib/issues/722
- Added support for RabbitMQ's connection update-secret operation. See https://github.com/amqp-node/amqplib/issues/755

## Changes in v0.10.3

git log v0.10.2..v0.10.3

- Use @acuminous/bitsyntax fork. See https://github.com/amqp-node/amqplib/issues/453

## Changes in v0.10.2

git log v0.10.1..v0.10.2

- Use Buffer.allocUnsafe when sending messages to improve performance ([PR
695](https://github.com/amqp-node/amqplib/pull/695), thank you
@chkimes and @Uzlopak)

## Changes in v0.10.1

git log v0.10.0..v0.10.1

* Allow servername to be specified via socket options as discussed in
[issue 697](https://github.com/squaremo/amqp.node/issues/697)

## Changes in v0.10.0

git log v0.9.1..v0.10.0

* Use Native promises ([PR
689](https://github.com/amqp-node/amqplib/pull/689), thank you
@mohd-akram and @kibertoad)

## Changes in v0.9.1

git log v0.9.0..v0.9.1

* Assorted readme changes
* Use Array.prototype.push.apply instead of concat in Mux ([PR
658](https://github.com/squaremo/amqp.node/pull/658), thank you
@Uzlopak and @kibertoad)
* Use Map instead of Object for BaseChannel.consumers ([PR
660](https://github.com/squaremo/amqp.node/pull/660), thank you
@Uzlopak)
* Delete consumer callback after cancellation to free memory ([PR
659](https://github.com/squaremo/amqp.node/pull/659), thank you
@Uzlopak and @kibertoad)


## Changes in v0.9.0

git log v0.8.0..v0.9.0

* Update mocha and replace the deprecated istanbul with nyc ([PR
681](https://github.com/squaremo/amqp.node/pull/681)
* Update url-parse ([PR
675](https://github.com/squaremo/amqp.node/pull/675), thank you
@suhail-n and @kibertoad)
* fix: done called twice on invalid options ([PR
667](https://github.com/squaremo/amqp.node/pull/667), thank you
@luddd3 and @kibertoad)
* Close connection to server on connect errors ([PR
647](https://github.com/squaremo/amqp.node/pull/647), thank you
@luddd3 and @kibertoad)
* Modernise channel_model.js ([PR
635](https://github.com/squaremo/amqp.node/pull/635), thank you
@kibertoad and @jimmywarting)
* Bring package-lock.json up to date ([PR
653](https://github.com/squaremo/amqp.node/pull/653)
* Update url-parse ([PR
652](https://github.com/squaremo/amqp.node/pull/652), thank you
@giorgioatanasov and @buffolander)
* Modernise channel_model.js ([PR
651](https://github.com/squaremo/amqp.node/pull/651), thank you
for the review @kibertoad)
* Modernise bitset.js ([PR
634](https://github.com/squaremo/amqp.node/pull/634), thank you
@kibertoad and @jimmywarting)
* :warning: Drop CI for node versions below 10 ([PR
631](https://github.com/squaremo/amqp.node/pull/631), thank you
for the review @kibertoad)
* Replace safe-buffer dependency with native buffers ([PR
628](https://github.com/squaremo/amqp.node/pull/628), thank you
@kibertoad and @jimmywarting)

## Changes in v0.8.0

git log v0.7.1..v0.8.0

* :warning: Support for NodeJS prior to v10 is dropped :warning: ([PR
615](https://github.com/squaremo/amqp.node/pull/615), thank you
@xamgore and everyone who helped there)
* Use hostname as TLS servername, to help with using servers behind
load balancers ([PR
567](https://github.com/squaremo/amqp.node/pull/567), thanks to
@carlhoerberg and commenters)

## Changes in v0.7.1

git log v0.7.0..v0.7.1
Expand Down
49 changes: 25 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
RABBITMQ_SRC_VERSION=rabbitmq_v3_2_1
RABBITMQ_SRC_VERSION=v3.12.13
JSON=amqp-rabbitmq-0.9.1.json
RABBITMQ_CODEGEN=https://raw.githubusercontent.com/rabbitmq/rabbitmq-codegen
AMQP_JSON=$(RABBITMQ_CODEGEN)/$(RABBITMQ_SRC_VERSION)/$(JSON)
AMQP_JSON=https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/$(RABBITMQ_SRC_VERSION)/deps/rabbitmq_codegen/$(JSON)

NODEJS_VERSIONS='0.8' '0.9' '0.10' '0.11' '0.12' '1.8.4' '2.5' '3.3' '4.9' '5.12' '6.17' '8.17' '9.11' '10.21' '11.15' '12.18' '13.14' '14.5' '15.8'
NODEJS_VERSIONS='10.21' '11.15' '12.18' '13.14' '14.5' '15.8' '16.3.0' '18.1.0' '20.10.0'

MOCHA=./node_modules/.bin/mocha
_MOCHA=./node_modules/.bin/_mocha
UGLIFY=./node_modules/.bin/uglifyjs
ISTANBUL=./node_modules/.bin/istanbul
NYC=./node_modules/.bin/nyc

.PHONY: test test-all-nodejs all clean coverage
.PHONY: test test-all-nodejs coverage lib/defs.js

all: lib/defs.js
error:
@echo "Please choose one of the following targets: test, test-all-nodejs, coverage, lib/defs.js"
@exit 1

clean:
rm lib/defs.js bin/amqp-rabbitmq-0.9.1.json
rm -rf ./coverage

lib/defs.js: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json
(cd bin; node ./generate-defs.js > ../lib/defs.js)
$(UGLIFY) ./lib/defs.js -o ./lib/defs.js \
-c 'sequences=false' --comments \
-b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true)
test:
$(MOCHA) --check-leaks -u tdd --exit test/

test: lib/defs.js
$(MOCHA) --check-leaks -u tdd test/

test-all-nodejs: lib/defs.js
test-all-nodejs:
for v in $(NODEJS_VERSIONS); \
do echo "-- Node version $$v --"; \
nave use $$v $(MOCHA) -u tdd -R progress test; \
nave use $$v $(MOCHA) -u tdd --exit -R progress test; \
done

coverage: $(ISTANBUL) lib/defs.js
$(ISTANBUL) cover $(_MOCHA) -- -u tdd -R progress test/
$(ISTANBUL) report
coverage: $(NYC)
$(NYC) --clean --reporter=lcov --reporter=text $(_MOCHA) -u tdd --exit -R progress test/
@echo "HTML report at file://$$(pwd)/coverage/lcov-report/index.html"

lib/defs.js: clean bin/generate-defs test

clean:
rm -f lib/defs.js bin/amqp-rabbitmq-0.9.1.json

bin/generate-defs: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json
(cd bin; node ./generate-defs.js > ../lib/defs.js)
$(UGLIFY) ./lib/defs.js -o ./lib/defs.js \
-c 'sequences=false' --comments \
-b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true)

bin/amqp-rabbitmq-0.9.1.json:
curl -L $(AMQP_JSON) > $@

Expand Down
Loading
Loading