Suggestions where to store data in shared process engine

Hi,

we need to store some data (actually session-id/auth-token for web-services). This data has to be accessed by multiple different process-instances within a shared process engine.

Currently every process-instance logs into the web-service and get their own session. But the API we are accessing is only allowing a limited number of concurrent users. Doing login/request/logout in every taks is cumbersome, and even if logging out every time we can only have a limited amount of process-instances accessing the webservice concurrently. And we are not talking about 100s but less then 10 :frowning:

Re-Using the sessions would be the best solution - but where to store it ?

In theory it would work like this

Some service-task tries to access the webservice. It looks for a session-id/token in a central store. If none exists -> log in and store the token in the-central store. If one exists the validity has to be checked (expiration, etc.) and if it is invalid it has to be refreshed

It could also be possible to have a recurring process that refresh the session every xxx time-unit.

It should be possible to use a KV-Store like REDIS o consul for it, but maybe there is a chance to store it within camunda ?

Any suggestions ?

Thanks a lot
Carsten

Do you care if the session tokens are stored as process variables / not secured ?

Few topics we have addressed on this before:

Redis access: Storing process variables: Json (Spin) vs. String / what are the impacts?

Vault: Http-connector authentication? + Secret storage?

Using vertx so you can have all sorts of other shared apps running (verticles) without touching camunda core: https://github.com/StephenOTT/camunda-vertx-plugin

Another quick easy way to do your shared space is to create a plugin that creates a static class with setters and getters. And you basically create a little in memory storage or those keys. You can then access them easily through scripts (like in a input variable of http connector). actually prob would cause issues in your case when you make a update to the sessions: https://stackoverflow.com/questions/4934913/are-static-variables-shared-between-threads

1 Like