JMS threaded server design?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andrew_Wright
Posted On:   Thursday, August 16, 2001 10:09 AM

Hi all, A small design question for all the gurus out there. We're developing a multi threaded JMS server (all this discussion is Queues only, no pub/sub), and we can see two ways of going about things: 1. Have a single Connection and single Session instance in a 'Network' class. The class has an asynchronous onMessage() method, which retrieves an idle 'processing' thread from a connection pool, stuffs the incoming message into it, and calls start(). The processing thread does all the work related to extracting info out of the message and doing something with it. This sounds fairly efficient - the onMessage() method is quite short, and we don't have lots of session instances floating around. But the message receiving is    More>>

Hi all,


A small design question for all the gurus out there. We're developing a multi threaded JMS server (all this discussion is Queues only, no pub/sub), and we can see two ways of going about things:


1. Have a single Connection and single Session instance in a 'Network' class. The class has an asynchronous onMessage() method, which retrieves an idle 'processing' thread from a connection pool, stuffs the incoming message into it, and calls start(). The processing thread does all the work related to extracting info out of the message and doing something with it.
This sounds fairly efficient - the onMessage() method is quite short, and we don't have lots of session instances floating around. But the message receiving is not truly concurrent.


2. Do what everyone else on the web seems to do and share a single connection instance between multiple threads. Each thread creates its own session, and implements MessageListener. Pros: true message receiving concurrency. Cons: each thread is more 'heavyweight' - more member data, possibly lots of sessions, etc.


This is fairly advanced design - any thoughts on which way would be more efficient? btw, we've already implemented both ways, but as it's a student project we don't have access to the kind of testing facilities we need to really pound the server and find out which is best. Note: this is a standalone app, no EJBs or application servers floating around.


Thanks very much,
Andrew Wright

   <<Less
About | Sitemap | Contact