Comments (8)
Yes, we've had good experience with it. My team runs it in production. I assume cjab
, the maintainer, is being conservative in his description of the library. Once we have batching and StreamingPull working then it will be closer to being a full-featured 1.0 release.
from kane.
To get this to work, I had to include /v1 in the kane endpoint. Here's my config:
config :goth, json: {:system, "GCP_CREDENTIALS"}
config :kane, :endpoint, "http://#{System.get_env("PUBSUB_EMULATOR_HOST")}/v1"
(For anyone curious, I collapsed my credentials.json file to 1 line, and exported it in GCP_CREDENTIALS)
from kane.
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"
from kane.
@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.
from kane.
@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 PubSub.Emulator.detect()
in by Application.start/2
callback function and 1) it Just Worksβ’οΈ , and I get a nice little log Using pubsub emulator
to confirm this is activated.
from kane.
@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 ).
See Weddell. Once Batching (cjab/weddell#14) and StreamingPull (cjab/weddell#15) are added to Weddell it will support the low-latency, point-to-point messaging needs I have.
from kane.
Yeah I looked at Weddell quite a bit, but that statement worries me:
If the beta/experimental status of Weddell worries you Kane may be a better choice.
You've had good experience with it? Is it running in production?
from kane.
Awesome, thanks for the status! Will start to switch our code very soon π
from kane.
Related Issues (12)
- Add ability to stream messages HOT 2
- GenServer.call(Goth.Config, {:get, "project_id"}, 5000) HOT 2
- Allow :system tuple for endpoint config
- Incorrect example in README HOT 2
- LICENSE file? HOT 1
- Skipping goth auth with PUBSUB_EMULATOR_HOST HOT 1
- List all topics using pagination HOT 1
- Switch to using protocol buffers instead of JSON
- 1.0.0 is not tagged
- Switch to gRPC API HOT 8
- Option to wait and not return immediately on pull HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kane.