In Apache Camel we use βsimpleβ statement to extract values in a pojo.
For example if we have a pojo βEmployeeβ having βemployeeIdβ as one of the attribute, and employee object is available in camel exchange body, we can retrieve the employee id with following statement.
simple("${body.employeeId}");
If by chance body is null above statement will throw null pointer exception. Apache Camel provides a solution to avoid this situation. Use ?. instead of . to access attributes.
simple("${body?.employeeId}");
Is the value of β${body?.employeeId}β is null if there is no employeeId property?
Yes. Value will be βnullβ if object in body doesnβt have βemployeeIdβ attribute.