Commit Graph

50 Commits

Author SHA1 Message Date
Zaiming (Stone) Shi 14ba75502f chore: update copyright year 2023-01-02 14:54:38 +01:00
JimMoen fe0f2bc4e7
test(session): ensure 'message.dropped' hook ran with named reason 2022-12-07 16:01:33 +08:00
JianBo He 89c65b6535 Merge tag 'v4.3.14-rc.4' into merge-main-v4.3-into-v4.4 2022-04-16 11:28:07 +08:00
JimMoen 6168745f90 chore: update copyright 2022-04-14 11:23:25 +08:00
lafirest 44fe882f14 refactor(emqx_slow_subs): refactor slow subs 2022-01-19 09:50:31 +08:00
Shawn 2da30465de fix(merge): solve conflicts when merge 4.4 to 4.3 2022-01-14 15:45:33 +08:00
Shawn a6408cee4f fix(session): update testcases for emqx_session 2022-01-13 15:28:18 +08:00
lafirest fef3fc27cb
refactor(emqx_slow_subs): refactor use moving average (#6287)
* refactor(emqx_slow_subs): refactor use moving average

* fix(emqx_slow_subs): change elapsed to latency, and fix some error

* fix(emqx_slow_subs): fix emqx_mgmt_api.erl indent

* fix(emqx_slow_subs): change api name

* fix(emqx_slow_subs): fix and improve some code

* fix(emqx_slow_subs): move clienid filed from latency_stats to session
2021-11-26 10:42:15 +08:00
Zaiming Shi 6354e75626 chore: update copyrights 2021-04-23 20:43:00 +02:00
Zaiming Shi d67212e7fa chore(test): Make test profile build 2020-12-11 08:19:26 +01:00
JianBo He 1700a7a98a refactor(test): put all property cases to test/props directory 2020-06-18 17:38:34 +08:00
terry-xiaoyu 6ad65d587e feature(properties): add properties in message header
1. Add MQTT5.0 properties when invoking the hooks.

- Add a new key `properties` into the message header:

  We used to put all of the properties into the `#message.headers`:

  ```erlang
  #message{headers = #{'User-Property' => {<<"reason">>,<<"normal">>},
                       'Message-Expiry-Interval' => 60,
                       allow_publish => true}
  ```

  I put them instead under a single key:

  ```erlang
  #message{headers = #{properties =>
                        #{'User-Property' => {<<"reason">>,<<"normal">>},
                          'Message-Expiry-Interval' => 60},
                       allow_publish => true}
  ```

  Note that the column `properties` may contain all the properties for
  Publish and Will messages.

- Add `disconn_props` into the `Channel.conninfo`

- Add `puback_props` also into the message header:

  ```erlang
  #message{headers = #{puback_props =>
                        #{'User-Property' => {<<"reason">>,<<"normal">>}},
                       allow_publish => true}
  ```

2. Change the data type of `#message.headers` and `#message.flags` to map.

   It used to support `undefined`.
2020-06-17 18:46:26 +08:00
zhouzb 7ea75f4289 Update copyright 2020-01-03 18:31:08 +08:00
Feng Lee b7ca3905a6 Breaking Change: Add new hooks for client and session lifecircle (#3138) 2019-12-27 16:31:06 +08:00
Feng Lee 578355442b Add more metrics and improve the 'channel', 'session' modules (#3128) 2019-12-20 21:47:32 +08:00
Feng Lee c5c99b7c4e Improve 'emqx_ws_connection' module and add more test cases 2019-12-13 18:07:59 +08:00
Feng Lee d1c3dec730 Optimize emqx_session and add more test cases 2019-12-11 13:44:52 +08:00
zhouzb ec2f758c9f Use erlang:system_time/1 2019-12-10 09:25:39 +08:00
Feng Lee 0f9f1258b6 Improve the emqx_message module and add more test cases
- Add 'emqx_message:clean_dup/1' function
- Clean dup flag before publishing a message
- Add more test cases for emqx_message module
2019-12-10 09:22:38 +08:00
Feng Lee 9c3273a2c6 Improve the process of handling MQTT control packets (#3079) 2019-12-06 19:51:06 +08:00
turtled 13b625f729 Fix compile warning 2019-12-03 19:15:04 +08:00
Feng Lee 7117dde879 Add more test cases for connection, channel and session modules 2019-10-21 17:14:50 +08:00
Feng Lee aecda09b9a Add more test cases 2019-10-19 20:18:34 +08:00
Feng Lee cd4adbada0 Add more test cases for connection, channel and session modules 2019-10-18 18:53:31 +08:00
Feng Lee 977b551bbf Fix the test cases for session, channel and connection modules 2019-09-29 10:53:59 +08:00
Feng Lee 8ab682151d Improve the connection and channel modules
- Rename the 'client_id' field to 'clientid'
- Support publish stats in channel module
- Update test cases for frame and channel modules
2019-09-29 10:22:02 +08:00
terry-xiaoyu 3a39442a1c Update testcases for session module 2019-09-20 18:50:31 +08:00
Feng Lee c067a43990 Update test cases 2019-09-19 06:06:25 +08:00
Feng Lee 847375d2fb Improve connection and channel modules (#2860)
Improve the connection and channel modules
2019-09-05 14:17:15 +08:00
Feng Lee c69a2b1b48 Ensure session expiration (#2825)
Ensure session expiration
2019-08-23 09:35:29 +08:00
Feng Lee 8b03371a4a Improve the keepalive, connection, channel and session modules (#2813) 2019-08-22 16:38:25 +08:00
Gilbert 79744af681 Wrapper proper test cases into common test cases (#2785)
* Wrapper proper test cases into common test cases

* Improve test cases for reason code module (#2789)

* Split 3 proper tests into 3 ct cases

* Improve test cases for client, rpc and request-response

* Add psk suites to increase coverage

* Add sys test cases
2019-08-16 18:07:12 +08:00
Feng Lee 4afa02ee48 Update all the test cases 2019-08-06 09:04:37 +08:00
Feng Lee c8317a230d Update copyright 2019-08-03 11:43:30 +08:00
Gilbert 0857b976ed Better zone (#2548) 2019-05-25 22:29:23 +08:00
Gilbert Wong b3927ff730 Add emqx_ct_helpers as deps and refactor test suites 2019-04-25 13:41:22 +08:00
Feng Lee e3bc8e4f0a Support batch delivery
- Upgrade the emqx_session module to support batch delivery
- Update emqx_protocol:deliver/2 to support batch delivery
- Update some test cases
2019-02-28 15:09:13 +08:00
turtled 31e95b56c4 Update Copyright to 2019 2019-01-29 10:43:25 +08:00
Gilbert Wong 1007105b57 Delete metrics test in session test suite 2018-12-20 22:31:19 +08:00
turtled 7a1ec580b0 Update broker test cases 2018-12-19 17:18:26 +08:00
周子博 ddb9eaef7b Improve test coverage of emqx_metrics 2018-11-30 17:44:29 +08:00
周子博 ea62b15c87 Alter apis provided by emqx_metrics, and use existing timer to commit metrics 2018-11-30 17:44:29 +08:00
周子博 194dbc02c8 Add batch commit for metrics 2018-11-30 17:44:29 +08:00
spring2maz a2c658ba19 Add acking mechamism for shared dispatch (#1872)
* Add acking mechamism for shared dispatch

For QoS0 messages, no acking
For QoS1/2 messages, 'ACK' at any of events below:
 - ACK when QoS is downgraded to 0
 - Message is sent to connection process
'NACK' at any of events below:
 - Message queue is full and the receiving session starts to drop old messages
 - The receiving session crash
Upon 'NACK', messages are dispatched to the 'next' subscriber in the group,
depending on the shared subscription dispatch strategy.
2018-11-21 22:49:45 +08:00
Gilbert 16821490ce Fix issue#1874 (#1964)
* Fix issue#1874
Prior to this change, if user use one client connect emqx with mqtt
v3.1.1, the client subscribe the topic and publish message to this
topic, it would receive this message itself published, this commit
provide a configure option to let user ignore the message itself published.

This change fix issue 1874.

* Small Fix

* Fix bug

* Better design

* Fix compile warning and improve coverage

* Better design to solve the performance issue

* Fix typo

* Fix typo

* Delete spaces in end of lines.

* Do not use anonymous function

* Better performance
2018-11-19 13:34:03 +08:00
spring2maz 3b9247994d Refine emqx_mock_client
Before this change, eqmx_mock_client uses a shared ets table
to store last received message, this causes troulbe when we
want to start / stop two or more clients in one test case
the ets table gets owned by the first spanwed client and
gets closed when the owner client dies.

Now it keeps the last received message in process state
and a gen_server call is added to retrieve it for verification

Along with this change in emqx_mock_client, it made possible
to write test case to verify the actual subscriber pid
used in shared subscription strategy, so test cases were
added (and modified) to verify different strategies
2018-09-22 10:51:38 +02:00
spring2maz f58165db73 Move shutdown policy config to zone configs 2018-09-19 22:28:22 +02:00
Gilbert Wong 2f63b7a487 update broker suite for latest code 2018-08-31 20:21:28 +08:00
Gilbert Wong 14ba395c21 fix seesion and connectiong test suites 2018-08-31 19:15:17 +08:00
周子博 c89f53f14d Add session, mountpoint test suites 2018-08-30 14:43:14 +08:00