MicroStrategy / mstrio-py

Python integration for MicroStrategy
Apache License 2.0
89 stars 59 forks source link

Connection on specific node #137

Closed ismailmuller closed 1 year ago

ismailmuller commented 1 year ago

Is it possible to create the Connection object on a specific node ? Alternatively, how can we retrieve the exact session_id for the Connection ?

Context: In a clustered environment, the API's base_url is not necessarily the one where the user session is created. Therefore, it's necessary in our case to ensure that a user Connection is made on a specific node, since it defines where the cubes caches are filed.

Tested Workaround: We've tried using the UserConnections(connection).list_connections(nodes="target_node") as a workaround function but we didn't find out how to actually ensure the session_id match in the case where multiple connections are made with the same username.

mstrpr commented 1 year ago

Hi @ismailmuller, from the perspective of the end user, the nodes on which a session are created are abstracted. If you want to direct a user connection to a specific node, you need to use a load balancer with sticky sessions enabled.