Business Use Case for the JMS Binding Example

The JMS Binding example shows how to connect the JMS bindings to a simple service component inside ServiceMix.

A hypothetical business scenario, which encompasses the JMS Binding example, is that of a web application making a request for a Tax ID Number (TIN). This example is based on a web-based Tax ID Application form, in which a user enters data, such as first and last name, date of birth, and place of birth. The web Tax ID Applicatoin form sends the request to the "JMSServlet" servlet. The servlet publishes the request on the JMS submission topic. The applicationFormReceiver, which is a JMS Binding component that subscribes to the submission topic, receives the request. The applicationFormReceiver sends the data to the formProcessor via the Normalized Message Router (NMR). The formProcessor is a service engine that assigns the appropriate TIN to the user. The formProcessor then publishes the response to the result topic. A Message Driven Bean (MDB) then subscribes to the result topic, receives the response message, updates the Tax ID database with the new TIN, and notifies the user that the request has been fulfilled. The user can then check the database to get the requested TIN.

The steps below detail the workflow outlined above:

  1. The user fills in the web Tax ID application form, entering data such as first and last name, date of birth, and place of birth, etc.
  2. The web form submits the request to a servlet running in an application server.
  3. The JMSServlet creates a record for the submitter in a database table. Let's say the table contains a RECORD ID, USERNAME and TAXID fields.
  4. The servlet then responds to the user with a page that has a message and a link. The message says, "Check your email for a message that will contain a link for checking TIN status." It also sends an email to the person with a link that says "Click here to retrieve your record." The link contains the record ID and points to a JSP or servlet that can retrieve the user's record. Initially the TAXID field will say "PENDING".
  5. The JMSServlet then publishes the request to the submission topic.
  6. The applicationFormReceiver, which is a JMS Binding component that subscribes to the submission topic, receives the request.
  7. The applicationFormReceiver creates a normalized message and sends it to the formProcessor via the NMR.
  8. The formProcessor assigns the appropriate TIN to the user. The formProcessor then publishes the response to the result topic.
  9. A MDB is also running in the same application server as the servlet. The MDB is listening on the Result topic for the result from the formProcessor.
  10. When the MDB reads the TIN, it updates the user's record in the database.
  11. Now, when the user clicks the link, the TAXID field will have the TIN and it will no longer say, "PENDING"

The diagram below illustrates the process described above:

Online Application for Tax ID No. System

  • No labels

4 Comments

  1. Unknown User (lmalgeri)

    Jason, here's how this example should be modified.

    1. Web Form needs to submit the request to a servlet running in an application server.
    2. The servlet creates a record for the submitter in a datbase table. Let's say the table contains a RECORD ID, USERNAME and TAXID fields
    3. The servlet then responds to the user with a page that has a message and a link. The message says, " Check your email for a message that will contain a link for checking TIN status." Initially the TAXID field will say "PENDING"
    4. The servlet then publishes the request to the submission topic and sends an email to the person with a link that says "Click here to retrieve your record." The link contains the record ID and points to a jsp or servlet in the container that can retrieve the user's record.
    5. Then everything else you have is correct up to the component that is listening on the Result Topic
    6. A message driven bean (MDB) is also running in the same application server as the servlet. The MDB is listening on the Result topic for the result from the formProcessor.
    7. When the MDB reads the TIN it updates the user's record in the database.
    8. Now, when the user clicks the link, the TAXID field will have the TIN and no longer say, "PENDING"

    Note: between steps 5 and 6 you have other steps so subsequent steps will have to be renumbered to take those steps into consideration.

    You will have add some things to the diagram, the application server with a servlet and MDB on it, the database is outside of the app server, make it look like a disk drive, like the one in File binding example, but taller.

    Make the application server look like the one in the WSIF example.

    Maybe you could add a graphic of a person for the object that receives the email and later does the database lookup.
    -----------------------------------------------

  2. Unknown User (lmalgeri)

    Take out the Jencks stuff and the output to the console because you are outputting to the person graphic (via email).

  3. Unknown User (lmalgeri)

    Make sure you include the steps below the diagram to help the reader make sense of what is going on.

  4. Unknown User (nhb)

    1. The servlet then responds to the user with a page that has a message and a link. The message says, "Check your email for a message that will contain a link for checking TIN status." It also sends an email to the person with a link that says "Click here to retrieve your record." The link contains the record ID and points to a JSP or servlet that can retrieve the user's record. Initially the TAXID field will say "PENDING".

    Does this mean that two separate emails are sent initially? wouldn't it be one???