Commit Graph

110 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron 94640f9707 rabbit_mqtt_process: Close channels after send_will()
This gives a greater chance to the Last Will message to be delivered
because it will implicitely block `rabbit_mqtt_reader` while the
server-side AMQP channel processes the message.

Without this, `rabbit_mqtt_reader` asks the Last Will message to be
sent asynchronously and immediately closes the AMQP connection. The
server-side AMQP channel might thus try to query an already closed
connection.

Fixes #146.
[#150162950]

(cherry picked from commit a2eb8c1be8c52d476ee9ea0ff08ef381a2ca326c)
2017-08-11 14:40:44 +02:00
Daniil Fedotov 8a9190a43f Log MQTT processor log messages with connection sink.
Fixes #142
2017-07-27 14:01:17 +01:00
Michael Klishin fff8f52901 (c) year 2017-04-02 21:48:53 +03:00
Michael Klishin b6c6dc7769 Log in a more human readable format 2016-12-20 00:42:06 +03:00
Michael Klishin 1ab92e897c Wording 2016-12-19 22:51:05 +03:00
Arnaud Cogoluègnes e250fa048f Use coercion module for integer-to-binary coercion
Fixes #111
2016-12-19 17:53:20 +01:00
Arnaud Cogoluègnes 87628f9f51 Use binary for port-to-vhost mapping key
Behaves better as a JSON document key than an integer.

Fixes #111
2016-12-19 17:36:18 +01:00
Arnaud Cogoluègnes b8344cdc27 Map client connection vhost to a port
Fixes #111
2016-12-19 15:00:43 +01:00
Arnaud Cogoluègnes 7e03af30fd Introduce mqtt_default_vhosts global parameter
Fixes #73
2016-12-13 14:46:15 +01:00
Arnaud Cogoluègnes 8f9e8489c2 Optionally map user certificate to virtual host
Use a global runtime parameter to map the DN of the certificate
to a virtual host.

Fixes #73
2016-12-09 16:48:47 +01:00
Arnaud Cogoluègnes 88820d02d9 Don't crash for clients without a last will
References #74
2016-12-07 11:21:47 +01:00
Arnaud Cogoluègnes b1627afe81 Gracefully close connections to non-existent virtual hosts
Return CONNACK 4 code when the virtual host doesn't exist.
The MQTT description for this return code states "The data in
the user name or password is malformed", which not exactly
accurate but better than a pending or abruptly closed connection.
The server logs also a more meaningful message.

Fixes #100
2016-12-06 16:09:50 +01:00
Michael Klishin 97aa1ef4ae Destructure this right in function head 2016-12-05 14:25:15 +03:00
Arnaud Cogoluègnes a7a0174a41 Retain last will message
Fixes #74
2016-12-05 11:05:30 +01:00
Michael Klishin ee213084f8 Wording, naming 2016-09-02 01:33:34 +03:00
Daniil Fedotov 4b688b9e63 Make MQTT authentication correspond with docs. Added tests 2016-09-01 16:54:51 +01:00
Daniil Fedotov 2626696498 Formatting 2016-05-20 14:07:04 +01:00
Daniil Fedotov fcdff84cca Merge pull request #80 from tiagodeoliveira/unnecessary_user_login_check
Removing unnecessary check_user_login on process_login
2016-05-20 14:06:56 +01:00
Daniil Fedotov e72eb1acbf Revert redundant nack 2016-04-22 12:32:01 +01:00
Daniil Fedotov 0cae4fc7fe Set session_present flag 2016-04-22 12:28:08 +01:00
Michael Klishin b12d16ef71 Use 0 for frame_max
Atoms break HTTP API clients in statically typed languages, e.g. Go
and Java
2016-03-04 13:58:59 +03:00
Michael Klishin 30ca7ce8c1 Set product to "MQTT client"
Not much more specific but a bit more suitable.
2016-03-04 13:35:53 +03:00
Michael Klishin 15d23e4474 Cosmetics 2016-03-04 13:34:53 +03:00
Loïc Hoguin 439d8521aa Emit stats for management UI 2016-03-03 14:59:53 +01:00
Loïc Hoguin 738f263798 MQTT connections use exactly one channel 2016-03-03 14:59:53 +01:00
Loïc Hoguin 7b42c20b7e Allow passing the adapter info on processor init 2016-03-03 14:59:53 +01:00
Michael Klishin 7f0f7a7e36 Cosmetics 2016-01-08 02:26:38 +03:00
Loïc Hoguin 1f1cb7ab9b Make send method configurable and export useful functions
Needed for the new Web-MQTT plugin.
2016-01-08 02:26:32 +03:00
Michael Klishin 9ba1da7434 Update (c) info 2016-01-01 12:59:18 +03:00
Michael Klishin 624a7741cf Merge branch 'colons-in-username' of https://github.com/lshift/rabbitmq-mqtt into lshift-colons-in-username 2015-11-28 20:42:22 +03:00
Michael Klishin b84260c721 Fix the build and a bug
Make sure that authentication with username taken from TLS/x509
certificate succeeds; respect rabbitmq_mqtt.ssl_cert_login.

Due to a match clause ordering issue it wasn't the case.
2015-11-28 20:20:32 +03:00
ash 001f4a1a01 add option to ignore colons in usernames 2015-11-19 11:36:24 +00:00
Michael Klishin c15812ac44 merge stable into master 2015-10-21 20:18:33 +03:00
Michael Klishin 0e3efda1ab Merge branch 'stable' 2015-09-30 04:03:26 +08:00
Giuseppe Privitera d26b6e1c91 set auto_delete=false for QoS1 subscriptions 2015-09-29 11:23:34 +01:00
ash-lshift b633549801 revert warning fix 2015-07-14 11:03:31 +01:00
ash-lshift 8fb4904fdc whitespace changes 2015-07-14 10:56:02 +01:00
ash-lshift bafb39f5f0 don't use `apply/2` 2015-07-14 10:47:39 +01:00
ash-lshift 6bc3579023 fix compile warnings 2015-07-14 10:47:01 +01:00
ash-lshift fabf2614ab rename `K` to `Fn` 2015-07-14 10:34:25 +01:00
ash-lshift 868b845101 change resource kind to `topic` 2015-07-14 10:31:42 +01:00
ash-lshift f293972f3c check authorization at mqtt topic level 2015-06-30 09:08:26 +01:00
Michael Klishin 8712428268 Merge branch 'stable' 2015-05-24 04:55:07 +03:00
Michael Klishin 692c6a7060 (c) year 2015-05-24 04:54:58 +03:00
Michael Klishin e8ae92a910 Don't crash if we get a PUBACK for unknown message
E.g. due to bogus clients that interpret QoS downgrade
in curious ways.
2015-04-26 04:51:04 +03:00
Michael Klishin 3c30c87767 Change how retained message delivery QoS is calculated
We now take the lower value of message QoS and
SUBSCRIBE QoS, per community feedback.
2015-04-25 19:35:47 +03:00
Michael Klishin df47dbd77a Refactor 2015-04-22 00:31:23 +03:00
Michael Klishin 2c6c21a4ef Undo this accidental change 2015-04-21 17:39:20 +03:00
Michael Klishin 0b6e7d5714 put/get/delete operations for retained message store
Yet to be done: dump and restore to disk on shutdown
and boot.
2015-04-21 14:26:46 +03:00
Michael Klishin 1c935cfb21 Process bits for retained message stores 2015-04-18 03:55:34 +03:00