Package org.apache.camel.support
Class ExchangeHelper
java.lang.Object
org.apache.camel.support.ExchangeHelper
Some helper methods for working with
Exchange
objects-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
convertToMandatoryType
(org.apache.camel.Exchange exchange, Class<T> type, Object value) Converts the value to the given expected type or throws an exceptionstatic <T> T
convertToType
(org.apache.camel.Exchange exchange, Class<T> type, Object value) Converts the value to the given expected typestatic org.apache.camel.Exchange
copyExchangeWithProperties
(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext context) Copies the exchange but the copy will be tied to the given contextstatic void
copyResults
(org.apache.camel.Exchange target, org.apache.camel.Exchange source) Copies the results of a message exchange from the source exchange to the result exchange which will copy the message contents, exchange properties and the exception.static void
copyResultsPreservePattern
(org.apache.camel.Exchange target, org.apache.camel.Exchange source) Copies thesource
exchange totarget
exchange preserving theExchangePattern
oftarget
.static org.apache.camel.Exchange
createCopy
(org.apache.camel.Exchange exchange, boolean preserveExchangeId) Creates a new instance and copies from the current message exchange so that it can be forwarded to another destination as a new instance.static org.apache.camel.Exchange
createCorrelatedCopy
(org.apache.camel.Exchange exchange, boolean handover) Creates a new instance and copies from the current message exchange so that it can be forwarded to another destination as a new instance.static org.apache.camel.Exchange
createCorrelatedCopy
(org.apache.camel.Exchange exchange, boolean handover, boolean useSameMessageId) Creates a new instance and copies from the current message exchange so that it can be forwarded to another destination as a new instance.createVariableMap
(org.apache.camel.Exchange exchange, boolean allowContextMapAll) Creates a Map of the variables which are made available to a script or templatestatic <T> T
extractFutureBody
(org.apache.camel.CamelContext context, Future<?> future, long timeout, TimeUnit unit, Class<T> type) Extracts the body from the given future, that represents a handle to an asynchronous exchange.static <T> T
extractFutureBody
(org.apache.camel.CamelContext context, Future<?> future, Class<T> type) Extracts the body from the given future, that represents a handle to an asynchronous exchange.static Object
extractResultBody
(org.apache.camel.Exchange exchange, org.apache.camel.ExchangePattern pattern) Extracts the body from the given exchange.static String
getAtRouteId
(org.apache.camel.Exchange exchange) static <T> T
getBinding
(org.apache.camel.Exchange exchange, Class<T> type) Extracts the Exchange.BINDING of the given type or null if not presentstatic Charset
getCharset
(org.apache.camel.Exchange exchange) static Charset
getCharset
(org.apache.camel.Exchange exchange, boolean useDefault) Gets the charset if set as header or propertyExchange.CHARSET_NAME
.static String
getCharsetName
(org.apache.camel.Exchange exchange) static String
getCharsetName
(org.apache.camel.Exchange exchange, boolean useDefault) Gets the charset name if set as header or propertyExchange.CHARSET_NAME
.static String
getContentEncoding
(org.apache.camel.Exchange exchange) Returns the MIME content encoding on the input message or null if one is not definedstatic String
getContentType
(org.apache.camel.Exchange exchange) Returns the MIME content type on the input message or null if one is not definedstatic <T> T
getHeaderOrProperty
(org.apache.camel.Exchange exchange, String name, Class<T> type) Gets an header or property of the correct typestatic <T> T
getMandatoryHeader
(org.apache.camel.Exchange exchange, String headerName, Class<T> type) Gets the mandatory inbound header of the correct typestatic <T> T
getMandatoryHeader
(org.apache.camel.Message message, String headerName, Class<T> type) Gets the mandatory inbound header of the correct typestatic <T> T
getMandatoryProperty
(org.apache.camel.Exchange exchange, String propertyName, Class<T> type) Gets the mandatory property of the exchange of the correct typestatic org.apache.camel.Message
getOriginalInMessage
(org.apache.camel.Exchange exchange) Gets the original INMessage
this Unit of Work was started with.static org.apache.camel.Message
getResultMessage
(org.apache.camel.Exchange exchange) Returns the message where to write results in an exchange-pattern-sensitive way.static org.apache.camel.Route
getRoute
(org.apache.camel.Exchange exchange) static String
getRouteGroup
(org.apache.camel.Exchange exchange) static String
getRouteId
(org.apache.camel.Exchange exchange) static org.apache.camel.util.Scanner
getScanner
(org.apache.camel.Exchange exchange, Object value, String delimiter) Creates aScanner
for scanning the given value.static Object
getVariable
(org.apache.camel.Exchange exchange, String name) Gets the variablestatic <T> T
getVariable
(org.apache.camel.Exchange exchange, String name, Class<T> type) Gets the variable, converted to the given typestatic boolean
isErrorHandlerBridge
(org.apache.camel.Exchange exchange) Checks whether the exchange has been error handler bridgedstatic boolean
isFailureHandled
(org.apache.camel.Exchange exchange) Checks whether the exchange has been failure handedstatic boolean
isOutCapable
(org.apache.camel.Exchange exchange) Returns true if the given exchange pattern (if defined) can support OUT messagesstatic boolean
isRedelivered
(org.apache.camel.Exchange exchange) Checks whether the exchangeUnitOfWork
is redeliveredstatic boolean
isStreamCachingEnabled
(org.apache.camel.Exchange exchange) Check whether or not stream caching is enabled for the given route or globally.static boolean
isUnitOfWorkExhausted
(org.apache.camel.Exchange exchange) Checks whether the exchangeUnitOfWork
is exhaustedstatic String
logIds
(org.apache.camel.Exchange exchange) Gets both the messageId and exchangeId to be used for logging purposes.static Object
lookupBean
(org.apache.camel.Exchange exchange, String name) Performs a lookup in the registry of the bean namestatic <T> T
lookupBean
(org.apache.camel.Exchange exchange, String name, Class<T> type) Performs a lookup in the registry of the bean name and typestatic Object
lookupMandatoryBean
(org.apache.camel.Exchange exchange, String name) Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be foundstatic <T> T
lookupMandatoryBean
(org.apache.camel.Exchange exchange, String name, Class<T> type) Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be foundstatic <T> T
newInstance
(org.apache.camel.Exchange exchange, Class<T> type) Creates a new instance of the given type from the injectorstatic void
populateVariableMap
(org.apache.camel.Exchange exchange, Map<String, Object> map, boolean allowContextMapAll) Populates the Map with the variables which are made available to a script or templatestatic void
prepareAggregation
(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange) Prepares the exchanges for aggregation.static void
prepareOutToIn
(org.apache.camel.Exchange exchange) Strategy to prepare results before next iterator or when we are complete, which is done by copying OUT to IN, so there is only an IN as input for the next iteration.static void
replaceMessage
(org.apache.camel.Exchange exchange, org.apache.camel.Message newMessage, boolean outOnly) Replaces the existing message with the new messagestatic org.apache.camel.Endpoint
resolveEndpoint
(org.apache.camel.CamelContext context, Object value) Attempts to resolve the endpoint for the given valuestatic org.apache.camel.Endpoint
resolveEndpoint
(org.apache.camel.Exchange exchange, Object value) Attempts to resolve the endpoint for the given valuestatic org.apache.camel.Endpoint
resolvePrototypeEndpoint
(org.apache.camel.CamelContext context, Object value) Attempts to resolve the endpoint (prototype scope) for the given valuestatic org.apache.camel.Endpoint
resolvePrototypeEndpoint
(org.apache.camel.Exchange exchange, Object value) Attempts to resolve the endpoint (prototype scope) for the given valuestatic String
resolveScheme
(String uri) Resolve the component scheme (aka name) from the given endpoint uristatic void
setFailureHandled
(org.apache.camel.Exchange exchange) Sets the exchange to be failure handled.static void
setInOutBodyPatternAware
(org.apache.camel.Exchange exchange, Object body) Sets the body in message in the exchange taking the exchange pattern into consideration.static void
setOutBodyPatternAware
(org.apache.camel.Exchange exchange, Object body) Sets the body in message in the exchange taking the exchange pattern into consideration.static void
setVariable
(org.apache.camel.Exchange exchange, String name, Object value) Sets the variablestatic void
setVariableFromMessageBodyAndHeaders
(org.apache.camel.Exchange exchange, String name, org.apache.camel.Message message) Sets the variable from the given message body and headers
-
Method Details
-
getBinding
Extracts the Exchange.BINDING of the given type or null if not present- Parameters:
exchange
- the message exchangetype
- the expected binding type- Returns:
- the binding object of the given type or null if it could not be found or converted
-
resolveEndpoint
public static org.apache.camel.Endpoint resolveEndpoint(org.apache.camel.Exchange exchange, Object value) throws org.apache.camel.NoSuchEndpointException Attempts to resolve the endpoint for the given value- Parameters:
exchange
- the message exchange being processedvalue
- the value which can be anEndpoint
or an object which provides a String representation of an endpoint viaObject.toString()
- Returns:
- the endpoint
- Throws:
org.apache.camel.NoSuchEndpointException
- if the endpoint cannot be resolved
-
resolveEndpoint
public static org.apache.camel.Endpoint resolveEndpoint(org.apache.camel.CamelContext context, Object value) throws org.apache.camel.NoSuchEndpointException Attempts to resolve the endpoint for the given value- Parameters:
context
- the camel contextvalue
- the value which can be anEndpoint
or an object which provides a String representation of an endpoint viaObject.toString()
- Returns:
- the endpoint
- Throws:
org.apache.camel.NoSuchEndpointException
- if the endpoint cannot be resolved
-
resolvePrototypeEndpoint
public static org.apache.camel.Endpoint resolvePrototypeEndpoint(org.apache.camel.Exchange exchange, Object value) throws org.apache.camel.NoSuchEndpointException Attempts to resolve the endpoint (prototype scope) for the given value- Parameters:
exchange
- the message exchange being processedvalue
- the value which can be anEndpoint
or an object which provides a String representation of an endpoint viaObject.toString()
- Returns:
- the endpoint
- Throws:
org.apache.camel.NoSuchEndpointException
- if the endpoint cannot be resolved
-
resolvePrototypeEndpoint
public static org.apache.camel.Endpoint resolvePrototypeEndpoint(org.apache.camel.CamelContext context, Object value) throws org.apache.camel.NoSuchEndpointException Attempts to resolve the endpoint (prototype scope) for the given value- Parameters:
context
- the camel contextvalue
- the value which can be anEndpoint
or an object which provides a String representation of an endpoint viaObject.toString()
- Returns:
- the endpoint
- Throws:
org.apache.camel.NoSuchEndpointException
- if the endpoint cannot be resolved
-
getMandatoryProperty
public static <T> T getMandatoryProperty(org.apache.camel.Exchange exchange, String propertyName, Class<T> type) throws org.apache.camel.NoSuchPropertyException Gets the mandatory property of the exchange of the correct type- Parameters:
exchange
- the exchangepropertyName
- the property nametype
- the type- Returns:
- the property value
- Throws:
org.apache.camel.TypeConversionException
- is thrown if error during type conversionorg.apache.camel.NoSuchPropertyException
- is thrown if no property exists
-
getMandatoryHeader
public static <T> T getMandatoryHeader(org.apache.camel.Exchange exchange, String headerName, Class<T> type) throws org.apache.camel.TypeConversionException, org.apache.camel.NoSuchHeaderException Gets the mandatory inbound header of the correct type- Parameters:
exchange
- the exchangeheaderName
- the header nametype
- the type- Returns:
- the header value
- Throws:
org.apache.camel.TypeConversionException
- is thrown if error during type conversionorg.apache.camel.NoSuchHeaderException
- is thrown if no headers exists
-
getMandatoryHeader
public static <T> T getMandatoryHeader(org.apache.camel.Message message, String headerName, Class<T> type) throws org.apache.camel.TypeConversionException, org.apache.camel.NoSuchHeaderException Gets the mandatory inbound header of the correct type- Parameters:
message
- the messageheaderName
- the header nametype
- the type- Returns:
- the header value
- Throws:
org.apache.camel.TypeConversionException
- is thrown if error during type conversionorg.apache.camel.NoSuchHeaderException
- is thrown if no headers exists
-
getHeaderOrProperty
public static <T> T getHeaderOrProperty(org.apache.camel.Exchange exchange, String name, Class<T> type) throws org.apache.camel.TypeConversionException Gets an header or property of the correct type- Parameters:
exchange
- the exchangename
- the name of the header or the propertytype
- the type- Returns:
- the header or property value
- Throws:
org.apache.camel.TypeConversionException
- is thrown if error during type conversionorg.apache.camel.NoSuchHeaderException
- is thrown if no headers exists
-
convertToMandatoryType
public static <T> T convertToMandatoryType(org.apache.camel.Exchange exchange, Class<T> type, Object value) throws org.apache.camel.TypeConversionException, org.apache.camel.NoTypeConversionAvailableException Converts the value to the given expected type or throws an exception- Returns:
- the converted value
- Throws:
org.apache.camel.TypeConversionException
- is thrown if error during type conversionorg.apache.camel.NoTypeConversionAvailableException
- } if no type converters exists to convert to the given type
-
convertToType
public static <T> T convertToType(org.apache.camel.Exchange exchange, Class<T> type, Object value) throws org.apache.camel.TypeConversionException Converts the value to the given expected type- Returns:
- the converted value
- Throws:
org.apache.camel.TypeConversionException
- is thrown if error during type conversion
-
createCopy
public static org.apache.camel.Exchange createCopy(org.apache.camel.Exchange exchange, boolean preserveExchangeId) Creates a new instance and copies from the current message exchange so that it can be forwarded to another destination as a new instance.- Parameters:
exchange
- original copy of the exchangepreserveExchangeId
- whether or not the exchange id should be preserved- Returns:
- the copy
-
copyResults
public static void copyResults(org.apache.camel.Exchange target, org.apache.camel.Exchange source) Copies the results of a message exchange from the source exchange to the result exchange which will copy the message contents, exchange properties and the exception. Notice theExchangePattern
is not copied/altered.- Parameters:
target
- the target exchange which will have the output and error state added (result)source
- the source exchange which is not modified
-
copyResultsPreservePattern
public static void copyResultsPreservePattern(org.apache.camel.Exchange target, org.apache.camel.Exchange source) Copies thesource
exchange totarget
exchange preserving theExchangePattern
oftarget
.- Parameters:
target
- the target exchange which will have the output and error state added (result)source
- source exchange.
-
getResultMessage
public static org.apache.camel.Message getResultMessage(org.apache.camel.Exchange exchange) Returns the message where to write results in an exchange-pattern-sensitive way.- Parameters:
exchange
- message exchange.- Returns:
- result message.
-
isOutCapable
public static boolean isOutCapable(org.apache.camel.Exchange exchange) Returns true if the given exchange pattern (if defined) can support OUT messages- Parameters:
exchange
- the exchange to interrogate- Returns:
- true if the exchange is defined as an
ExchangePattern
which supports OUT messages
-
newInstance
Creates a new instance of the given type from the injector- Parameters:
exchange
- the exchangetype
- the given type- Returns:
- the created instance of the given type
-
createVariableMap
public static Map<String,Object> createVariableMap(org.apache.camel.Exchange exchange, boolean allowContextMapAll) Creates a Map of the variables which are made available to a script or template- Parameters:
exchange
- the exchange to make availableallowContextMapAll
- whether to allow access to all context map or not (prefer to use false due to security reasons preferred to only allow access to body/headers)- Returns:
- a Map populated with the require variables
-
populateVariableMap
public static void populateVariableMap(org.apache.camel.Exchange exchange, Map<String, Object> map, boolean allowContextMapAll) Populates the Map with the variables which are made available to a script or template- Parameters:
exchange
- the exchange to make availablemap
- the map to populateallowContextMapAll
- whether to allow access to all context map or not (prefer to use false due to security reasons preferred to only allow access to body/headers)
-
getContentType
Returns the MIME content type on the input message or null if one is not defined- Parameters:
exchange
- the exchange- Returns:
- the MIME content type
-
getContentEncoding
Returns the MIME content encoding on the input message or null if one is not defined- Parameters:
exchange
- the exchange- Returns:
- the MIME content encoding
-
lookupMandatoryBean
public static Object lookupMandatoryBean(org.apache.camel.Exchange exchange, String name) throws org.apache.camel.NoSuchBeanException Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found- Parameters:
exchange
- the exchangename
- the bean name- Returns:
- the bean
- Throws:
org.apache.camel.NoSuchBeanException
- if no bean could be found in the registry
-
lookupMandatoryBean
public static <T> T lookupMandatoryBean(org.apache.camel.Exchange exchange, String name, Class<T> type) Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found- Parameters:
exchange
- the exchangename
- the bean nametype
- the expected bean type- Returns:
- the bean
- Throws:
org.apache.camel.NoSuchBeanException
- if no bean could be found in the registry
-
lookupBean
Performs a lookup in the registry of the bean name- Parameters:
exchange
- the exchangename
- the bean name- Returns:
- the bean, or null if no bean could be found
-
lookupBean
Performs a lookup in the registry of the bean name and type- Parameters:
exchange
- the exchangename
- the bean nametype
- the expected bean type- Returns:
- the bean, or null if no bean could be found
-
prepareAggregation
public static void prepareAggregation(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange) Prepares the exchanges for aggregation. This implementation will copy the OUT body to the IN body so when you do aggregation the body is only in the IN body to avoid confusing end users.- Parameters:
oldExchange
- the old exchangenewExchange
- the new exchange
-
isFailureHandled
public static boolean isFailureHandled(org.apache.camel.Exchange exchange) Checks whether the exchange has been failure handed- Parameters:
exchange
- the exchange- Returns:
- true if failure handled, false otherwise
-
isErrorHandlerBridge
public static boolean isErrorHandlerBridge(org.apache.camel.Exchange exchange) Checks whether the exchange has been error handler bridged- Parameters:
exchange
- the exchange- Returns:
- true if error handler bridged, false otherwise
-
isUnitOfWorkExhausted
public static boolean isUnitOfWorkExhausted(org.apache.camel.Exchange exchange) Checks whether the exchangeUnitOfWork
is exhausted- Parameters:
exchange
- the exchange- Returns:
- true if exhausted, false otherwise
-
setFailureHandled
public static void setFailureHandled(org.apache.camel.Exchange exchange) Sets the exchange to be failure handled.- Parameters:
exchange
- the exchange
-
isRedelivered
public static boolean isRedelivered(org.apache.camel.Exchange exchange) Checks whether the exchangeUnitOfWork
is redelivered- Parameters:
exchange
- the exchange- Returns:
- true if redelivered, false otherwise
-
isStreamCachingEnabled
public static boolean isStreamCachingEnabled(org.apache.camel.Exchange exchange) Check whether or not stream caching is enabled for the given route or globally.- Parameters:
exchange
- the exchange- Returns:
- true if enabled, false otherwise
-
extractResultBody
public static Object extractResultBody(org.apache.camel.Exchange exchange, org.apache.camel.ExchangePattern pattern) Extracts the body from the given exchange. If the exchange pattern is provided it will try to honor it and retrieve the body from either IN or OUT according to the pattern.- Parameters:
exchange
- the exchangepattern
- exchange pattern if given, can be null- Returns:
- the result body, can be null.
- Throws:
org.apache.camel.CamelExecutionException
- is thrown if the processing of the exchange failed
-
extractFutureBody
public static <T> T extractFutureBody(org.apache.camel.CamelContext context, Future<?> future, Class<T> type) Extracts the body from the given future, that represents a handle to an asynchronous exchange. Will wait until the future task is complete.- Parameters:
context
- the camel contextfuture
- the future handletype
- the expected body response type- Returns:
- the result body, can be null.
- Throws:
org.apache.camel.CamelExecutionException
- is thrown if the processing of the exchange failed
-
extractFutureBody
public static <T> T extractFutureBody(org.apache.camel.CamelContext context, Future<?> future, long timeout, TimeUnit unit, Class<T> type) throws TimeoutException Extracts the body from the given future, that represents a handle to an asynchronous exchange. Will wait for the future task to complete, but waiting at most the timeout value.- Parameters:
context
- the camel contextfuture
- the future handletimeout
- timeout valueunit
- timeout unittype
- the expected body response type- Returns:
- the result body, can be null.
- Throws:
org.apache.camel.CamelExecutionException
- is thrown if the processing of the exchange failedTimeoutException
- is thrown if a timeout triggered
-
prepareOutToIn
public static void prepareOutToIn(org.apache.camel.Exchange exchange) Strategy to prepare results before next iterator or when we are complete, which is done by copying OUT to IN, so there is only an IN as input for the next iteration.- Parameters:
exchange
- the exchange to prepare
-
logIds
Gets both the messageId and exchangeId to be used for logging purposes. Logging both ids, can help to correlate exchanges which may be redelivered messages from for example a JMS broker.- Parameters:
exchange
- the exchange- Returns:
- a log message with both the messageId and exchangeId
-
copyExchangeWithProperties
public static org.apache.camel.Exchange copyExchangeWithProperties(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext context) Copies the exchange but the copy will be tied to the given context- Parameters:
exchange
- the source exchange- Returns:
- a copy with the given camel context
-
replaceMessage
public static void replaceMessage(org.apache.camel.Exchange exchange, org.apache.camel.Message newMessage, boolean outOnly) Replaces the existing message with the new message- Parameters:
exchange
- the exchangenewMessage
- the new messageoutOnly
- whether to replace the message as OUT message
-
getOriginalInMessage
public static org.apache.camel.Message getOriginalInMessage(org.apache.camel.Exchange exchange) Gets the original INMessage
this Unit of Work was started with. The original message is only returned if the optionRuntimeConfiguration.isAllowUseOriginalMessage()
is enabled. If it is disabled, then IllegalStateException is thrown.- Returns:
- the original IN
Message
-
resolveScheme
Resolve the component scheme (aka name) from the given endpoint uri- Parameters:
uri
- the endpoint uri- Returns:
- the component scheme (name), or null if not possible to resolve
-
getCharsetName
- See Also:
-
getCharset
- See Also:
-
getCharsetName
Gets the charset name if set as header or propertyExchange.CHARSET_NAME
. Notice: The lookup from the header has priority over the property.- Parameters:
exchange
- the exchangeuseDefault
- should we fallback and use JVM default charset if no property existed?- Returns:
- the charset, or null if no found
-
getCharset
Gets the charset if set as header or propertyExchange.CHARSET_NAME
. Notice: The lookup from the header has priority over the property.- Parameters:
exchange
- the exchangeuseDefault
- should we fallback and use JVM default charset if no property existed?- Returns:
- the charset, or null if no found
-
getScanner
public static org.apache.camel.util.Scanner getScanner(org.apache.camel.Exchange exchange, Object value, String delimiter) Creates aScanner
for scanning the given value.- Parameters:
exchange
- the current exchangevalue
- the value, typically the message IN bodydelimiter
- the delimiter pattern to use- Returns:
- the scanner, is newer null
-
getRouteId
-
getAtRouteId
-
getRouteGroup
-
getRoute
public static org.apache.camel.Route getRoute(org.apache.camel.Exchange exchange) -
setInOutBodyPatternAware
Sets the body in message in the exchange taking the exchange pattern into consideration. If the pattern is out capable, then the body is set outbound message. Otherwise it is set on the inbound message.- Parameters:
exchange
- the exchange containing the message to set the bodybody
- the body to set
-
setOutBodyPatternAware
Sets the body in message in the exchange taking the exchange pattern into consideration. If the pattern is out capable, then the body is set outbound message. Otherwise nothing is done.- Parameters:
exchange
- the exchange containing the message to set the bodybody
- the body to set
-
setVariable
Sets the variable- Parameters:
exchange
- the exchangename
- the variable name. Can be prefixed with repo-id:name to use a specific repository. If no repo-id is provided, then the variable is set on the exchangevalue
- the value of the variable
-
setVariableFromMessageBodyAndHeaders
public static void setVariableFromMessageBodyAndHeaders(org.apache.camel.Exchange exchange, String name, org.apache.camel.Message message) Sets the variable from the given message body and headers- Parameters:
exchange
- the exchangename
- the variable name. Can be prefixed with repo-id:name to use a specific repository. If no repo-id is provided, then the variable is set on the exchangemessage
- the message with the body and headers as source values
-
getVariable
Gets the variable- Parameters:
exchange
- the exchangename
- the variable name. Can be prefixed with repo-id:name to lookup the variable from a specific repository. If no repo-id is provided, then the variable is set on the exchange- Returns:
- the variable
-
getVariable
Gets the variable, converted to the given type- Parameters:
exchange
- the exchangename
- the variable name. Can be prefixed with repo-id:name to lookup the variable from a specific repository. If no repo-id is provided, then the variable is set on the exchangetype
- the type to convert to- Returns:
- the variable
-