5 Replies Latest reply on May 17, 2013 9:19 AM by Tomohisa igarashi

    HornetQ ActivationSpec properties

    Tomohisa igarashi Master

      I took a look at ActivationSpec properties available on HornetQ. It's more than I thought....

       

      [resource]

       

      [A list of ActivationSpec properties]

      • JCA recommended set of ActivationSpec properties
        • destination
          • Required. queue name
        • destinationType
          • Required. javax.jms.Queue or javax.jms.Topic
        • messageSelector
          • Optional. selector string
        • acknowledgeMode
          • Optional. Auto-acknowledge or Dups-ok-acknowledge. Auto-acknowledge by default.
        • subscriptionDurability
          • Optional. only available if target destination is Topic. String value "Durable" or "NonDurable" indicates if subscription should be durable or not. NonDurable by default.
        • clientId
          • Required for Topic durable subscription. The identifier to identify each durable subscribers. endpoint deployer must ensure the id is unique.
          • sounds like SwitchYard runtime should generate this automatically...?
        • subscriptionName
          • Required for Topic durable subscription. endpoint deployer must ensure the id is unique.
      • HornetQ specific ActivationSpec properties
        • shareSubscriptions, user, password, transactionTimeout, useJNDI, jndiParams, maxSession(maybe EJB standard?), useLocalTx, setupAttempts, setupInterval, connectorClassName, connectionParameters
        • and more! (HornetQActivationSpec extends ConnectionFactoryProperties, so all of ConnectionFactory properties can be specified like ha, discoveryAddress, discoveryPort, and etc..)

       

       

      If we're just thinking about default settings from tooling, I would choose JCA recommended + maxSession to set. I believe user could specify other parameters by himself if it's really needed.

       

      Thanks,

      Tomo

        • 1. Re: HornetQ ActivationSpec properties
          Brian Fitzpatrick Expert

          Wow. That's quite a list. Can you provide an example that includes all the mandatory values with recommended defaults?

          • 2. Re: HornetQ ActivationSpec properties
            Tomohisa igarashi Master

            Hi Brian,

             

            All we can fill a default value from beginning is destinationType, it should be "javax.jms.Queue". The destination might be "queue/ChangeToYourQueue" or something though.

             

            Can we do like this from tooling?

             

            • add messageSelector and maxSession with empty value, but it doesn't appear in switchyard.xml unless user adds valid value
            • If user choose "javax.jms.Topic" for destinationType, add subscriptionDurability=NonDurable
            • If user choose "Durable" for subscriptionDurability, add clientID and subscriptionName with generated GUID string

             

            If those conditional behavior is not so easy to do, then we would add just destination and destinationType, because only these 2 are required and others are optional.

             

            Thanks,

            Tomo

            • 3. Re: HornetQ ActivationSpec properties
              Brian Fitzpatrick Expert

              Do we have any example switchyard.xml files that show potential values for messageSelector and maxSession? Does messageSelector differ from the operation selector on the binding?

               

              And we can definitely do something along the lines of what you describe. I'm just trying to get a feel for the types of values that should be set for these optional parameters. Are they all text values?

               

              For clientID and subscriptionName, where does the generated GUID come into play? Is that generated by the runtime or the UI? How's it used and referenced?

               

              I have a ton of questions and not many answers.

              • 4. Re: HornetQ ActivationSpec properties
                Tomohisa igarashi Master

                messageSelector is a subset of SQL92, so it looks like "JMSType = 'car' AND color = 'blue' AND weight > 2500", and maxSession is a integer value. It will be like below in the switchyard.xml:

                 

                            <binding.jca xmlns="urn:switchyard-component-jca:config:1.0">
                                <inboundConnection>
                                    <resourceAdapter name="hornetq-ra.rar"/>
                                    <activationSpec>
                                        <property name="destinationType" value="javax.jms.Queue"/>
                                        <property name="destination" value="queue/JCAInflowGreetingServiceQueue"/>
                                        <property name="messageSelector" value="JMSType = 'car' AND color = 'blue' AND weight > 2500"/>
                                        <property name="maxSession" value="15"/>
                                    </activationSpec>
                                </inboundConnection>
                .... (snip) ....
                

                 

                All of these ActivationSpec property have text value. If tooling could generate GUID for clientID and subscriptionName, that would be great. Otherwise, user must fill a unique value for both of them. These 2 value will be sent to JMS server and is used for identify consumers (SY JCA inbound gateway in this case).

                 

                OK, next question whatever you have!

                • 5. Re: HornetQ ActivationSpec properties
                  Tomohisa igarashi Master

                  oops - so messageSelector may have "<" or ">", which should be converted into "&lt;" or "&gt;" in the switchyard.xml. "Message Selectors" section of below document describes about messageSelector syntax.

                  http://docs.oracle.com/javaee/6/api/javax/jms/Message.html