The velocity component sets a couple headers on the message (you can't set these yourself and velocity component will not set these headers which will cause some side effect on the dynamic template support):
The templateName as a
Headers set during the Velocity evaluation are returned to the message and added as headers. Then it's possible to return values from Velocity to the Message.
For example, to set the header value of
fruit in the Velocity template
fruit header is now accessible from the