Bridge stops working after sending a message
fuegas opened this issue · 1 comments
Hi!
We're using a bridge between two clusters (both running EMQX 4.0.7) to forward messages. However, when it sends a message the bridge stops working and raises the following error:
(emqx@172.31.164.18)1> 2020-06-22 12:51:50.211 [info] [Bridge] Bridge emqx_bridge_worker_NAME diconnected
reason={puback_error_code,16}
(emqx@172.31.164.18)1> 2020-06-22 12:51:50.211 [error] ** State machine <0.1983.0> terminating
** Last event = {cast,{mqtt_packet,{mqtt_packet_header,4,false,0,false},
{mqtt_packet_puback,2,16,#{}},
undefined}}
So, the reason given is: {puback_error_code,16}
. When we take a look at the source code handling the puback:
handle_puback(Parent, #{packet_id := PktId, reason_code := RC}) ->
RC =:= ?RC_SUCCESS orelse error({puback_error_code, RC}),
Parent ! {batch_ack, PktId},
ok.
It matches RC
to RC_SUCCESS
and must match type. In this project RC_SUCCESS
is not defined, however it is defined in emqx itself:
-define(RC_SUCCESS, 16#00).
...
-define(RC_NO_MATCHING_SUBSCRIBERS, 16#10).
From the error code we receive a RC_NO_MATCHING_SUBSCRIBERS
. My question is: should this close the bridge connection and stop the bridge from functioning at all?
The situation we're in now is that we receive this error and the bridge is disconnected each time we try to start the bridge. How can we resolve this issue?
Closing this issue in favor of issue at main repository: emqx/emqx#3553.