Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
High Availability and Application Authentication (Circle of Trust)

Hi,
I am working on high availability for my Symphony bots. We have 4 backend bot instances running behind a Round robin loadbalancer.

I read the documentation for the circle of trust and we suspect that the failed call to get the tokens is coming from the fact that we store the tokens (Ta/Ts) locally instead of having them in a common place between all backends bots running (in our case that would be a database for example) . Is there something already done to solve this issue or is this limitation by design?

And Here is a small screenshot of the error returned:
image-appauth.png

  
  
Posted 2 years ago
Votes Newest

Answers


Hi Imad,
This is due to the /tokens endpoint calling the validateTokens method, which searches the tokensRepository for the requested appToken and checks if it matches the value of the symphonyToken.
https://github.com/finos/symphony-bdk-java/blob/main/symphony-bdk-core/src/main/java/com/symphony/bdk/core/auth/impl/AbstractExtensionAppAuthenticator.java#L48-L49

The default implementation of the tokensRepository uses an InMemoryTokensRepository, so by running multiple instances round robin, one instance would store the token in that in-memory repository and another instance would not be able to fetch it.
https://github.com/finos/symphony-bdk-java/blob/main/symphony-bdk-spring/symphony-bdk-core-spring-boot-starter/src/main/java/com/symphony/bdk/spring/config/BdkCoreConfig.java#L95-L99

That default implementation is exposed as a bean but with @ConditionalOnMissingBean, so all you need to do is provide your own ExtensionAppTokensRepository bean that reads and writes to a shared location between your instances - could be something permanent like your postgres or even a redis cache.
https://github.com/finos/symphony-bdk-java/blob/main/symphony-bdk-core/src/main/java/com/symphony/bdk/core/auth/ExtensionAppTokensRepository.java

  
  
Posted 2 years ago
Vinay Mistry
23 × 2 Administrator