# Alpakka Google Pub Sub

**URL:** https://discuss.akka.io/t/alpakka-google-pub-sub/2166
**Category:** Akka Streams & Alpakka
**Created:** [September 19, 2018, 9:47am UTC](https://discuss.akka.io/t/alpakka-google-pub-sub/2166 "2018-09-19T09:47:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![damianbl](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/damianbl/32/862_2.png) [@damianbl](https://discuss.akka.io/u/damianbl)
#### Post date: [September 19, 2018, 9:47am UTC](https://discuss.akka.io/t/alpakka-google-pub-sub/2166/1 "2018-09-19T09:47:16Z")

</div>

Hi,

I have the following issue.

I integrate with Google Pub Sub using Alpakka. It works flawlessly when I work with Google Cloud Pub Sub.

However, for the developers machines I want to integrate with Google Pub Sub Emulator. Obviously this is also perfectly supported by Alpakka.  
The only issue I have is the really high CPU usage of the local Google Pub Sub Emulator (I run it in the Docker container).  
I think this is the result of continuous HTTP pulling from the `GooglePubSubSource`.  
I see in the `GooglePubSubSource` that it pulls the API constantly if no messages are fetched.  
I mean `fetch` function here:

> <https://github.com/akka/alpakka/blob/master/google-cloud-pub-sub/src/main/scala/akka/stream/alpakka/googlecloud/pubsub/GooglePubSubSource.scala>

On my side I wrap the `GooglePubSub` source in `RestartSource`. I tried to throttle on my side on this source but it does not help.

To be able to use Alpakka Google Pub Sub at all I need to decrease the CPU usage on developers machines.

Do you have any suggestions?

I would really appreciate it.

Thanks,  
Damian.

---

<div class="post-metadata">

### Author: ![damianbl](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/damianbl/32/862_2.png) [@damianbl](https://discuss.akka.io/u/damianbl)
#### Post date: [September 21, 2018, 7:09am UTC](https://discuss.akka.io/t/alpakka-google-pub-sub/2166/2 "2018-09-21T07:09:07Z")

</div>

For now I resolved it in a away that I implemented a simple PubSub emulator on my side to be used on developers machines so I do not use the Alpakka PubSub with Google PubSub Emulator locally.  
However, I’d love to remove my code and use Google PubSub Emulator as intended.
