I guess what I was wondering if whether the connection allocates and
destroys a lot of resources or not, for example sockets, files, database
records, buffers, etc.. or if it performs any blocking operations. I guess
I'll wait until I notice a performance problem ... by the sounds of it
there's nothing specific I should be watching out for.
glassfish-2 wrote:
>
> To expand on Sahoo's reply:
>
> Context of the question really matters a lot. How much CPU are you
> spending on sending and receiving messages vs. doing something more
> interesting? How much memory?
>
> Start with a profiler to make sure that you really are addressing the
> right problem and that the maintenance pain of managing your own cached
> JMS parts will pay off.
>
> Sending a JMS message creates at least one new object every time (the
> message). Avoiding the creation of three others would buy at best a linear
> gain in a system that is very message-intensive. If you're trying for
> performance on a message-intensive system, be aware that you're on a slope
> away from JMS. Even SomnifugiJMS burns time on recovering unreferenced
> objects.
>
> In practice, the Connection is the monster, and is safe to reuse unless
> you want to change its parameters while you're sharing the Connection. The
> Session and Sender are usually smaller. Those two are hard to reuse safely
> across multiple threads, and the JMS spec doesn't officially support it.
>
> If you're using an application server, use the application server's cache
> of connections. Don't waste your energy writing your own cache. Instead
> read the docs and ask questions about how to configure your system to use
> someone else's cache.
> [Message sent by forum member 'dwalend' (dwalend)]
>
> http://forums.java.net/jive/thread.jspa?messageID=329667
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>
--
View this message in context: http://www.nabble.com/Using-JMS-tp21783323p21798656.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.