users@glassfish.java.net

Re: General design question in use Java EE technologies to solve an issue

From: <glassfish_at_javadesktop.org>
Date: Thu, 16 Sep 2010 12:57:26 PDT

I guess a little more information.

The business tier which accesses the network devices is accessible from both a presentation tier (Web based) and via a Web service. So to me the queue needs to be per network device (since I want parallel processing for disparate devices) and needs to be in the business tier.

Right now, I have MDB's being invoked off JMS messages to process the requests and this works, however, it does allow multiple simultaneous requests for the same network device as up to N MDB's can be active at one time.

I know JMS messages can be filtered but this does not seem to help as the container is the one invoking the MDB. Because the network devices that are in the system is dynamic, I can't just configure up an MDB configuration per device as this is a deployment configuration issue and i need it to be dynamic.

Pessimistic locking does not seem to help much because if more than one MDB's are activated that reference the same network device, this will tie up the MDB's waiting for the lock while they could be used to process messages for other network devices.

So I am having trouble trying to find the right place to put a queue or a vector of queues. Using MDB's allow me to control the number of devices that are being processed in parallel (MDB pool) but does not prevent multiple MDB's to be accessing the same device.
[Message sent by forum member 'bbergquist']

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