I am new to jboss infinispan caching and I have some special requirement for our work as part of jboss infinispan caching.Would be of great help if there are some pointers/ help on my queries.
Our application makes a call to system1 to fetch some inventory details. This call will fetch the inventories from system 2 for a particular enterprise.
System1 is just an intermediate system, which will just retrieve the details from system2 and provide the required inventories back to our application.
We use Infinispan cache for storing the objects as part of this call in the form of hashmap (Key Value)
Sample example of how it is stored on cache as key value pair:
ServiceId1~IQNET --> InventoryObject1
ServiceId2~PL --> InventoryObject2
For another flow, since it is required to have additional information for an enterprise, it is required to call system2 directly from our application. For this, when we get a response from system2, for caching this information we need to store it in the form of a key value pair as we had for the above case.
Unfortunately, the serviceId returned from system 1 and 2 are the same, as the end system is system2.
In order to store this information on Infinispan cache, we need to come up with a design which does not override the existing cache being maintained as part of flow1, as the serviceId will be same on flow 1 and flow 2. So we need a mechanism to identify uniquely that the caching is done for flow1 using system1 or flow2 using system2.
One approach is : we can append the source system like say:
ServiceId1~IQNET~system1 --> InventoryObject1
ServiceId1~IQNET~system2 --> InventoryObject2
This will consume huge memory as there are lakhs of product associated with the serviceId.
We need to come up with a best approach which will cater to both the flows using a single hash map(key value). Any inputs in this regard would be of great help!