Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make pubsub pusher optional #325

Merged
merged 2 commits into from
May 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ private BiConsumer<Map<String, Object>, Map<String, String>> messageValidator()
private void validatePubSub(String instName) {
String registryId = cloudIotConfig.registry_id;
client = new PubSubClient(projectId, registryId, instName);
dataSink = new PubSubDataSink(projectId, cloudIotConfig.update_topic);
if (cloudIotManager.getUpdateTopic() != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason this isn't the same as the next line (cloudIoTConfig.update_topic) -- aren't they they same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the same. I've changed the next line to use cloudIotManager.getUpdateTopic() for consistency with what's in registrar. I don't know which should be preferred over the other

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either one is fine -- it's just that they were mixed within one logical clause.

dataSink = new PubSubDataSink(projectId, cloudIotManager.getUpdateTopic());
}
}

private void validateReflector(String instName) {
Expand Down