Channel Map
This map is isolated to the current message as it processes through a channel. If you store a connector map variable in the source connector, you will have access to that value in all subsequent destinations. However when the current message finishes and the next one begins, that next message will not have access to the value you stored for the previous message.
The channel map is useful for anything that needs to be shared among multiple destinations, or the source connector and all destinations. For example, you might have one HTTP Sender destination that makes a request to a remote service, and then in the Response Transformer you store a particular response HTTP header in the channel map. As long as the next destination connector is in the same chain, it will have access to that channel map variable, and can do something else with it, like include it on a subsequent HTTP request.
- Get channel map value:
- var value = channelMap.get('key');
- var value = $c('key');
- Put channel map value:
- channelMap.put('key', 'value');
- $c('key', 'value');