diff options
author | Jakob Odersky <jakob@odersky.com> | 2018-09-10 15:10:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 15:10:09 -0700 |
commit | f07bee564b11ee76fd065ec849a888bcf4e74e85 (patch) | |
tree | 538330c7592ccd4f555a07bf03aa91cace403be5 /src/main/scala/xyz/driver/core/messaging/GoogleBus.scala | |
parent | 93ffc0a5c4b54a8beea10c3fd68e7a2d70c4c771 (diff) | |
download | driver-core-f07bee564b11ee76fd065ec849a888bcf4e74e85.tar.gz driver-core-f07bee564b11ee76fd065ec849a888bcf4e74e85.tar.bz2 driver-core-f07bee564b11ee76fd065ec849a888bcf4e74e85.zip |
Various message bus fixes (#212)v1.14.0
1. Move to pure mixin-based ("stackable traits") pattern.
2. Provide a "CreateOnDemand" mixin that ensures topics and
subscriptions have been created before they are used.
Diffstat (limited to 'src/main/scala/xyz/driver/core/messaging/GoogleBus.scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/messaging/GoogleBus.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala b/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala index cf60e59..9895708 100644 --- a/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala +++ b/src/main/scala/xyz/driver/core/messaging/GoogleBus.scala @@ -58,7 +58,7 @@ class GoogleBus( namespace: String, pullTimeout: Duration = 90.seconds )(implicit val executionContext: ExecutionContext, backend: SttpBackend[Future, _]) - extends Bus with StreamBus with CreateBeforeStream { + extends Bus { import GoogleBus.Protocol case class MessageId(subscription: String, ackId: String) @@ -133,7 +133,7 @@ class GoogleBus( .bearer(await(getToken())) val result = await(request.send()) result.body match { - case Left(error) if result.code != 409 => // 409 <=> topic already exists + case Left(error) if result.code != 409 => // 409 <=> topic already exists, ignore it throw new NoSuchElementException(s"Error creating topic: Status code ${result.code}: $error") case _ => () } @@ -152,7 +152,7 @@ class GoogleBus( ) val result = await(request.send()) result.body match { - case Left(error) if result.code != 409 => // 409 <=> subscription already exists + case Left(error) if result.code != 409 => // 409 <=> subscription already exists, ignore it throw new NoSuchElementException(s"Error creating subscription: Status code ${result.code}: $error") case _ => () } |