Sunday, August 26, 2012

Enterprise Message Sources (EMS) is used by applications to provide direct Java Message Service (JMS) connectivity to the Oracle BAM Server. Each EMS connects to a specific JMS topic or queue, and the information is delivered into a data object in the Oracle BAM Active Data Cache.

In this Post I will explain you step by step process to configure EMS in BAM.

Step 1: First we need to have JMS queue. So let’s create a JMS queue first.

Go To EM console http://host:port/em


Go To services -> Messaging -> JMS Module -> Choose module under which you want to create JMS Queue(SOAJMSModule) -> New -> Choose Queue

Create JMS Queue


  • Let’s create one queue with name BamQueueTesting
    Queue Name- BamQueueTesting
    JNDI – jms/ BamQueueTesting
Enter JMS Queue Details
Step 2: Now create a new connection Factory.

Go To services -> Messaging -> JMS Module -> Choose module under which you want to create JMS Queue(SOAJMSModule) -> New -> Choose “Connection Factory”

Creat Connection Factory
  • Enter following values for Connection Factory.
        Name – BamQueueTestingCF
        JNDI – jms/BamQueueTestingCF

Add Connection Factory Details

Step 3: Now we will configure EMS in BAM, but before that we need to have Data Object in Bam, so let’s first create Data Object. Go through my Previous Post that explains how to create Data Object in BAM.
We created “BamQueueDataObject” in BAM having below fields.

o   Name
o   ID
o   Address
o   Marks
o   MaxMarks

Step 4: Now Configure EMS.


Choose “Enterprise Message Source” from drop down list and click on create button.

Create EMS
  • Now we need to fill following details.
Fill EMS Details


  • Start entering following details
    o   Name- BamTestQueue (It can be anything as per your requirement and naming standards)
    o   Intial Context Factory- weblogic.jndi.WLInitialContextFactory (Leave it as default)
    o   JNDI Server Provider URL – t3://host:port (t3://localhost:8001)
    Since we created the JMS queue which is targeted to SOA server, so here soa server port will come.
    o   Queue Connection Factory Name- jms/BamQueueTestingCF (JNDI of Connection Factory)
    o   Queue Name – jms/BamQueueTesting (JNDI of Queue)
    o   Data Object Name – Click on Browse and choose the DO which we created earlier.
    o   Operation - Insert

Fill JMS Queue Details
  • Now we will map message in the Queue to Data Object. We will get following message in JMS Queue.
    <?xml version="1.0" encoding="UTF-8" ?>
    <process xmlns:client="http://xmlns.oracle.com/TestApplication_jws/BamQueuTesting/BamQueue" xmlns="http://xmlns.oracle.com/TestApplication_jws/BamQueuTesting/BamQueue">
       <client:Name>test</client:Name>
       <client:ID>89</client:ID>
       <client:Address>mumba</client:Address>
       <client:Marks>99</client:Marks>
       <client:MaxMarks>100</client:MaxMarks>
    </process>

    o   Message Element Name – process (This is root element of the message that we will get in JMS Queue)
    o   Check “Namespace Qualified”
    o   Namespace URI - http://xmlns.oracle.com/TestApplication_jws/BamQueuTesting/BamQueue
    o   Check “Element Tag” as we need to map need Elements in Message in JMS queue to fields in Data Object.

Map Fields

Step 4: Now we are ready for testing. Start the EMS that we created just now and put one message in Queue.

Message in Queue.

<?xml version="1.0" encoding="UTF-8" ?>
<process xmlns:client="http://xmlns.oracle.com/TestApplication_jws/BamQueuTesting/BamQueue" xmlns="http://xmlns.oracle.com/TestApplication_jws/BamQueuTesting/BamQueue">
<client:Name>test</client:Name>
<client:ID>89</client:ID>
<client:Address>mumba</client:Address>
<client:Marks>99</client:Marks>
<client:MaxMarks>100</client:MaxMarks>
</process>

You can see same data in Data Object.

o   Start mapping Data Object fields.

o   Check “Log faulted Message” in case you need to log the message if any error occurs.

EMS Testing


Go Through my previous post which explain how to create Data Object In BAM.






1 comments :

  1. Vivek, How to use JMS Topic in BAM? In your post I think we are using JMS Queue.

    ReplyDelete