-
Notifications
You must be signed in to change notification settings - Fork 134
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
support json payload template #202
support json payload template #202
Conversation
dfe1c97
to
3861b79
Compare
13c30a9
to
7ab26de
Compare
7ab26de
to
f2e942e
Compare
@@ -25,6 +25,7 @@ Profiles = {profiles,[ {escript, []} | |||
, getopt | |||
, gun | |||
, cowlib | |||
, jsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch to 27 and use https://www.erlang.org/doc/apps/stdlib/json.html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true.
json encoding with large payload is toooo slow. Took me some time to find the slowness is coming from jsx.
In my demo, or test report, I will use eterm
encoding, json encoding is reserved for specific customer.
topic_spec.json
Outdated
"QoS": 1, | ||
"payload_encoding": "eterm", | ||
"payload": {"foo1" : "bar1", "timestamp": "0", "Data": "10"}, | ||
"stream" : 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stream 0 is default, signal stream solution used by TCP TCP/TLS and QUIC single stream.
stream >0 is for multi stream features and will only work with QUIC enabled .
"interval_ms": "5000", | ||
"inject_timestamp" : "ms", | ||
"QoS": 1, | ||
"payload_encoding": "eterm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be json
but slow for large payload.
ff56212
to
6e1000a
Compare
rebar.config.script
Outdated
[emqtt_bench, | ||
prometheus, | ||
quantile_estimator, | ||
cowboy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add jsx
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary, I added it in emqtt_bench.app.src
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but isn't this to generate the escript, which will need jsx to decode the template files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is working as expected at: https://github.com/qzhuyan/emqtt-bench/releases/tag/0.4.22%2Bcustm1
I think rebar pack the jsx into the escript archive file if it is defined in the app.src.
maybe we should put these (emqtt_bench, prometheus, quantile_estimator, cowboy) to app src as well?
I think escript_incl_apps
is to include none dependable apps such like 'redbug'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is working as expected at: https://github.com/qzhuyan/emqtt-bench/releases/tag/0.4.22%2Bcustm1
I think rebar pack the jsx into the escript archive file if it is defined in app.src.
maybe we should put these (emqtt_bench, prometheus, quantile_estimator, cowboy) to app src as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I thought this setting could be relevant.
maybe we should put these (emqtt_bench, prometheus, quantile_estimator, cowboy) to app src as well?
I think they are (except the first, which is the app itself). Though quicer
would need to be conditionally inserted as well?
rebar.config.script
Outdated
[emqtt_bench, | ||
prometheus, | ||
quantile_estimator, | ||
cowboy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I thought this setting could be relevant.
maybe we should put these (emqtt_bench, prometheus, quantile_estimator, cowboy) to app src as well?
I think they are (except the first, which is the app itself). Though quicer
would need to be conditionally inserted as well?
072a53d
to
fb45cab
Compare
Not sure if we should merge this.this branch used a private fork of EMQTT and intro some features that might not that be useful for others.This branch added new arg
--topics_payload some.json
, the json file has defined topics so emqtt-bench now supports publish to different topics. This is new{publish, Topic}
method which means some CLI args for publishing are not used.This branch has its value for testing the QUIC multi streams that maps different priority topics onto different streams to mitigate the HOL blocking issue.
this branch deps on: emqx/emqtt#252