-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support AMQP over WebSocket in Erlang client
## What? Implement the AMQP over WebSocket Binding Committee Specification 01 in the AMQP 1.0 Erlang client: https://docs.oasis-open.org/amqp-bindmap/amqp-wsb/v1.0/cs01/amqp-wsb-v1.0-cs01.html ## Why? 1. This allows writing integration tests for the server implementation of AMQP over WebSocket. 2. Erlang and Elixir clients can use AMQP over WebSocket in environments where firewalls prohibit access to the AMQP port. ## How? Use gun as WebSocket client. The new module `amqp10_client_socket` handles socket operations (open, close, send) for: * TCP sockets * SSL sockets * WebSockets Prior to this commit, the amqp10_client_connection process closed only the write end of the socket after it sent the AMQP close performative. This commit removed premature socket closure because: 1. There is no equivalent feature provided in Gun since sending a WebSocket close frame causes Gun to cleanly close the connection for both writing and reading. 2. It's unnecessary and can result in unexpected and confusing behaviour on the server. 3. It's better practive to keep the TCP connection fully open until the AMQP closing handshake completes. 4. When amqp10_client_frame_reader terminates, it will cleanly close the socket for both writing and reading.
- Loading branch information
Showing
5 changed files
with
223 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.