Hi Niranjan,

I haven't actually used HL7Server personally in a while, although I know
there are a number of other people who do- Hopefully someone else can shed
some light on their experience. Here at UHN, we have moved over the last few
years towards a model of processing incoming HL7 messages in an EJB MDB
being fed directly from a queue on our interface engine.

My recollection (with a quick look over the code) is that ProcessorImpl (the
class HL7Server instantiates to handle each new connection to the server)
spawns a single thread in it's constructor that is responsible for receiving
messages, and then spawns a separate thread for every received message to
handle sending back an acknowledgement.

This behaviour does seem a bit odd to me, it would probably make sense to
handle sending and receiving in a single thread and just keep using that
thread. This wouldn't actually be difficult to implement, you would just
need to modify "sendAppResponse(Transportable)" in ProcessorImpl. Maybe
HL7Server could be modified to include an option for this.

Alternately, ProcessorImpl has a constructor argument "threaded" which can
be set to false. This disables all thread creation in the class, which means
that you could use it as is, but you would need to add some other stuff
yourself (accepting connections, periodically calling "cycle()" to receive
new message, etc). If you are hosting your application in an application
server, this is probably the safest option, since EJB looks poorly on
creating your own threads at all.

Hopefully this helps, and let me know if I can assist in any way.

Cheers,
James

On Fri, Jul 24, 2009 at 10:48 AM, Sharma, Niranjan K (GE Healthcare) <
[email protected]> wrote:

>  Hi James,
>
>
>
> I have implemented a HL7Server based on HAPI’s HL7 Server implementation.
>
>
>
> While doing the Threading and Memory analysis, I am realizing that it has a
> growing Thread model.
>
> Which means HL7Server creates new thread for new message..literally?
>
>
>
> Can you throw some light on Threading model? Also, some facts from UHN
> experience.
>
>
>
> I am pretty Happy with HAPI’s overall performance
>
>
>
> Please see the attached snapshot for your reference.
>
>
>
> Best Regards
>
> -Niranjan.
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to