Skip to content

Commit

Permalink
fix(pubsub): missing credential provider on the PubSub Consume task (k…
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu authored Sep 4, 2023
1 parent 4d22b83 commit 13d96e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/io/kestra/plugin/gcp/pubsub/Consume.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.kestra.plugin.gcp.pubsub;

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.cloud.pubsub.v1.MessageReceiver;
import com.google.cloud.pubsub.v1.Subscriber;
import io.kestra.core.models.annotations.Example;
Expand Down Expand Up @@ -100,7 +101,9 @@ public Output run(RunContext runContext) throws Exception {
consumer.nack();
}
};
var subscriber = Subscriber.newBuilder(subscriptionName, receiver).build();
var subscriber = Subscriber.newBuilder(subscriptionName, receiver)
.setCredentialsProvider(FixedCredentialsProvider.create(this.credentials(runContext)))
.build();
subscriber.startAsync().awaitRunning();

while (!this.ended(total, started)) {
Expand Down

0 comments on commit 13d96e3

Please sign in to comment.