13 Replies Latest reply on Apr 28, 2011 4:41 AM by massimo.paladin

    stomp and queues auto creation

    massimo.paladin

      Hello,

       

      I am currently evaluating HornetQ as messaging solution.

       

      I am looking at stomp because it is the most supported protocol across the different solutions.

       

      Is it possible to auto create a queue when a message is sent?

       

      I would like to send just a message with a new destination and that the system auto create the destination.

       

      I am using hornetq 2.2.2 final.

       

      Regards,

      -Massimo

        • 1. stomp and queues auto creation
          clebert.suconic

          You have to pre-create the destination

          • 2. stomp and queues auto creation
            massimo.paladin

            Isn't there a way to auto create destinations when SEND Stomp frame is received by the broker?

             

            Regards,

            -Massimo

            • 3. stomp and queues auto creation
              ataylor

              like Clebert has already said, you need to pre configure them. However if you think its a valuable piece of functionality to add, feel free to raise a jira, altho its unlikely to gain hogh priority as we are really busy. You could always take a look at the code and provide a patch, we are always more than welcoming of patches from the community.

              • 4. stomp and queues auto creation
                massimo.paladin

                I am evaluating hornetq so I won't probably have time for development.

                 

                I don't know if it is a good idea to open a bug in jira looking at this:

                https://issues.jboss.org/browse/HORNETQ-580

                it has been marked as duplicate but I cannot find the other related bug.

                 

                It would be really good to have this functionality, it allows dynamic use cases where all the destinations are not known in advance.

                 

                Regards,

                -Massimo

                • 5. stomp and queues auto creation
                  rymnz

                  just fyi

                   

                  i have tested with hornetq 2.2.2 if we create producer and consumer from STOMP and bound to/from topic (ex, jms.topic.example) it will auto created and marked as temporary and also can send & receive message successfully, but if u bound to queue (ex.jms.queue.example) it will throws error

                  HornetQException[errorCode=100 message=Queue jms.queue.example does not exist]

                  • 6. stomp and queues auto creation
                    clebert.suconic

                    you have basically to pre-create queues on HornetQ.

                     

                     

                    We have been asked from time to time to auto-create, because that's how ActiveMQ would behave.

                     

                     

                    We have been thinking about adding a relaxing attribute and auto-create queues.

                    • 7. stomp and queues auto creation
                      rymnz

                      yes, of course the solution is to pre-create,

                      but I have tested with the current version (2.2.2), when we used jms.topic.xx, server was already doing auto-create, except for jms.queue.xx its will throws an error.

                      • 8. stomp and queues auto creation
                        clebert.suconic

                        It shouldn't auto-create... it's just ignoring it since the topic may be unbound to any subscription.

                        • 9. stomp and queues auto creation
                          massimo.paladin

                          I confirm that it works with topics... why?

                           

                          What is preventing you to add auto creation of destinations?

                           

                          Cheers,

                          -Massimo

                          • 10. stomp and queues auto creation
                            ataylor
                            I confirm that it works with topics... why?

                            It doesnt create it, nothing actually exists with topicsw, like clebert says it ignores as there are no subdcriptions

                            What is preventing you to add auto creation of destinations?

                            Time and resource

                            • 11. stomp and queues auto creation
                              massimo.paladin
                              It doesnt create it, nothing actually exists with topicsw, like clebert says it ignores as there are no subdcriptions

                              I saw through jmx that it is not created like the other topics, true.

                              But, at least, at the moment of subscription of the consumer it should return an error to be coherent with queues behavior.

                              Time and resource

                              Ok, I wanted to know if you were against or if it was just a problem of resource.

                              Auto creation is a feature required by many use cases.

                               

                              Since I saw you are looking at stomp 1.1 it might be good to look at this too...

                              • 12. stomp and queues auto creation
                                timfox

                                It would be really good to have this functionality, it allows dynamic use cases where all the destinations are not known in advance.

                                 

                                 

                                FWIW, HornetQ does allow queues and topics to be created "on the fly" via the management interface. This can be accessed over a normal connection by sending messages to the management address. STOMP just sends messages to destinations so it *should* work over STOMP too.

                                • 13. stomp and queues auto creation
                                  massimo.paladin

                                  Stomp is a lightweight protocol, imho I would prefer either to get auto created destinations or to pre declare the destinations.

                                   

                                  I don't think it is really useful to let a stomp client to create destinations through management interface.

                                  It would increase the overhead for a short lived producer which is interested in publishing a simple message.

                                   

                                  Regards,

                                  -Massimo