public CachingContext(IConsumingContext <T> context, CacheConfiguration cacheConfiguration) { this.context = context; this.cacheConfiguration = cacheConfiguration; }
public CachingConsumerOf(IConsumerOf <T> consumer, CacheConfiguration cacheConfiguration) { this.consumer = consumer; this.cacheConfiguration = cacheConfiguration; }
private static MessageExchange TryCacheResponse(MessageExchange processedExchange, CacheConfiguration config) { if (!processedExchange.IsCompleteRequest) { return(processedExchange); } var ttl = GetTtl(config, processedExchange); if (ttl != null) { config.Cache.Set(processedExchange.Out, processedExchange.In.Payload, ttl.Value); } return(processedExchange); }