users@glassfish.java.net

Re: JMS connection

From: <glassfish_at_javadesktop.org>
Date: Mon, 22 Jun 2009 02:26:07 PDT

Hi Danilo,


> I found a temporaly work around, but I don't really
> like it ;(
>
> The problem is that I have only one producer instance
> (it is a single SLSB)
> that sends a bunch (say some hundreds) of JMS
> messages to a topic, and for
> each message opens a connection (maybe this is the
> source of the problem) and
> then closes (not very optimized, but it should work,
> shouldn't it?).

Yes, it should work, but as you noted it is not very efficient. Why do you open a new connection for each message? If you send some hundreds of messages through the same SLSB you should open the connection only once. E.g. you could create it in the @PostConstruct method and close it in the @PreDestroy method.

Cheers
Chris.
[Message sent by forum member 'chrjohn' (chrjohn)]

http://forums.java.net/jive/thread.jspa?messageID=352307