diff --git a/samples/browser/react_sample/src/PubSub5.tsx b/samples/browser/react_sample/src/PubSub5.tsx index ab5df18d..9f2ccef1 100644 --- a/samples/browser/react_sample/src/PubSub5.tsx +++ b/samples/browser/react_sample/src/PubSub5.tsx @@ -77,9 +77,10 @@ function createClient(provider: AWSCognitoCredentialsProvider) : mqtt5.Mqtt5Clie let builder: iot.AwsIotMqtt5ClientConfigBuilder = iot.AwsIotMqtt5ClientConfigBuilder.newWebsocketMqttBuilderWithSigv4Auth( AWS_IOT_ENDPOINT, wsConfig - ) + ); builder.withConnectProperties({ - clientId: "test-" + Math.floor(Math.random() * 100000000) + clientId: "test-" + Math.floor(Math.random() * 100000000), + keepAliveIntervalSeconds: 30 // Mandatory field added }); let client : mqtt5.Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());