0

Can someone tell me how to implement Clustered Cache Sharing between two micro-services using terracota server any reference projects would be great to start with

eh-cache.xml

ehcache xml : <?xml version="1.0" encoding="UTF-8"?>

<ehcache:config`enter code here`
  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
  xmlns:terracotta='http://www.ehcache.org/v3/clustered'
  xmlns:ehcache='http://www.ehcache.org/v3'
  xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.8.xsd
    http://www.ehcache.org/v3/clustered http://www.ehcache.org/schema/ehcache-clustered-ext-3.8.xsd">

  <ehcache:service>
    <terracotta:cluster>
      <terracotta:connection url="terracotta://localhost:9410/clustered"/>
      <terracotta:server-side-config auto-create="true">
          <!--<terracotta:default-resource from="default-resource"/>-->
          <terracotta:shared-pool name="shared-pool-expense" unit="MB">100</terracotta:shared-pool>
      </terracotta:server-side-config>
    </terracotta:cluster>
 </ehcache:service>


  <ehcache:cache alias="areaOfCircleCache">
    <ehcache:key-type>java.lang.String</ehcache:key-type>
    <ehcache:value-type>com.db.entity.LogMessage</ehcache:value-type>
    <ehcache:resources>
      <!--      <ehcache:heap unit="entries">100</ehcache:heap>
       <ehcache:offheap unit="MB">10</ehcache:offheap>-->
      <terracotta:clustered-dedicated unit="MB">10</terracotta:clustered-dedicated>
    </ehcache:resources>
  </ehcache:cache>
</ehcache:config>
  • Does this answer your question? [Cache Sharing between two micro-services using terracota](https://stackoverflow.com/questions/61999920/cache-sharing-between-two-micro-services-using-terracota) – Joe May 26 '20 at 07:46
  • @joe: its doesnot answer the question – Sriranjani Sriraman May 31 '20 at 14:22

1 Answers1

0

This question is quite large. I would recommend starting with the documentation and then asking specific questions if there are things you cannot figure out.

Louis Jacomet
  • 13,661
  • 2
  • 34
  • 43
  • To be more specific, i installed the ehcache 3.8 clustered kit and i could able to successfully start the server. I get the following output when i started the server...... """... Terracotta Server instance has started up as ACTIVE node on 0:0:0:0:0:0:0:0:9410 successfully, and is now ready for work. """.... I am trying from a spring boot application to connect to the terracotta server but i don't see any messages on the server console.. i started the server using the batch file "start-tc-server.bat" which is available as part of clustered kit – Sriranjani Sriraman May 31 '20 at 14:15
  • I have updated my above question with ehcache.xml which i have used. – Sriranjani Sriraman May 31 '20 at 14:22