Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Make Pub/Sub emulator fail on purpose

Hello

I have a Node.js app running on my local machine that publishes to a pub/sub topic. I'm currently using the Pub/Sub emulator Docker image to receive the messages so I don't use the actual service.

I want to test a scenario where Pub/Sub has a big latency in receiving my messages and throws a timeout error.

How can I simulate such a scenario? Is there any extra configuration I can add to the pub/sub simulator to make it fail on purpose?

Thanks

Solved Solved
0 3 962
1 ACCEPTED SOLUTION

You may use a network simulation tool that can introduce latency or packet loss between your app and the emulator. If you are on Linux, you can use tc.

View solution in original post

3 REPLIES 3