1 2 Previous Next 18 Replies Latest reply on Jun 19, 2010 12:04 PM by timfox

    Spring Support

    bdarfler

      I recently tried to switch from ActiveMQ to HornetQ and the biggest pain point I ran into was using HornetQ with Spring. ActiveMQ has a spring namespace that allows for configuration such as the one show on http://activemq.apache.org/spring-support.html under using spring 2.0.

       

      For instance I can create a connection factory via

       

      <amq:connectionFactory id="connectionFactory" brokerURL="${jms.url}" userName="${jms.username}" password="${jms.password}" />

       

      and I can create destinations inline in my applications spring config using

       

      <amq:destinations>

       

          <amq:topic physicalName="topic1"/>

          <amq:queue physicalName="queue1"/>

       

      </amq:destinations>

       

      Obviously this is a huge win for applications already built on Spring and having something analogous with HornetQ would greatly improve adoption from those using an ActiveMQ/Spring stack.

        • 1. Re: Spring Support
          clebert.suconic

          ok.. that makes it a nice area for a contribution.

           

          Do you want to open a jira with a feature request?

           

           

          Do you want to contribute a patch?

          1 of 1 people found this helpful
          • 2. Re: Spring Support
            bdarfler
            • 3. Re: Spring Support
              timfox

              I don't know much about Spring, but AIUI it's a dependency injection framework and as such can instantiate POJOs and wire them up according to some xml config.

               

              HornetQ is just POJOs and some factories so shouldn't Spring be able to do this already. I'm pretty sure I've seen Spring users using HornetQ in this way.

              • 4. Re: Spring Support
                bdarfler

                Spring can create and wire pojos. The benefit of the namespace is that it greatly reduces the lines of configuration and can guide users more effectively towards the correct way of doing things. Additionally it could allow for things like creation of destinations and configuration of users in the spring configuration instead of having to manage multiple additional xml configuration files specific to HornetQ.

                • 5. Re: Spring Support
                  timfox

                  Ok, fair enough. Sounds like it would be a nice feature to have

                  1 of 1 people found this helpful
                  • 6. Re: Spring Support
                    timfox
                    • 7. Re: Spring Support
                      bdarfler

                      I did and its a very good example of why I brought this subject up. That is an obscene amount of code and configuration to get HornetQ working with Spring.

                       

                      I'll try and read through it again though.

                      • 8. Re: Spring Support
                        timfox

                        I think you're being quite unfair to HornetQ here.

                         

                        HornetQ is designed as a simple set of POJOs that can be used directly in your own program or in another framework, it doesn't get much simpler than that!

                         

                        The stuff you're referring to that is "obscene" is not HornetQ configuration, it's Spring configuration. You can't blame HornetQ because A.N.Other framework hasn't yet integrated it in yet.

                         

                        The problem with your comments on twitter etc, is you paint this to be a problem with HornetQ, e.g:

                         

                        ".@hornetq might be blazing fast but its a pain to setup. Not needing JNDI makes most of the examples close to useless."

                         

                        What you found a pain to setup was not HornetQ, but Spring.

                         

                        Using HornetQ without JNDI is extremely simple - we even ship an example in the distro showing you exactly how to do that.

                         

                        If you want Spring to provide better HornetQ integration, I would agree with you there, but it's unfair to paint this lack of integration as a failing of HornetQ.

                        • 9. Re: Spring Support
                          timfox

                          A more accurate twitter would have been "hornetq might be blazing fast but it's a pain to setup Spring to recognise it."

                          • 10. Re: Spring Support
                            bdarfler

                            Exactly, its a lot of work to get HornetQ and Spring to work together nicely. It would be awesome if there were better Spring support in HornetQ that is all.

                            • 11. Re: Spring Support
                              timfox

                              Regarding the uselessness of the examples, I don't really know how you came to that conclusion.

                               

                              As I mentioned before there is an example that shows you exactly how to instantiate managed objects directly without using JNDI (just one line of code to do this).

                               

                              Yes, the rest of the examples use JNDI to lookup managed objects. That's just because that's what most people do. If you just ignore the part of the examples that do the lookup, and substitute that part for the direct instantiation then the rest of the example is exactly the same. Hardly useless.

                              • 12. Re: Spring Support
                                bdarfler

                                What I should have said is HornetQ might be blazing fast but its Spring support lags behinds ActiveMQ. I'll send that out just to be fair and clear.

                                • 13. Re: Spring Support
                                  timfox

                                  Benjamin Darfler wrote:

                                   

                                  What I should have said is HornetQ might be blazing fast but its Spring support lags behinds ActiveMQ

                                  I disagree.

                                   

                                  I would say Spring's HornetQ support lags behind ActiveMQ

                                  • 14. Re: Spring Support
                                    bdarfler

                                    Except that ActiveMQ are the authors of the ActiveMQ namespace for Spring, not the other way around.

                                    1 2 Previous Next