Comments (3)
Hi, @victorclaessen Is your message going to be big? There is a BUG in v4.0.6 that causes a large message not to be encoded as JSON. see emqx/emqx#3382
Please you can try the v4.1-alpha.2 version. It may be fixed it.
from emqx-web-hook.
In my case, the message payload was short (the string value "test"), so I'm not sure if the bug affects this situation.
Could you possibly comment on my test strategy? Am I doing things right generally?
I will try to get the alpha version. (edit) I have looked at the alpha version of the plugin, but I'm not sure how to compile it. Do you have instructions for compiling, or a binary for Debian 10/amd64?
from emqx-web-hook.
I'm sorry. My understanding of parsing POST data in PHP was wrong. EMQ is posting all the variables as json. PHP just doesn't get json data like it does HTML form data (as explained here). When I changed my webhook.php to the following, I got my json formatted data:
<?php
$name=$_SERVER[UNIQUE_ID];
file_put_contents("webhooklog/post.$name.log", file_get_contents("php://input"));
print "ok";
?>
The data in the log file was:
{"username":"undefined","topic":"t/test","timestamp":1587891259502,"qos":0,"publish_received_at":1587891259502,"peerh
ost":"127.0.0.1","payload":"TEST","node":"emqx@REDACTEDHOSTNAME","msg":"TEST","id":"5A42DBE76EE02A1
D6490031280001","headers":{"username":"undefined","protocol":"mqtt","proto_ver":4,"peerhost":"127.0.0.1"},"flags":{"r
etain":false,"dup":false},"event":"message.publish","clientid":"mosq-SplOK4c5Z2Fgr1HWCZ"}
I will now go on to try and figure out how to format the json data. I did not find anything about the formatting in the documentation. If I cannot get it to work, I will open a new issue.
Sorry to bother you with this.
from emqx-web-hook.
Related Issues (20)
- Issue with WS connections HOT 1
- Connection to emqx using websockets is delayed HOT 3
- Client ID is blank HOT 2
- Confusion regarding emqx-rule-engine HOT 3
- Does not support HTTP Basic Authentication HOT 1
- Cann't publish message with emqx-web-hook enabled HOT 4
- How can I find the emqx_web_hook's log HOT 1
- emqx-web-hook is blocking message being received by subscribers HOT 9
- Dynamically create a request URL (when combined with Rule Engine) HOT 1
- Can I add the date of today to url address?
- webhook badmatch error HOT 1
- Improve test cases
- emqx-web-hook always get http request failed
- Web hook resource path handling in 4.3.3 and 4.3.5 HOT 1
- Incorrect parsing of Webhook URL
- How to get a byte aray payload when using weh-hook's publish action HOT 1
- Webhook connection result 404
- Insufficient webhooks when client disconnects from EMQ node
- docker Incorrect parsing of Webhook URL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emqx-web-hook.