Class DistributedCacher

All Implemented Interfaces:
MetricConstants, MoleculerLifecycle
Direct Known Subclasses:
JCacheCacher, RedisCacher

public abstract class DistributedCacher extends Cacher
Abstract class of distributed cachers. Currently the RedisCacher and the certain types of the JCacheCacher can be distributed (without special development).
See Also:
  • Field Details

  • Constructor Details

    • DistributedCacher

      public DistributedCacher()
    • DistributedCacher

      public DistributedCacher(int maxKeyLength)
  • Method Details

    • getCacheKey

      public String getCacheKey(String name, io.datatree.Tree params, String... keys)
      Creates a cacher-specific key by name and params. Concatenates the name and params.
      Overrides:
      getCacheKey in class Cacher
      Parameters:
      name - action name
      params - input (JSON) structure
      keys - keys in the "params" structure (optional)
      Returns:
      generated cache key String
    • getMaxParamsLength

      public int getMaxParamsLength()
    • setMaxParamsLength

      public void setMaxParamsLength(int maxParamsLength)