Skip to content

Commit

Permalink
fix a bug preventing commands for a device being sent to the gateway …
Browse files Browse the repository at this point in the history
…representing the device if Pub/Sub is used as the messaging infrastructure

Signed-off-by: Matthias Kaemmer <[email protected]>
  • Loading branch information
mattkaem committed Jul 28, 2023
1 parent 3f2eee3 commit c356232
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ private Map<String, Object> getAttributes(final PubSubBasedCommand command) {
attributes.put(PubSubMessageHelper.PUBSUB_PROPERTY_PROJECT_ID, projectId);
attributes.put(PubSubMessageHelper.PUBSUB_PROPERTY_RESPONSE_REQUIRED, !command.isOneWay());
Optional.ofNullable(command.getGatewayId()).ifPresent(
id -> attributes.put(MessageHelper.APP_PROPERTY_GATEWAY_ID, id));
id -> {
attributes.put(MessageHelper.APP_PROPERTY_GATEWAY_ID, id);
attributes.put(MessageHelper.APP_PROPERTY_CMD_VIA, id);
});
return attributes;
}
}

0 comments on commit c356232

Please sign in to comment.