Hi team,
I have installed Kong in my EKS cluster.
here is my proxy configuration
proxy:
streamPorts:
# MQTT SSL Port
- protocol: TCP
containerPort: 1883
servicePort: 1883
# MQTT SSL Port
- protocol: TCP
containerPort: 8883
servicePort: 8883
tls:
containerPort: 8000
TCPIngress
apiVersion: configuration.konghq.com/v1beta1
kind: TCPIngress
metadata:
name: mqttingress
namespace: iotcore
annotations:
kubernetes.io/ingress.class: "kong"
spec:
rules:
- port: 1883 # MQTT port
backend:
serviceName: emqx
servicePort: 1883
- port: 8883 # MQTT SSL port
backend:
serviceName: emqx
servicePort: 8883
here when I try to run this
mqttx pub \
--hostname mqtt.iot-test.org.com \
--port 1883 \
--topic devices \
--message "{\"deviceId\":16,\"value\":40.1,\"region\":\"EMEA\",\"timestamp\":1482236627236}" \
--username 'admin' \
--password 'public'
below is the ticket raised for the same issue with mqttx community
opened 06:18AM - 22 Jul 24 UTC
help wanted
CLI
EMQX
Hi Team,
I have a cluster created in EKS, components using emqx-v5.7.1, kong - … using NLB
I am using mqttx to publish a message using below command
```
mqttx pub \
--hostname mqtt.iot-test.org.com \
--port 1883 \
--topic devices \
--message "{\"deviceId\":16,\"value\":40.1,\"region\":\"EMEA\",\"timestamp\":1482236627236}" \
--username 'admin' \
--password 'public'
```
here are the logs
```
mqttjs connecting to an MQTT broker... +0ms
mqttjs:client MqttClient :: options.protocol mqtt +0ms
mqttjs:client MqttClient :: options.protocolVersion 5 +0ms
mqttjs:client MqttClient :: options.username admin +0ms
mqttjs:client MqttClient :: options.keepalive 30 +0ms
mqttjs:client MqttClient :: options.reconnectPeriod 1000 +0ms
mqttjs:client MqttClient :: options.rejectUnauthorized undefined +0ms
mqttjs:client MqttClient :: options.topicAliasMaximum undefined +0ms
mqttjs:client MqttClient :: clientId mqttx_2ea4955d +1ms
mqttjs:client MqttClient :: setting up stream +0ms
mqttjs:client _setupStream :: calling method to clear reconnect +0ms
mqttjs:client _clearReconnect : clearing reconnect timer +0ms
mqttjs:client _setupStream :: using streamBuilder provided to client to create stream +0ms
mqttjs calling streambuilder for mqtt +2ms
mqttjs:tcp port 1883 and host mqtt.iot-test.org.com +0ms
mqttjs:client _setupStream :: pipe stream to writable stream +3ms
mqttjs:client _setupStream: sending packet `connect` +0ms
mqttjs:client sendPacket :: packet: { cmd: 'connect' } +1ms
mqttjs:client sendPacket :: emitting `packetsend` +1ms
mqttjs:client sendPacket :: writing to stream +0ms
mqttjs:client sendPacket :: writeToStream result true +11ms
⠸ Connecting... mqttjs:client !!connectTimeout hit!! Calling _cleanUp with force `true` +30s
mqttjs:client _cleanUp :: forced? true +0ms
mqttjs:client _cleanUp :: (mqttx_2ea4955d) :: destroying stream +0ms
mqttjs:client _cleanUp :: client not disconnecting. Clearing and resetting reconnect. +1ms
mqttjs:client _clearReconnect : clearing reconnect timer +0ms
mqttjs:client _setupReconnect :: emit `offline` state +0ms
mqttjs:client _setupReconnect :: set `reconnecting` to `true` +0ms
mqttjs:client _setupReconnect :: setting reconnectTimer for 1000 ms +0ms
mqttjs:client (mqttx_2ea4955d)stream :: on close +0ms
mqttjs:client flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function +0ms
mqttjs:client stream: emit close to MqttClient +0ms
mqttjs:client close :: connected set to `false` +0ms
mqttjs:client close :: clearing connackTimer +0ms
mqttjs:client close :: clearing ping timer +0ms
mqttjs:client close :: calling _setupReconnect +0ms
mqttjs:client _setupReconnect :: doing nothing... +0ms
⠴ Connecting... mqttjs:client reconnectTimer :: reconnect triggered! +1s
mqttjs:client _reconnect: emitting reconnect to client +0ms
mqttjs:client _reconnect: calling _setupStream +0ms
mqttjs:client _setupStream :: calling method to clear reconnect +0ms
mqttjs:client _clearReconnect : clearing reconnect timer +0ms
mqttjs:client _setupStream :: using streamBuilder provided to client to create stream +1ms
mqttjs calling streambuilder for mqtt +31s
mqttjs:tcp port 1883 and host mqtt.iot-test.org.com +31s
mqttjs:client _setupStream :: pipe stream to writable stream +0ms
mqttjs:client _setupStream: sending packet `connect` +0ms
mqttjs:client sendPacket :: packet: { cmd: 'connect' } +0ms
mqttjs:client sendPacket :: emitting `packetsend` +1ms
mqttjs:client sendPacket :: writing to stream +0ms
mqttjs:client sendPacket :: writeToStream result true +0ms
⠏ Reconnecting...[1/10]
```
I am getting the above error.
I have creates tcpIngress as well.
```
apiVersion: configuration.konghq.com/v1beta1
kind: TCPIngress
metadata:
name: mqttingress
namespace: mqtt
annotations:
kubernetes.io/ingress.class: "kong-ingress"
spec:
rules:
- port: 1883 # MQTT port
backend:
serviceName: emqx
servicePort: 1883
- port: 8883 # MQTT SSL port
backend:
serviceName: emqx
servicePort: 8883
```
Also added below config in my KONG
```
nlbConfig: true
proxy:
streamPorts:
- protocol: TCP
containerPort: 1883
servicePort: 1883
# MQTT SSL Port
- protocol: TCP
containerPort: 8883
servicePort: 8883
tls:
containerPort: 8000
```
can you team help me out here
https://emqx.slack.com/archives/C02D74THZPF/p1721628206450979
mqttx is unable to send the message and I don’t see any logs in Kong.
Traffic is coming in when I use curl with http end point, but not for the mqttx with tcp endpoint
can anyone help me here