* NEW [iceoryx] Add a example to use iceoryx.

Signed-off-by: wanghaemq <wangwei@emqx.io>
This commit is contained in:
wanghaemq
2024-05-07 03:50:49 -04:00
committed by wangha
parent c2b78ba4dd
commit 6a561d33f8
2 changed files with 12 additions and 2 deletions

View File

@ -661,7 +661,7 @@ server_cb(void *arg)
#endif
#if defined(SUPP_ICEORYX)
if (work->flag == CMD_PUBLISH && work->msg != NULL &&
true == nano_iceoryx_topic_filter("fwd/ice",
true == nano_iceoryx_topic_filter("ice/fwd",
work->pub_packet->var_header.publish.topic_name.body,
work->pub_packet->var_header.publish.topic_name.len)) {
if (0 != (rv = nano_iceoryx_send_nng_msg(
@ -1145,7 +1145,7 @@ broker(conf *nanomq_conf)
const char *iceoryx_service = "NanoMQ-Service";
const char *iceoryx_instance = "NanoMQ-Instance";
const char *iceoryx_event_sub = "topic";
const char *iceoryx_event_pub = "fwd/ice";
const char *iceoryx_event_pub = "ice/fwd";
nng_iceoryx_open(&iceoryx_sock, "NanoMQ-Iceoryx");
nng_iceoryx_suber *suber;

View File

@ -7,6 +7,16 @@
// found online at https://opensource.org/licenses/MIT.
//
// An example for communicating iceoryx client with nanomq.
//
// MQTT client -> NanoMQ -> iceoryx client.
// nanomq_cli pub -t ice/fwd -m aaa
// nanomq_cli iceoryx submqtt ss NanoMQ-Service NanoMQ-Instance ice/fwd
//
// iceoryx client -> NanoMQ -> MQTT client.
// nanomq_cli iceoryx pubmqtt pp NanoMQ-Service NanoMQ-Instance topic acc
// nanomq_cli sub -t topic
#if defined(SUPP_ICEORYX)
#include "nng/nng.h"