camelContext
variable, though, because I felt it deserved a post of its own. This variable is a reference to an object implementing the CamelContext
interface, which lets you access a ton of interesting runtime information.CamelContext
. So, where to start? First off, let’s find out which class implements the interface:${camelContext.getClass.getName}
org.apache.camel.blueprint.BlueprintCamelContext
. Interesting, but what else can we learn? I’d like to know the version number of the underlying Apache Camel framework, and the getVersion()
method returns just that. Let’s try it out:${camelContext.getVersion}
messageHistory
variable and the starts with
operator: They were introduced in later versions of Camel (2.17 and 2.17.1, respectively).CamelContext
interface, another method looks promising: getUptime()
. Let’s give it a go:${camelContext.getUptime}
getUptime()
method returns the human readable uptime of the context, i.e. the time that has passed since the integration flow was deployed.getUuidGenerator()
method also looks interesting. According to the API documentation, it returns an object implementing the UuidGenerator
interface. This interface has a single method, generateUuid()
, which, to no one’s surprise, generates a UUID. Let’s try to do that now:${camelContext.getUuidGenerator.generateUuid}
getStatus()
. This method returns a ServiceStatus
enum, indicating the state of the CamelContext
(starting, started, stopping etc). Let’s check my current status:${camelContext.getStatus}
camelContext
variable? Feel free to share it in the comments below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
9 | |
9 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |