diff --git a/netclient/functions/mqpublish.go b/netclient/functions/mqpublish.go index baaa70dc..31c84694 100644 --- a/netclient/functions/mqpublish.go +++ b/netclient/functions/mqpublish.go @@ -169,6 +169,9 @@ func checkBroker(broker string, port string) error { if broker == "" { return errors.New("error: broker address is blank") } + if port == "" { + return errors.New("error: broker port is blank") + } _, err := net.LookupIP(broker) if err != nil { return errors.New("nslookup failed for broker ... check dns records") @@ -178,10 +181,6 @@ func checkBroker(broker string, port string) error { if err != nil { logger.Log(1, "error converting port to int: "+err.Error()) } - if intPort == 0 { - logger.Log(1, "port unset in config. Using default of 8883, which may be incorrect.") - intPort = 8883 - } pinger.SetTarget(&ping.Target{ Protocol: ping.TCP, Host: broker,