Getting transient resources null while using caching for saga repo. AXON Framework Version 2.4.6


I am new to Axon Framework. And we are using axon framework version 2.4.6. We are planning to upgrade latest Axon Framework after February.

I want to advice on or below problem:

I am using caching with saga. And while getting the saga from caching repo, its transient resources are coming as null.

We are following all the instructions from axon framework documentation.

Deepak Gupta

Hi Deepak,

the CachingSagaRepository in Axon 2 assumes that Sagas are cached in-memory, and therefore retain the contents of transient fields. Given that they are null in your case makes me assume that this isn’t the case for you. Note that reading the Saga from a database is probably just as efficient as reading it from a serialized cache.
If you do see an improvement in using the cache, you can work around this issue by using the ResourceInjector (the one also used by your SagaRepository) to inject resources in your Saga.



Thanks Allard, it helped me in resolving the issue.

Deepak Gupta