Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Robin Trietsch
    @robintrietsch_gitlab
    Welcome to our Gitter. Feel free to ask questions regarding Stream Machine, we're happy to help out!
    Pim Nauts
    @astronauts_gitlab
    Hey! I was wondering if you have a python example I can use to quickly get started with a stream for my Python app?
    Robin Trietsch
    @robintrietsch_gitlab
    @astronauts_gitlab we're working on examples and the release of the Python client. We hope to release it soon.
    Pim Nauts
    @astronauts_gitlab
    I see it's there now, awesome! Thank you! https://pypi.org/project/streammachine-driver/0.0.1/
    1 reply
    F it, my team member rewrote everything to Java overnight! Would you happen to have a Java driver as well?
    1 reply
    Anne Schuth
    @anneschuth
    Hi! trying out the python client, and running into an issue at initialization of the StreamMachineClient when following the Quickstart:
    In [1]: from streammachine.driver import StreamMachineClient
       ...:
    
    In [2]: client = StreamMachineClient("anne.schuth", "e4e2iwr7k0hu393lfiwz2gnc2m1wk6", "******************************")
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-2-4492438d88c4> in <module>
    ----> 1 client = StreamMachineClient("anne.schuth", "e4e2iwr7k0hu393lfiwz2gnc2m1wk6", "******************************")
    
    TypeError: __init__() missing 1 required positional argument: 'config'
    what's the correct way to initialize the StreamMachineClient?
    Robin Trietsch
    @robintrietsch_gitlab
    Hi @anneschuth, thanks for trying out Stream Machine! Could you please let me know the version of the Python driver that you're using?
    Anne Schuth
    @anneschuth
    ➜  ~ pip freeze | grep streammachine
    streammachine-avro==0.0.1
    streammachine-driver==0.0.9
    streammachine-schemas-catalog-clickstream-avro==0.0.3
    streammachine-schemas-common==0.0.3
    Robin Trietsch
    @robintrietsch_gitlab

    Have a look at this line in the example on Github: https://github.com/streammachineio/python-examples/blob/master/examples/sender.py#L22

    You're missing the ClientConfig. You can initialize the ClientConfig as follows: ClientConfig(), which will use all default values.

    Anne Schuth
    @anneschuth
    Robin Trietsch
    @robintrietsch_gitlab
    Yes, we'll do that, thanks for the tip :) This page: https://docs.streammachine.io/docs/0.1.0/quickstart/full-example.html is better, as it includes the full examples and has the same content as the Github examples.
    Robin Trietsch
    @robintrietsch_gitlab
    @anneschuth your current stream is not working, due to an issue in naming. Nothing you can do about that, we're fixing it at the moment. The . in your billing id, is causing an issue with the decrypter job is running for your stream.
    We'll let you know when you can try sending data. Sorry for the inconvenience.
    Anne Schuth
    @anneschuth
    Ah, came here to say things were broken :)
    thanks, will wait for you to tell me to try again
    Anne Schuth
    @anneschuth
    Looked like you'd stripped . from my billing_id (at least, the topic name doesn't contain it anymore). I'm now getting this error:
    In [8]: client = StreamMachineClient("anne.schuth", "6f9j2xysgwiec6pwgrzjpeqxd0q55d", "******************************", ClientConfig())
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-8-96a037c09203> in <module>
    ----> 1 client = StreamMachineClient("anne.schuth", "6f9j2xysgwiec6pwgrzjpeqxd0q55d", "******************************", ClientConfig())
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/client/client.py in __init__(self, billing_id, client_id, client_secret, config)
         19         :param config: internal configuration (only change if instructed)
         20         """
    ---> 21         self._sender_service = SenderService(billing_id, client_id, client_secret, config)
         22         self._receiver_service = ReceiverService(billing_id, client_id, client_secret, config)
         23
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/client/sender.py in __init__(self, billing_id, client_id, client_secret, config)
         10         self._logger = config.get_logger(__name__)
         11
    ---> 12         self.auth_service = AuthService(
         13             purpose=self.__class__.__name__,
         14             billing_id=billing_id,
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/client/auth.py in __init__(self, purpose, billing_id, client_id, client_secret, config)
         31
         32         self.auth_provider: AuthProvider = None
    ---> 33         self.timer_task = TimerTask(self._initialize_auth_provider, config.sts_refresh_interval)
         34
         35     async def start(self):
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/util/__init__.py in __init__(self, method, time_in_seconds)
         21         self._task = None
         22
    ---> 23         self.method()
         24
         25     async def start(self):
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/client/auth.py in _initialize_auth_provider(self)
         76         if self.auth_provider is None:
         77             self._logger.debug(f"Initializing a new Auth Provider for {self._purpose}")
    ---> 78             self._authenticate(self._billing_id, self._client_id, self._client_secret)
         79         elif self.auth_provider.is_almost_expired():
         80             self._logger.debug(f"Refreshing an existing Auth Provider {self._purpose}")
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/client/auth.py in _authenticate(self, billing_id, client_id, client_secret)
         43         try:
         44             payload = AuthRequest(billing_id, client_id, client_secret)
    ---> 45             self._do_post(self._config.sts_auth_uri, payload)
         46         except HTTPError as e:
         47             self._logger.error(
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/client/auth.py in _do_post(self, uri, payload)
         65         try:
         66             response = requests.post(uri, headers=AuthService._headers, data=payload.to_json())
    ---> 67             self.auth_provider = AuthProvider.from_json(response.json())
         68         except HTTPError as e:
         69             self._logger.error(e)
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/client/auth.py in from_json(json_dict)
         92     @staticmethod
         93     def from_json(json_dict: dict) -> 'AuthProvider':
    ---> 94         return JsonSerializable._from_json(json_dict, AuthProvider)
         95
         96     def is_almost_expired(self):
    
    ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/streammachine/driver/domain/base.py in _from_json(json_dict, clazz)
          6     @staticmethod
          7     def _from_json(json_dict: Dict, clazz):
    ----> 8         return clazz(**JsonSerializable._to_snake_case(json_dict))
          9
         10     def to_json(self):
    TypeError: __init__() got an unexpected keyword argument 'error'
    Bart van Deenen
    @bartvandeenen_gitlab
    Hi @anneschuth
    Our bug was compounded for you by some over-enthousiastic database modification!
    We currently need the email of the user to not contain a period before the @
    We need to remove your anne.schuth account, and we will asap implement a fix. If you want to continue playing you need an email address without a period before the @
    Anne Schuth
    @anneschuth
    I see :) please go ahead and remove me, I'll sign up without a .
    Bart van Deenen
    @bartvandeenen_gitlab
    Thanks, and we'll let you know when we have the period fix
    Robin Trietsch
    @robintrietsch_gitlab
    Hey @anneschuth, the issue with the . has been fixed on our side, and it cannot occur again. Make sure to delete the site data and create a new account (if you want, it can be the same email address you originally used; your original account has been deleted).
    Robin Trietsch
    @robintrietsch_gitlab
    Furthermore, the mismatch between the documentation and the examples for Python also has been updated. Thanks again for your feedback.
    Anne Schuth
    @anneschuth
    Great, thanks for the fast response! Im away for a long weekend, I'll have a look on Monday.
    Bert Jan Schrijver
    @bertjan
    hi all!
    Robin Trietsch
    @robintrietsch_gitlab
    Welcome @bertjan!
    Bert Jan Schrijver
    @bertjan
    Question about the Java getting started guide - what should I use for ${streammachine.java-driver.version} and ${streammachine.schemas.clickstream.version} ?
    Robin Trietsch
    @robintrietsch_gitlab
    Good question, you can use the latest versions, which can be found at https://search.maven.org/search?q=io.streammachine. For now, all latest versions are 0.0.1
    Bert Jan Schrijver
    @bertjan
    I just returned from that site ;-) it could save some time if this is in the docs/getting started guide
    Robin Trietsch
    @robintrietsch_gitlab
    Yes, valid point, we'll update the documentation.
    Bert Jan Schrijver
    @bertjan
    Looks like the maven dependencies are compiled with Java 14? Guess I need to get me a JDK 14 ;-) (it won't work with JDK11)
    Robin Trietsch
    @robintrietsch_gitlab
    That's correct. We also plan to support JDK 11, but they're indeed compiled with Java 14.
    Bert Jan Schrijver
    @bertjan
    alright, I'll jump to 15
    Bert Jan Schrijver
    @bertjan
    OK, I've tried out the examples on https://docs.streammachine.io/docs/0.1.0/quickstart/full-example.html. I'm able to publish events (HTTP 204 is returned) but I'm not seeing any events when I try to receive them using client.startReceivingSse() - any ideas?
    The isAlive check succeeds: (GET https://out.strm.services/is-alive) 200
    Bart van Deenen
    @bartvandeenen_gitlab
    Hi Bert Jan
    Did you have a look at the blog post on dev.to. Let me get the link.
    Anyway, we're running into some buffering within our stack with server-sent events.
    Just sent a few and you should start getting data.
    Bert Jan Schrijver
    @bertjan
    yes, got it, probably I wasn't patient enough ;-)
    The websocket interface which doesn't have these issues will be operational in a few days.
    Bert Jan Schrijver
    @bertjan
    I've followed the Java getting started, looks like it does about the same as the python version in the dev.to post
    Bart van Deenen
    @bartvandeenen_gitlab
    true