title: Apache Camel -- Reference type constants in Spring DSL
body: <p>I'm trying to define a publish operation to Hazelcast topic using Spring DSL</p>
  
  <pre><code>&lt;from uri="direct:inbound" /&gt;      
          &lt;onCompletion&gt;
              &lt;log message="onCompletion:- ${body}" /&gt;
              &lt;setHeader headerName="${type:org.apache.camel.component.hazelcast.HazelcastConstants.OPERATION}"&gt;
                  &lt;simple&gt;${type:org.apache.camel.component.hazelcast.HazelcastConstants.PUBLISH_OPERATION}&lt;/simple&gt;
              &lt;/setHeader&gt;
              &lt;to uri="hazelcast:topic:foo" /&gt;
          &lt;/onCompletion&gt;                                                
          &lt;log message="${body}" /&gt;
  </code></pre>
  
  <p>The above route works, but I have to use long SIMPLE scripts like "${type:org.apache.camel.component.hazelcast.HazelcastConstants.OPERATION}" to ref a constant value. Is there any simpler or short form for this?</p>
  
  <p>I tried to define a spring bean for HazelcastConstants class and ref it through SIMPLE scripts as below but it's not working with MethodNotFoundException "Method with name: OPERATION not found on bean" </p>
  
  <pre><code>&lt;bean id="hazelcastConstants" class="org.apache.camel.component.hazelcast.HazelcastConstants" /&gt;
  ... ...
  &lt;simple&gt;${bean:hazelcastConstants.OPERATION}&lt;/simple&gt;
  </code></pre>