I'm looking for a way to have a shared cache across two servers and I am investigating using Redis as an object-store-caching-strategy but I am encountering a problem when reading stored values.
It successfully stores a value when the cache hit is a miss value but throws an error when retrieving the value.
The required object/property "muleContext" is null
At a guess it seems like the object-store-caching-strategy might need an object store that implements the MuleContextAware interface.
Does anyone know if this is correct or how to resolve this issue?
Here is the example flow
<mule xmlns:redis="http://www.mulesoft.org/schema/mule/redis" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/redis http://www.mulesoft.org/schema/mule/redis/3.4/mule-redis.xsd">
<redis:config name="Redis" doc:name="Redis" defaultPartitionName="test" />
<ee:object-store-caching-strategy name="Redis_Caching_Strategy" doc:name="Caching Strategy">
<spring-object-store ref="Redis" />
</ee:object-store-caching-strategy>
<flow name="htmlCacheRedisFlow" doc:name="htmlCacheRedisFlow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8084" path="cacheRedis" doc:name="HTTP"/>
<expression-transformer expression="#[payload.substring(payload.lastIndexOf('/') + 1)]" doc:name="Expression"/>
<ee:cache doc:name="Cache" cachingStrategy-ref="Redis_Caching_Strategy" >
<logger message="getting item from db for key #[payload]" level="INFO" doc:name="Logger"/>
<expression-transformer expression="#[payload + 'asd']" doc:name="Expression"/>
</ee:cache>
</flow>
</mule>