Wednesday, October 13, 2010

Consuming TIBCO EMS Topic Message from Oracle SOA 11g Application

The previous article describes how FileGateway publishes its data transformation completion event. We will see in this article how another application consumes this event.

In this example, we will create a simple Oracle SOA 11g Application that contains a JMS listener and a file writer.

The use case
Trigger:
JMS Message arrives in FGW.FILEREADY topic.

Flow:
1. JMS adapter receives message.
2. Mediator component maps the input (JMS body) to the input of a File Adapter.
3. File adapter writes the JMS message body into a local file.
4. End of use case.

The Steps
1. Create an empty Oracle SOA 11g Application. Name it as DataLoader. Create a new project called WaitFile within DataLoader. Ensure the fileInfo.xsd created in the previous article is included in this project.

Figure 1: Empty Oracle SOA Application in JDeveloper, with fileInfo.xsd

2. Configure the JMS Adapter
Double click on the composite.xml to open the composite editor. From the "Component Palette" on the right, drag the "JMS Adapter" into the "Exposed Services" pane of the composite editor.

Configure the following:
  • In Step 2 - Service name: WaitFile
  • In Step 3 - Select Third Party JMS Provider
  • In Step 4 - JMS Connection JNDI Name: eis/tibjmsDirect/Topic
  • In Step 5 - Select Define from operation and schema (specified later)
  • In Step 6 - Operation Type: Consume Message, Operation Name: Consume_Message
  • In Step 7 - Destination Name: FGW.FILEREADY. This is the topic name defined in the TIBCO EMS.
  • In Step 8 - Browse for fileInfo in the xsd file.WaitFile
    • Figure 2: Browse Message Schema
    • In Step 9 - Click Finish

    3. Configure the File Adapter
    From the "Component Palette" on the right, drag the "File Adapter" into the "External Refereces" pane of the composite editor.

    Configure the following:
    • In Step 2 - Service name: WriteFileInfo
    • In Step 3 - Select Define from operation and schema (specified later)
    • In Step 4 - Operation Type: Write File, Operation Name: Write
    • In Step 5 - Directory for Outgoing File (physical path): C:\. File Naming Convention (po_%SEQQ%.txt): fileInfo_%SEQ%.txt
    • In Step 6 - Browse for fileInfo in the xsd file.WaitFile
    • In Step 7 - Click Finish

    4. Configure the Mediator
    From the "Component Palette" on the right, drag the "Mediator" into the "Components" pane of the composite editor.

    Configure the following:
    • Name: Mediator1
    • Template: Define Interface Later
    • Click the OK button

    5. Wiring the service, component and reference in the composite.



    Figure 3: Wired service, component and reference

    6. Configure the Mediator
    Double-click the "Medialtor1" component to bring up the mapper. Create a new mapper file, accept the default file name.


    Figure 4: Create new transformation map


    Drag to map the entire source node (imp1:fileInfo) to target node (imp1:fileInfo)

    Figure 5: Mapped source and target

    7. Configure the JMS Module in Oracle SOA Admin Server console
    Make sure your SOA Admin server is started for your domain. Point your browser to http://localhost:7001/console assuming your server runs locally.

    Under the "Domain Structure" menu, click on the "Deployments" menu. Locate the "JmsAdapter" in the Deployments table. Click on the "JmsAdapter", the setting page of "JmsAdapter" is displayed.

    Figure 6: Domain Structure -> Deployments

    Instead of creating a new JMS connection pool, we will just modify the existing pool, for the sake of simplicity. You can always create your own connection pool dedicated to consuming messages from the FileGateway.

    Click on the Configuration tab, then the Outbound Connection Pools sub-tab. Then click on the "eis/tibjmsDirect/Topic"


    Figure 7: Outbound Connection Pool table

    In the "Properties" tab of "eis/tibjmsDirect/Topic", enter the required parameter values for FactoryProperties, Password and Username, then click "Save"

    Figure 8: Connection pool property configuration

    You need to re-deploy the JmsAdapter for the change to be effective. The changes you have made will be stored in a deployment plan.

    Back to the "Deployments" menu. Check the checkbox to the left of "JmsAdapter" and click the "Update" button at the top of the "Deployments" table. Re-deploy the application, create a new plan if necessary.

    Figure 9: Update JmsAdapter deployment

    Figure 10: Deployment plan

    Figure 11: Deployment plan

    8. Deploy the WaitFile SOA 11g application into the soa_server1. (assuming you have created a soa managed server)

    Figure 12: WaitFile composite deployed

    9. Start TIBCO EMS server (make sure you have carried out the steps described in this article). Run FileGateway in TIBCO Designer test mode. A JMS message should be sent out as soon as the data transformation is completed.

    10. Inspect the execution trail and instance information in the dashboard of WaitFile composite.

    Figure 13: Dashboard

    11. Inspect the File adapter output file in the output directory.
    We configured the file adapter to output in c:\, so you should find a file "fileInfo.txt" under this folder. Open the file and inspect the content, you should get something like this.

    
       EMP-OUT00A-20101013-10-21-56.XML
       1646
       2010-10-13T10:21:56.296+11:00
       
          
          
          
          
       
    
    

    Voila, that is a proof of concept of how to connect to and consume JMS message of a TIBCO JMS topic from an Oracle SOA 11g Application.

    Download the Oracle SOA 11g Application source code (JDeveloper project) here.

    Cheers,

    12 comments:

    1. It is very good blog and useful for students and developer , Thanks for sharing
      Thanks for sharing this amazing blog

      Oracle SOA Online Training

      ReplyDelete
    2. Quick delivery when I decided to Buy instagram followers . Support team was helpful throughout the process.
      COQ2L

      ReplyDelete
    3. Quick delivery when I decided to Buy instagram followers . Support team was helpful throughout the process.
      VVZV

      ReplyDelete
    4. Quick delivery when I decided to Buy instagram followers . Support team was helpful throughout the process.
      0Z2G

      ReplyDelete
    5. Quick delivery when I decided to Buy instagram followers . Support team was helpful throughout the process.
      ZBQZM

      ReplyDelete
    6. Quick delivery when I decided to Buy instagram followers . Support team was helpful throughout the process.
      E428MN

      ReplyDelete
    7. Web sitesi kurma konusunda verdikleri hizmet muhtesem. 2 gunde sitem hazirdi.
      LE7

      ReplyDelete
    8. Web sitesi kurma konusunda verdikleri hizmet muhtesem. 2 gunde sitem hazirdi.
      3AVB4F

      ReplyDelete