4

One of our application accepts requests through a message queue and dials a telephony call for every request.

There are 2 telephony systems involved in dialing a call. One has a limitation on number of calls that can be initiated in a second but no limit on parallel calls and other system has a limitation of concurrent calls that can be active at any point in time.

The later requirement is handled in the Java EE layer by having a message queue with a predefined number of MDBs not exceeding the limit.

Can anyone please suggest how do I implement the first limitation (call initiation) in the Java EE layer (weblogic 10.3)?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Kannan
  • 116
  • 1
  • 6
  • 2 questions: 1. Is message sequencing important? 2. Do you want to support clustered environments (the MDB pool exists per JVM)? – home Apr 11 '12 at 05:26
  • Message sequencing is important to an extent (say process in any order before an expiry of 20 mins ). I do not need to support clustering. – Kannan Apr 12 '12 at 12:42

1 Answers1

1

The only idea I come up with is to have a number of MDB's equal to the initiation limit, and have them sleep for 1 second after call initiation, and before getting the next message.

There might be a way to do it in the Queue provider, that isn't necessarily available via JMS. You'd have to check the documentation.

Jim Barrows
  • 3,634
  • 1
  • 25
  • 36
  • Thanks. There are 2 constraints in the participating system, one on call initiation (For e.g 2 calls in a sec ) and the other on maximum parallel calls(100 calls any time) , I have sized the MDBs equal to the maximum parallel calls since we need the maximum throughput reducing the number to call initiation will result in under utilization of the resources. – Kannan Apr 11 '12 at 02:27
  • With my suggestion, you would have 2 MDB's for initiation. Each would initiate a call, and sleep for 1 second. Guaranteeing never having more then 2 in one second. – Jim Barrows Apr 11 '12 at 22:57
  • Let me put it this way, My application receives messages through a Queue , needs to dial a call for each msg received. The telephony system has no limit on the number of calls active at any time but has a limit on call initiations. for e.g i can only initiate 2 calls in a second but can have as many calls active once initiated. By limiting the MDBs to 2 I limit my system's capacity. I am looking for a solution safe to be used in a J2EE context. Please help (MDBs will be active through out the life time of the call which can range from 10 secs to 200 secs) – Kannan Apr 12 '12 at 14:02
  • Ok, I was thinking use the MDB's for call initiation only, and they would delegate to a call handler. The call handler would be around for the 10-200 seconds necessary, leaving the MDB's to just fire up the call handlers. The call handlers themselves could be MDB's, EJB's or pojo's. – Jim Barrows Apr 13 '12 at 16:19