3 Replies Latest reply on Feb 11, 2010 2:23 PM by Tim Fox

    create queue at runtime

    Pablo Fonseca Newbie

      Hi All,


      First I want to tanks for the good work with HornetQ, it have impressive performance compared to the other open queue providers.


      I need your help with an issue, I couldn't find the answer on the documentation, or searching the forum...


      I want to create a queue from my Java application, but I can only do this with other jms providers like OpenMQ(sun) and ActiveMQ(apache), I've made a test suit with one code for all the providers, just changing the InitialContext and ConnectionFactory creation for each one.


      If I do session.createQueue("testQueue") it does not create a queue with HornetQ, but returns:

      javax.jms.JMSException: There is no queue with name testQueue

      at org.hornetq.jms.client.HornetQSession.createQueue(HornetQSession.java:410)


      If I use session.createQueue("ExampleQueue"), everything works fine, but its because ExampleQueue is defined at HornetQ configuration files.


      Ive already tried to configure HornetQ with these settings:



            <security-setting match="#">

               <permission type="createQueue" roles="guest"/>

               <permission type="createTempQueue" roles="guest"/>

               <permission type="deleteTempQueue" roles="guest"/>

               <permission type="consume" roles="guest"/>

               <permission type="send" roles="guest"/>



      I can create temporary queues, with createTemporaryQueue, but its not what I want.
      Thanks in advance,