Understanding CEI models

The CEI supports two models: component and deployment

  • CEI component model—In this model, several components support the CEI with dependencies that exist among them, as described in the diagram that follows. The client is only dependent on the CEI interfaces and is completely separated from their implementation. This allows for the implementation to change at a latter date without affecting the client.

    The QueuedWorkManager interacts with both the ScheduledWork queue and the CompletedWorkQueue directly. The QueuedWorkProcessor receives messages form the ScheduledWork queue via the EJB container but places messages in the CompletedWork queue directly.

    The class diagram shows the interaction of the Client, Work Manager, Work Processor, and queues
  • CEI deployment model—In this model, the CEI is deployed in every EJB container where there is a client requiring it, as shown in the following diagram. Each EJB container in clustered environments must be set up with its own pair of ScheduledWork and CompletedWork to guarantee that the responses return to the EJB container that produced the request message.
    Concurrent Execution Infrastructure deployed with an EJB Container

    The queues are set up as transient; that is, in case of failure, all scheduled items are lost. For this reason clients should use the timeout to avoid deadlocks.

    Most importantly, the listener port must be configured to allow for more than one message driven bean instance to process messages simultaneously. The larger this number, the higher the degree of concurrency, although a number that is too large will produce trashing. Typically, the longer the average duration of the work execution is, the higher the degree of concurrency.