2 Replies Latest reply on Aug 5, 2013 4:01 AM by Andy Taylor

    How to set Queue/Address Attributes using JMS Management API?

    Paul Manning Newbie

      Typically when I create a queue with configuration, I setup address-settings such as:

       

       

      {code:xml}<address-setting match="jms.queue.MyQueue">

               <redelivery-delay>10000</redelivery-delay>

               <max-delivery-attempts>10</max-delivery-attempts>

      </address-setting>{code}

       

      I have a case where I am dynamically creating a queue using HornetQ's JMS Management API. How can I set these.

       

      I took a look at the JMSQueueControl in the HornetQ JMS Management doc:

       

      https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/5/html-single/HornetQ_User_Guide/index.html#idm59597776  

       

      There it defines methods to update the "durable" attribute and DLQ, but that is it.

       

      The AddressControl only allows you to add Roles.

       

      Any help is appreciated. Thanks,

       

       

      Paul Manning

        • 1. Re: How to set Queue/Address Attributes using JMS Management API?
          Paul Manning Newbie

          I am still interested in a solution to this, however, I think I have found a work around.

           

          I can setup a default catch all configuration in the HornetQ.sar's hornetq-configuration.xml file like so...

           

           

          <address-settings>

                <!--default for all queues with the following prefix-->

                <address-setting match="MyDynamicQueuePrefix.#">

                   <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                   <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                   <redelivery-delay>0</redelivery-delay>

                   <max-size-bytes>50485760</max-size-bytes>   

                   <page-size-bytes>10485760</page-size-bytes>  

                   <message-counter-history-day-limit>10</message-counter-history-day-limit>

                   <address-full-policy>PAGE</address-full-policy>

                </address-setting>

             </address-settings>

          1 of 1 people found this helpful
          • 2. Re: How to set Queue/Address Attributes using JMS Management API?
            Andy Taylor Master

            sorry for the slow reply, been on vacation, anyway

             

            HornetQServerControl

             

            @Operation(desc= "Add address settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)

               void addAddressSettings(@Parameter(desc="an address match", name="addressMatch") String addressMatch,

                                       @Parameter(desc="the dead letter address setting", name="DLA") String DLA,

                                       @Parameter(desc="the expiry address setting", name="expiryAddress") String expiryAddress,

                                       @Parameter(desc="the expiry delay setting", name="expiryDelay") long expiryDelay,

                                       @Parameter(desc="are any queues created for this address a last value queue", name="lastValueQueue") boolean lastValueQueue,

                                       @Parameter(desc="the delivery attempts", name="deliveryAttempts") int deliveryAttempts,

                                       @Parameter(desc="the max size in bytes", name="maxSizeBytes") long maxSizeBytes,

                                       @Parameter(desc="the page size in bytes", name="pageSizeBytes") int pageSizeBytes,

                                       @Parameter(desc="the max number of pages in the soft memory cache", name="pageMaxCacheSize") int pageMaxCacheSize,

                                       @Parameter(desc="the redelivery delay", name="redeliveryDelay") long redeliveryDelay,

                                       @Parameter(desc="the redelivery delay multiplier", name="redeliveryMultiplier") double redeliveryMultiplier,

                                       @Parameter(desc="the maximum redelivery delay", name="maxRedeliveryDelay") long maxRedeliveryDelay,

                                       @Parameter(desc="the redistribution delay", name="redistributionDelay") long redistributionDelay,

                                       @Parameter(desc="do we send to the DLA when there is no where to route the message", name="sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,

                                       @Parameter(desc="the ploicy to use when the address is full", name="addressFullMessagePolicy") String addressFullMessagePolicy) throws Exception;