Announcement Announcement Module
Collapse
No announcement yet.
Performance Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Performance

    Hi Foxs,

    I've just decided to move to JMS support provided by Spring from using those cumbersome Java code to get Connection factory, Session, Connection etc.

    The first reason to move on to Spring was, actually, an error of "OutOfMemory" as I've forgotten to close connection after publishing my request to Queue/Topic.

    Now The question is
    1. Does spring handle ConnectionObject better way or How better does it handle? (Have i asked proper question?)

    2. Will it be handle to multiple thread at a time?

    3. Is there any way to keep my TopicConnection/QueueConnection singleton?

    I'm stuck!!! Please, Help me out.

    Regards,
    ABhishek

  • #2
    1. Does spring handle ConnectionObject better way or How better does it handle? (Have i asked proper question?)
    Yes, it handles the connection elegantly. Spring JMS support frees you from worrying about the boiler plate code along with optimal performance.

    2. Will it be handle to multiple thread at a time?
    Yes you can specify the number of concurrent consumers while defining the MessageListenerContainer. It is just a matter of setting the property in your spring context file. You need not worry about as spring takes care of that
    3. Is there any way to keep my TopicConnection/QueueConnection singleton?
    Yes, Spring provides an implementation of the ConnectionFactory interface, SingleConnectionFactory, that will
    return the same Connection on all createConnection calls and ignore calls to close.
    Please refer to spring reference document, it has enough information to start with Spring JMS Support
    Regards,
    Imran

    Comment


    • #3
      Because Spring asks the ConnectionFactory for a connection each time, and each connection is asked for a Session each time, you need an JMS implementation which is friendly to that. Take a look at this article

      Comment


      • #4
        First of all, thanks a lot for Reply,

        2. Will it be handle to multiple thread at a time?

        For this question, i would like to know if there are 1000 Threads trying to publish message to the same queue at the same time what would be perfomance effect?
        I'm using ConnectionFactory, not SingleConnectionFactory for requesting connection.
        Pooling is provided by JBoss for me.

        Comment


        • #5
          It shouldn't be a problem, but you should consider running such a test. Its hard to tell what a resource pool will do when faced with such a huge amount of concurrency

          Comment


          • #6
            Hmm.Thanks.

            I'll test it and let you all know the results.

            Comment


            • #7
              Have a look at this post by James (ActiveMQ) about spring jms sender's performance.
              http://www.theserverside.com/discuss...hread_id=33899

              But as suggested by wpoitras you should confirm the actual performance by running such a test.

              Regards,
              Imran

              Comment

              Working...
              X