Creating JMS destination programatically in JBoss
One of our clients wanted to create a queue programaticly in JBoss environment. JMS provides a mechanism to create temporary queue using javax.jms.Session api. However the spec states that “"The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the
createTemporaryQueue method. ".
Nevertheless, the customer wanted its queue to be not “temporary” (due to internal constraints). Constructing non-temporary queue can be done with JBoss specific management api. JBoss can use three different JMS providers (depend on which JBoss version you use). The latest and greatest is HornetQ - its manual it is explained how to do it - Please read here. Nonetheless, JBoss-Messaging also provides such api - Please see here.