12 Replies Latest reply on Jan 31, 2016 12:42 PM by Max Ozkin

    What is the easiest way to add additional properties to outbound JMS messages via Camel JMS Binding?

    Tadayoshi Sato Novice

      Hello,

       

      I'd like to attach an extra property to outbound JMS messages emitted from a SCA reference implemented by Camel JMS Binding like this:

       

              <reference name="notificationAction" promote="HelloWorld_ActionESB/notificationAction" multiplicity="1..1">
                  <jms:binding.jms xmlns:jms="urn:switchyard-component-camel-jms:config:1.0">
                      <jms:queue>quickstart_helloworld_action_Response</jms:queue>
                      <jms:connectionFactory>#ConnectionFactory</jms:connectionFactory>
                      <jms:disableReplyTo>true</jms:disableReplyTo>
                  </jms:binding.jms>
              </reference>
      

       

      My question is, what's the easiest or recommended way to achieve this in SwitchYard?  Is it the easiest way to use <contextMapper/> and add a property to the Exchange in the Camel route, as discussed in the thread below?

      https://community.jboss.org/thread/177322

       

      Is there any more declarative way to do it?  Note that in JBoss ESB, you can achieve the same by the following declarative configuration using Notifier actions:

       

                      <action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
                          <property name="okMethod" value="notifyOK" />
                          <property name="notification-details">
                              <NotificationList type="OK">
                                  <target class="NotifyQueues">
                                      <messageProp name="quickstart" value="hello_world_action" />
                                      <queue jndiName="queue/quickstart_helloworld_action_Response" />
                                  </target>
                              </NotificationList>
                          </property>
                      </action>
      

       

      Thank you for your help!

       

      Tadayoshi