-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage locally against GCP PubSub emulator #15
Comments
After digging a bit more it seems like the following is possible; config :kane,
token: Goth.Token,
endpoint: "http://127.0.0.1:8085"
config :goth,
json: nil,
project_id: "foo" |
To get this to work, I had to include /v1 in the kane endpoint. Here's my config:
(For anyone curious, I collapsed my credentials.json file to 1 line, and exported it in GCP_CREDENTIALS) |
@jeffdeville Did you have to use valid GCP credentials in order to get this to work? If so, can you provide an explanation or example? Trying all the methods you and the author suggested brings me to Could not retrieve token invalid_grant errors from Goth. |
@medikent you don't need working credentials to talk to pubsub emulator. Here's what I did to make all of that work: defmodule PubSub.Emulator do
@moduledoc """
Provide fake tokens when running with PubSub emulator
"""
def for_scope(_) do
{:ok, %{type: "Bearer", token: "dummy"}}
end
def detect() do
emulator_host = System.get_env("PUBSUB_EMULATOR_HOST")
unless is_nil(emulator_host) do
Application.put_env(:kane, :token, PubSub.Emulator)
Application.put_env(:kane, :endpoint, "http://#{emulator_host}/v1")
Logger.info("Using pubsub emulator")
end
end
end So I just add the line |
@matehat Thanks for the update. I ended up going with Weddell to take advantage of gRPC. The gRPC API provides lower tail latency (see this ). |
Yeah I looked at Weddell quite a bit, but that statement worries me:
You've had good experience with it? Is it running in production? |
Yes, we've had good experience with it. My team runs it in production. I assume |
Awesome, thanks for the status! Will start to switch our code very soon 😃 |
I would like to be able to develop locally and have Kane use the GCP PubSub emulator (
gcloud beta emulators pubsub start
) endpoint.This seems like something I could set up via the following config;
...which seems to work OK, however I’m stuck with errors coming out of Goth.
I’m wondering if this restriction is intentional or just an oversight?
The text was updated successfully, but these errors were encountered: