이 콘텐츠는 선택한 언어로 제공되지 않습니다.

29.6. Variable Reference


Table of variables

Table 29.1, “Variables for the Simple Language” shows all of the variables supported by the simple language.
Expand
Table 29.1. Variables for the Simple Language
VariableTypeDescription
camelContextObjectThe Camel context. Supports OGNL expressions.
camelIdStringThe Camel context's ID value.
exchangeIdStringThe exchange's ID value.
idStringThe In message ID value.
body Object
The In message body. Supports OGNL expressions.
in.bodyObjectThe In message body. Supports OGNL expressions.
out.body Object
The Out message body.
bodyAs(Type)TypeThe In message body, converted to the specified type. All types, Type, must be specified using their fully-qualified Java name, except for the types: byte[], String, Integer, and Long. The converted body can be null.
mandatoryBodyAs(Type)TypeThe In message body, converted to the specified type. All types, Type, must be specified using their fully-qualified Java name, except for the types: byte[], String, Integer, and Long. The converted body is expected to be non-null.
header.HeaderNameObject
The In message's HeaderName header. Supports OGNL expressions.
header[HeaderName]Object
The In message's HeaderName header (alternative syntax).
headers.HeaderNameObjectThe In message's HeaderName header.
headers[HeaderName]ObjectThe In message's HeaderName header (alternative syntax).
in.header.HeaderNameObjectThe In message's HeaderName header. Supports OGNL expressions.
in.header[HeaderName]ObjectThe In message's HeaderName header (alternative syntax).
in.headers.HeaderNameObjectThe In message's HeaderName header. Supports OGNL expressions.
in.headers[HeaderName]ObjectThe In message's HeaderName header (alternative syntax).
out.header.HeaderName Object
The Out message's HeaderName header.
out.header[HeaderName]Object
The Out message's HeaderName header (alternative syntax).
out.headers.HeaderNameObjectThe Out message's HeaderName header.
out.headers[HeaderName]ObjectThe Out message's HeaderName header (alternative syntax).
headerAs(Key,Type)TypeThe Key header, converted to the specified type. All types, Type, must be specified using their fully-qualified Java name, except for the types: byte[], String, Integer, and Long. The converted value can be null.
headersMapAll of the In headers (as a java.util.Map type).
in.headersMapAll of the In headers (as a java.util.Map type).
property.PropertyName Object
The PropertyName property on the exchange.
property[PropertyName]Object
The PropertyName property on the exchange (alternative syntax).
sys.SysPropertyNameStringThe SysPropertyName Java system property.
sysenv.SysEnvVarStringThe SysEnvVar system environment variable.
exceptionStringEither the exception object from Exchange.getException() or, if this value is null, the caught exception from the Exchange.EXCEPTION_CAUGHT property; otherwise null. Supports OGNL expressions.
exception.messageStringIf an exception is set on the exchange, returns the value of Exception.getMessage(); otherwise, returns null.
exception.stacktraceStringIf an exception is set on the exchange, returns the value of Exception.getStackTrace(); otherwise, returns null. Note: The simple language first tries to retrieve an exception from Exchange.getException(). If that property is not set, it checks for a caught exception, by calling Exchange.getProperty(Exchange.CAUGHT_EXCEPTION).
date:command:patternStringA date formatted using a java.text.SimpleDateFormat pattern. The following commands are supported: now, for the current date and time; header.HeaderName, or in.header.HeaderName to use a java.util.Date object in the HeaderName header from the In message; out.header.HeaderName to use a java.util.Date object in the HeaderName header from the Out message;
bean:beanID.MethodObjectInvokes a method on the referenced bean and returns the result of the method invocation. To specify a method name, you can either use the beanID.Method syntax; or you can use the beanID?method=methodName syntax.
ref:beanIDObjectLooks up the bean with the ID, beanID, in the registry and returns a reference to the bean itself. For example, if you are using the splitter EIP, you could use this variable to reference the bean that implements the splitting algorithm.
properties:KeyStringThe value of the Key property placeholder (see Section 2.7, “Property Placeholders”).
properties:Location:KeyStringThe value of the Key property placeholder, where the location of the properties file is given by Location (see Section 2.7, “Property Placeholders”).
threadNameStringThe name of the current thread.
routeIdStringReturns the ID of the current route through which the Exchange is being routed.
type:Name[.Field]ObjectReferences a type or field by its Fully-Qualified-Name (FQN). To refer to a field, append .Field. For example, you can refer to the FILE_NAME constant field from the Exchange class as type:org.apache.camel.Exchange.FILE_NAME
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat