Skip to content

Commit

Permalink
Add client ID to more samples
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Dec 27, 2024
1 parent 4489789 commit 70773a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions samples/browser/pub_sub_mqtt5/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ function createClient(provider: AWSCognitoCredentialsProvider) : mqtt5.Mqtt5Clie
wsConfig
)

builder.withConnectProperties({
clientId: "test-" + Math.floor(Math.random() * 100000000)
});

let client : mqtt5.Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());

client.on('error', (error) => {
Expand Down
3 changes: 3 additions & 0 deletions samples/browser/react_sample/src/PubSub5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ function createClient(provider: AWSCognitoCredentialsProvider) : mqtt5.Mqtt5Clie
AWS_IOT_ENDPOINT,
wsConfig
)
builder.withConnectProperties({
clientId: "test-" + Math.floor(Math.random() * 100000000)
});

let client : mqtt5.Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());

Expand Down

0 comments on commit 70773a8

Please sign in to comment.