-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
81 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ laika.navigationOrder = [ | |
index.md | ||
sqs.md | ||
service-bus.md | ||
pubsub.md | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# GCP PubSub | ||
|
||
You can create a client to service bus queues by using the [GCP PubSub][pubsub] module. | ||
|
||
```scala | ||
libraryDependencies += "com.commercetools" %% "fs2-queues-gcp-pubsub" % "@SNAPSHOT_VERSION@" | ||
``` | ||
|
||
For instance you can create a managed client via a region and credentials as follows. | ||
|
||
```scala mdoc:compile-only | ||
import cats.effect.IO | ||
import com.commercetools.queue.gcp.pubsub._ | ||
import com.google.api.gax.core.GoogleCredentialsProvider | ||
|
||
val project = "my-project" // your project | ||
val credentials = GoogleCredentialsProvider.newBuilder().build() // however you want to authenticate | ||
|
||
PubSubClient[IO](project, credentials).use { client => | ||
??? | ||
} | ||
``` | ||
|
||
The client is managed, meaning that it uses a dedicated HTTP connection pool that will get shut down upon resource release. | ||
|
||
If integrating with an existing code base where you already have an instance of `TransportChannelProvider` that you would like to share, you can use the `unmanaged` construtor. | ||
In this case, it is up to you to manage the channel provider life cycle. | ||
|
||
[pubsub]: https://cloud.google.com/pubsub/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters