PubSub emulation

447 views
Skip to first unread message

Alexander Potapov

unread,
Mar 14, 2016, 7:12:36 AM3/14/16
to Google Cloud Pub/Sub Discussions
Hello there!

Trying to run emulation for PubSub service. There is no clear manual explaining how it works.
Can I work offline with this emulation at all?

Nick

unread,
Mar 21, 2016, 9:32:06 AM3/21/16
to Google Cloud Pub/Sub Discussions
Hey Alexander,

PubSub, being a cloud service, is not really available as an "offline emulation". It would be up to you to develop the code which could emulate the service and interact with the development server code. 

As for a clear manual explaining how PubSub works, there's no better reference than the official documentation.

Kamal Aboul-Hosn

unread,
Mar 21, 2016, 10:40:02 AM3/21/16
to Nick, Google Cloud Pub/Sub Discussions
Hi, Alexander,

There is a Cloud Pub/Sub emulator as part of gcloud tool currently in beta. The documentation is a little lacking right now, but we do have an interactive tutorial in the works. The basic steps to start it up are:

1. Create a directory where you want to hold the data for the emulator.
2. Start the emulator with the command: 
     gcloud beta emulators pubsub --data-dir=<full path to directory from step 1> start
3. Run this command to get the environment variables for the endpoint to hit for the emulator:
     
gcloud beta emulators pubsub --data-dir=<full path to directory from step 1> env-init
4. Run your clients with these environment variables set. You can also use the localhost:<port> address to reach the emulator that you started.

I hope that helps!

Kamal

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/46489643-da24-494b-b0e1-c0ee6aca39a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nick

unread,
Mar 21, 2016, 10:43:17 AM3/21/16
to Google Cloud Pub/Sub Discussions, pay...@google.com

"gcloud beta emulators pubsub", wonderful! I had no idea this existed, awesome.


On Monday, March 21, 2016 at 10:40:02 AM UTC-4, Kamal Aboul-Hosn wrote:
Hi, Alexander,

There is a Cloud Pub/Sub emulator as part of gcloud tool currently in beta. The documentation is a little lacking right now, but we do have an interactive tutorial in the works. The basic steps to start it up are:

1. Create a directory where you want to hold the data for the emulator.
2. Start the emulator with the command: 
     gcloud beta emulators pubsub --data-dir=<full path to directory from step 1> start
3. Run this command to get the environment variables for the endpoint to hit for the emulator:
     
gcloud beta emulators pubsub --data-dir=<full path to directory from step 1> env-init
4. Run your clients with these environment variables set. You can also use the localhost:<port> address to reach the emulator that you started.

I hope that helps!

Kamal

On Mon, Mar 21, 2016 at 9:32 AM 'Nick' via Google Cloud Pub/Sub Discussions <cloud-pubs...@googlegroups.com> wrote:
Hey Alexander,

PubSub, being a cloud service, is not really available as an "offline emulation". It would be up to you to develop the code which could emulate the service and interact with the development server code. 

As for a clear manual explaining how PubSub works, there's no better reference than the official documentation.


On Monday, March 14, 2016 at 7:12:36 AM UTC-4, Alexander Potapov wrote:
Hello there!

Trying to run emulation for PubSub service. There is no clear manual explaining how it works.
Can I work offline with this emulation at all?

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.

aleksandr...@snowcatgroup.com

unread,
Apr 13, 2016, 10:21:18 AM4/13/16
to Google Cloud Pub/Sub Discussions, pay...@google.com
Hi Kamal,
I have some problem with local Pub/Sub. From point 1 to 3 everything is working, but it's not clear how to do point 4. 
I have set Environment variables in Intellij Idea to "PUBSUB_EMULATOR_HOST=localhost:8278", but publisher is sending data to cloud, not to local service. 

Please advise on the matter
Thank you. 

Best regards
Aleksandr

понедельник, 21 марта 2016 г., 16:40:02 UTC+2 пользователь Kamal Aboul-Hosn написал:
4. Run your clients with these environment variables set. You can also use the localhost:<port> address to reach the emulator that you started.

I hope that helps!

Kamal

On Mon, Mar 21, 2016 at 9:32 AM 'Nick' via Google Cloud Pub/Sub Discussions <cloud-pubs...@googlegroups.com> wrote:
Hey Alexander,

PubSub, being a cloud service, is not really available as an "offline emulation". It would be up to you to develop the code which could emulate the service and interact with the development server code. 

As for a clear manual explaining how PubSub works, there's no better reference than the official documentation.


On Monday, March 14, 2016 at 7:12:36 AM UTC-4, Alexander Potapov wrote:
Hello there!

Trying to run emulation for PubSub service. There is no clear manual explaining how it works.
Can I work offline with this emulation at all?

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.

Douglas Boyle

unread,
Jun 20, 2016, 2:48:58 PM6/20/16
to Google Cloud Pub/Sub Discussions, pay...@google.com
Hey Aleksandr,

I am also running into similar issues.  Did you ever resolve what was going on?

Best,
Douglas

Douglas Boyle

unread,
Jun 20, 2016, 3:34:33 PM6/20/16
to Google Cloud Pub/Sub Discussions, pay...@google.com
Nvm, setRootUrl("http://localhost:PORT") should do it
Reply all
Reply to author
Forward
0 new messages