Sending/Receiving Messages to/from the cache - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

Message Headers

Header

Description

CamelCacheOperation

The operation to be performed on the cache. These headers are removed from the exchange after the cache operation is performed. Valid options are

  • CamelCacheGet

  • CamelCacheCheck

  • CamelCacheAdd

  • CamelCacheUpdate

  • CamelCacheDelete

  • CamelCacheDeleteAll

CamelCacheKey

The cache key used to store the Message in the cache. The cache key is optional if the CamelCacheOperation is CamelCacheDeleteAll.

Starting with Camel 2.11, the CamelCacheAdd and CamelCacheUpdate operations support additional headers:

Header

Type

Description

CamelCacheTimeToLive

Integer

Time to live in seconds

CamelCacheTimeToIdle

Integer

Time to idle in seconds

CamelCacheEternal

Integer

Whether the content is eternal

The CamelCacheAdd and CamelCacheUpdate operations support additional headers:

Header

Type

Description

CamelCacheTimeToLive

IntegerCamel 2.11: Time to live in seconds.

CamelCacheTimeToIdle

IntegerCamel 2.11: Time to idle in seconds.

CamelCacheEternal

IntegerCamel 2.11: Whether the content is eternal.

Cache Producer

Sending data to the cache involves the ability to direct payloads in exchanges to be stored in a pre-existing or created-on-demand cache. The mechanics of doing this involve

  • setting the Message Exchange Headers shown above.

  • ensuring that the Message Exchange Body contains the message directed to the cache

Cache Consumer

Receiving data from the cache involves the ability of the CacheConsumer to listen on a pre-existing or created-on-demand Cache using an event Listener and receive automatic notifications when any cache activity take place (i.e., Add, Update, Delete, or DeleteAll). Upon such an activity taking place

  • an exchange containing Message Exchange Headers and a Message Exchange Body containing the just added/updated payload is placed and sent.

  • in case of a CamelCacheDeleteAll operation, the Message Exchange Header CamelCacheKey and the Message Exchange Body are not populated.

Cache Processors

There are a set of nice processors with the ability to perform cache lookups and selectively replace payload content at the

  • body

  • token

  • xpath level