Skip to content

Commit eab7ece

Browse files
committed
Fix response topics
1 parent 2aa29b4 commit eab7ece

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sdk/src/main/java/software/amazon/awssdk/iot/iotcommands/IotCommandsV2Client.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,19 @@ public CompletableFuture<UpdateCommandExecutionResponse> updateCommandExecution(
151151

152152
// Response paths
153153
ResponsePath.ResponsePathBuilder pathBuilder1 = ResponsePath.builder();
154-
String responseTopic1 = publishTopic + "/accepted";
155-
pathBuilder1.withResponseTopic(publishTopic + "/accepted");
154+
String responseTopic1 = "$aws/commands/{deviceType}/{deviceId}/executions/{executionId}/response/accepted/json";
155+
responseTopic1 = responseTopic1.replace("{deviceType}", request.deviceType.toString());
156+
responseTopic1 = responseTopic1.replace("{deviceId}", request.deviceId);
157+
responseTopic1 = responseTopic1.replace("{executionId}", request.executionId);
158+
pathBuilder1.withResponseTopic(responseTopic1);
156159
builder.withResponsePath(pathBuilder1.build());
157160

158161
ResponsePath.ResponsePathBuilder pathBuilder2 = ResponsePath.builder();
159-
String responseTopic2 = publishTopic + "/rejected";
160-
pathBuilder2.withResponseTopic(publishTopic + "/rejected");
162+
String responseTopic2 = "$aws/commands/{deviceType}/{deviceId}/executions/{executionId}/response/rejected/json";
163+
responseTopic2 = responseTopic2.replace("{deviceType}", request.deviceType.toString());
164+
responseTopic2 = responseTopic2.replace("{deviceId}", request.deviceId);
165+
responseTopic2 = responseTopic2.replace("{executionId}", request.executionId);
166+
pathBuilder2.withResponseTopic(responseTopic2);
161167
builder.withResponsePath(pathBuilder2.build());
162168

163169
// Submit

0 commit comments

Comments
 (0)