Java -Client für MQTT WebSocket mit vorgestellter URL

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Java -Client für MQTT WebSocket mit vorgestellter URL

by Anonymous » 19 Aug 2025, 06:30

Die vorgeschriebene Websocket -URL ist so etwas wie diese WSS: // .eu-west-1.amazonaws.com: 443/mqtt? x-amz-algorithmus = aws4-hmac-sha256 & x-amz-credential = /eu-west-1/iotdevicegateway/aws4_request & X-AMZ-dat = 20250814t085431z & X-AMZ-Expires = 86400 & X-AMZ-Signedheaders = Host & X-AMZ-Signature = & X-Amz-Security-Token =
Und hier ist mein Code < /p>

Code: Select all

    AwsIotMqttConnectionBuilder builder = AwsIotMqttConnectionBuilder.newMtlsBuilderFromPath(null, null)
.withWebsockets(true) // Crucial for presigned URL connections
.withEndpoint(connectionUrl) // Pass the presigned URL here
.withClientId(clientId)
.withConnectionEventCallbacks(callbacks)
.withWebsocketSigningRegion("eu-west-1")
.withPort(443); // Default WebSocket port

MqttClientConnection connection = builder.build();

// Connect to AWS IoT Core
CompletableFuture connected = connection.connect();
connected.get(); // Wait for connection to complete
Ich erhalte den folgenden Fehler, wenn ich den Code ausführe.>

Top