initialstate / python_appender

Python implementation of the Initial State events api to easily send data via a super simple python api
https://www.initialstate.com/streaming
MIT License
39 stars 9 forks source link

SessionID #1

Closed louisza closed 9 years ago

louisza commented 9 years ago

self.SessionId = str(uuid.uuid4()) in streamer.py

I am certainly no good at Python, so please take that in consideration:

Writing to the same bucket is possible (according to a recent webinar) if you use the same SessionId. Looking at the code, it seems like specifying a SessionId will be pointless as the code just generates a new one...

davidsulpy commented 9 years ago

@louisza That's correct, you can force the same sessionId to the api to ensure the data goes to the same bucket. The currently released ISStreamer does not allow for this setting without code modification. However, in the upcoming release this will be added. There are many things coming from the dev branch and with that new ISStreamer release will be a final draft of the REST api with included documentation.

The ISStreamer is generating a UUID specifically so that a user doesn't have to ensure their sessionId is unique, it was implemented this way for simplicity. But, keep a watch for release 0.0.25 as it will have this as optional in the ISStreamer as well.

Thanks for your comments and participation!

Cheers, David

davidsulpy commented 9 years ago

@louisza I'm excited to let you know that version 0.0.25 was officially released and should fix your issue completely!

Now, all you have to do is specify the same bucket_key in the constructor of the Streamer like this:

streamer = Streamer(bucket_name="louisza's bucket", bucket_key="reference_key", access_key="[AccessKey]")

I'm going to close this enhancement as finished. But feel free to reach out if you have any more questions!

Thanks, David