Mulitple publishers to same topic

119 views
Skip to first unread message

Guru Alex

unread,
Feb 18, 2021, 1:38:58 AM2/18/21
to emqtt

Hello,

We have configured two publishers that publish messages to the same topic. While the messages get through to the subscribers, I see the following error message in the application logs:

ERROR 1 --- [: msg-manager] o.s.i.m.outbound.MqttPahoMessageHandler : Lost connection; will attempt reconnect on next request

The EMQX logs has the following:
[error] <<"Pub1">>@172.21.19.100:55027 [Channel] Unexpected sock_closed: einval

The reconnection keeps happening in a loop. So can someone please help with the following questions:
1. Is it possible to have multiple publishers publish to the same topic ?
2. If yes, is there any configuration change needed ?

Regards,
Guru

imsbha...@gmail.com

unread,
Feb 18, 2021, 8:54:08 AM2/18/21
to emqtt
Hi Guru,

The two publishers, publishing on the same topic should have different clientIds. 
Can you check the Client Identifier (ClientId) you are using in the MQTT CONNECT ?

Thanks,
Saurabh

Guru Alagwadi

unread,
Mar 2, 2021, 10:39:40 AM3/2/21
to emqtt
Hi Saurabh,

Yes, that was the issue. The developer (java) had left the ClientID field blank assuming that it will generate a unique string as ClientID. For some reason, it did not. Now we set the ClientID to some unique strings and the error disappeared.

Thanks a lot for the help

Regards,
Guru

Reply all
Reply to author
Forward
0 new messages