Skip to content
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

Resolving / Disabling connection adaptor with in Local Test #17

Open
psriramula opened this issue Apr 2, 2019 · 1 comment
Open

Resolving / Disabling connection adaptor with in Local Test #17

psriramula opened this issue Apr 2, 2019 · 1 comment

Comments

@psriramula
Copy link

psriramula commented Apr 2, 2019

Dear DowJones Team,

I am working with a project where we consuming data from Dowjones using Listner along with a Mock Dowjones server ( created using google pub sub ).

Facing a connection issue with in listen method ( https://github.com/dowjones/dj-dna-streams-python/blob/master/dnaStreaming/listener.py#L60-L96)

Please suggest a way to get around the streaming-creditials , Please advise how to get around this or any Mock Servers you have for dowjones service which we can use for our load testing purpose.

where my python script calling

listener.listen(callback, subscription_id=subscription_id, maximum_messages=100)

And I setup the Lister some thing like below
listener = Listener(user_key=api_key) # if ENV == 'perf' or 'local': listener.config.DEFAULT_HOST = os.getenv('MOCK_DJ_HOST')

and I am passing MOCK_DJ_HOST connection details from a docker-compose via environmen t

- PUBSUB_EMULATOR_HOST=mock-dowjones:8085

listener.listen(callback, subscription_id=subscription_id, maximum_messages=100) dowjones | File "/app/listener.py", line 61, in listen dowjones | pubsub_client = pubsub_service.get_client(self.config) dowjones | File "/usr/local/lib/python3.6/site-packages/dnaStreaming/services/pubsub_service.py", line 10, in get_client dowjones | streaming_credentials = credentials_service.fetch_credentials(config) dowjones | File "/usr/local/lib/python3.6/site-packages/dnaStreaming/services/credentials_service.py", line 9, in fetch_credentials dowjones | headers=config.get_headers()) dowjones | File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 75, in get dowjones | return request('get', url, params=params, **kwargs) dowjones | File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 60, in request dowjones | return session.request(method=method, url=url, **kwargs) dowjones | File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request dowjones | resp = self.send(prep, **send_kwargs) dowjones | File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 640, in send dowjones | adapter = self.get_adapter(url=request.url) dowjones | File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 731, in get_adapter dowjones | raise InvalidSchema("No connection adapters were found for '%s'" % url) dowjones | requests.exceptions.InvalidSchema: No connection adapters were found for 'mock-dowjones:8085/alpha/accounts/streaming-credentials'

@psriramula
Copy link
Author

for your information my mock-dowjones is a googlepubsub docker container
FROM google/cloud-sdk:alpine RUN apk add --no-cache openjdk7-jre RUN gcloud components install beta pubsub-emulator --quiet RUN gcloud components update --quiet RUN mkdir -p /tmp/emulators/pubsub VOLUME /tmp/emulators/pubsub EXPOSE 8085 CMD ["gcloud", "beta", "emulators", "pubsub", "start", "--data-dir", "/tmp/emulators/pubsub", "--host-port", "0.0.0.0:8085", "--verbosity", "info", "--quiet"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant