Skip to content
Open
Show file tree
Hide file tree
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 @@ -27,6 +27,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

public class PubSub {

Expand Down Expand Up @@ -332,7 +333,7 @@ public void onConnectionResumed(boolean sessionPresent) {
int count = 0;
while (count++ < messagesToPublish) {
CompletableFuture<Integer> published = connection.publish(new MqttMessage(topic, message.getBytes(), QualityOfService.AT_LEAST_ONCE, false));
published.get();
published.get(10, TimeUnit.SECONDS);
Thread.sleep(1000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,17 @@ public void run() {
@Override
public void run() {
/* Show the warning that the table is CREATING/DELETING/UPDATING */
MessageDialog dialog = new MessageDialog(
try (MessageDialog dialog = new MessageDialog(
Display.getCurrent().getActiveShell(),
"Cannot open this table",
AwsToolkitCore.getDefault()
.getImageRegistry()
.get(AwsToolkitCore.IMAGE_AWS_ICON),
"Cannot open this table(" + tableName + "), since it is in the status of " + tableStatus + ".",
MessageDialog.ERROR,
new String[] { "OK" }, 0);
dialog.open();
new String[] { "OK" }, 0)) {
dialog.open();
}
}
});
}
Expand Down