Comments (6)
Hello,
I'm trying to make a request/response publish but is not clear how set Response topic and Correlation data in
:emqtt.publish(Client, Topic, Properties, Payload, PubOpts)
Can you provide how set Properties ?
Thx.
Luca
from emqtt.
Did you find an answer to this? I'm also wondering how to set the response topic.
from emqtt.
just set in Properties map, take a look in emqtt_props.erl.
from emqtt.
Thank you. Right, I can set 'Response-Topic' to a string, and I now see this logged when I publish:
[debug] [clientid: "emqtt-ab49cf24b912acf684db", msg: ~c"SEND_Data", packet: {:mqtt_packet, {:mqtt_packet_header, 3, false, 1, false}, {:mqtt_packet_publish, "command/tlc_582a/plan", 14, %{"Response-Topic": "response/tlc_582a"}}, "7"}, socket: #Port<0.30>]
But when another client receives this I don't see any properties:
%{
client_pid: #PID<0.189.0>,
dup: false,
packet_id: 1,
payload: "7",
properties: %{},
qos: 1,
retain: false,
topic: "command/tlc_582a/plan",
via: #Port<0.12>
}
Shouldn't I see the Response-Topic as a property when I receive the message? Or is there another way to get it?
Note: I'm using Elixir.
from emqtt.
Did you connect using MQTT protocol version 5?
{:ok, c} = :emqtt.start_link(proto_ver: :v5, ...)
from emqtt.
Great tip! I thought I did, but realized I only did so in one of the clients, not the other. Now it works 👍
from emqtt.
Related Issues (20)
- Error: Connection refused: Not authorized HOT 1
- Client does not disconnect from broker if keepalive ping gets no response (heartbeat timeout) HOT 2
- not sending keep alive ping packets? HOT 3
- Connecting in Elixir HOT 4
- [1.4.4] Elixir release crashes on raspberry pi zero w (first gen) HOT 1
- error on deps.get HOT 1
- timeout keepalive while waiting for connack? HOT 2
- How to write a callback function to continuously receive the messages from subscription topics?
- Typo `clietntid` -> `clientid`? HOT 1
- emqtt library : client disconnected from broker even if keepalive is set to 300s HOT 1
- einval connection error using emit library in elixir and as cli HOT 17
- can't compile HOT 5
- TLS/SSL ca cert configuration for Elixir HOT 8
- How to include emqtt into an elixir mix release HOT 1
- emqtt:publish_async spec
- Reconnect option HOT 8
- Buffering messages locally if broker is unavailable? HOT 10
- Unhandled {error,closed} in state connected causes crash HOT 2
- Topic Alias after reconnecting HOT 21
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 emqtt.