The previous message is accurate from the model point of view for sending orders or requests to the queue asynchronously, and then they can be received later. However, in reality it does not address the issue of lengthy processes.
Regarding queues and topics, the advantage of constant queues is that if there are no consumers in the queue, messages will wait for consumption until a subscriber appears. In the topic, you need to create a long-term subscription to make sure that a consumer who is not connected will receive messages that are sent in his absence after reconnecting.
So how do you define a lengthy process? For a multi-step process, you usually use something like a workflow mechanism. There are options like a BPM tool or something like "Workflow OS." You can also make a home solution, which may look like an example below
1) There must be some definition of the workflow that defines the steps in the process. It can be a properties file or an XML file. 2) The web application puts a message in a queue or topic (pub / sub) indicating the process that should be performed (or you can have specific destinations for different processes) 3) MDB dispatcher selects the "order" from the queue with the status "NEW "and begins processing the first step. 4) As soon as the step is completed, the MDB places a new message in the queue indicating the process to be executed, and either the next step to be performed or the last step to be performed (depending on how deterministic you want this process to be was) 5) MDB picks up the message and sees that the process is "IN_PROGRESS". It either determines the next step that will be executed, or reads the step that will be performed further from the message (either the value of the JMS header, or inside the message, possibly in XML format) 6) Steps 4 and 5 are repeated until the process instance is completed
In this case, you will need an external view of the order information and the process instance. This will allow you to check the status of the request from your WebApp. Your order must be read and saved with an updated status after each step of the process so that WebApp can access status information.
A key component of this architecture is the MDB manager, which listens for messages and performs the next step in the process. When I worked with OS Workflow, this was one key thing that was missing. Thus, you can control the number of threads performing process steps by controlling the number of MDBs in the pool and consumers in the queue. In this architecture, I would recommend a topic queue for workflow steps. However, after each step of the process, you can post a message to a topic for subscribers to get updated status information.
With Java EE6 technologies, including JPA, you can easily create an XSD, create a POJO domain data model with JAXB, and use JPA to save. This year we conducted an online broadcast that covered JEE6 technologies, which are currently supported by WebLogic. Here are the repetitions: http://www.oracle.com/technetwork/middleware/weblogic/learnmore/weblogic-javaee6-webcasts-358613.html .
I am also interested in talking with you about your JBoss migration :) jeffrey.west@oracle.com