OSB & Oracle BAM: Simple integration

Integration of BAM with other Oracle Fusion Middleware products can be sometimes a little bit tricky. In this article I will show you a simple way of providing data to BAM via OSB.

When purchasing Oracle Fusion Middleware products, many companies will also obtain BAM license but never use it, fearing difficult configuration and integration. However, when working with BAM, I found it pretty straightforward. The only reservation I had, was way of providing BAM with actual data which was in my view not well documented (and forced use of IE of course (: ). But here comes OSB for help. Every operation which is exposed through OSB is potencial source of data. In this tutorial I will explain how to easily integrate BAM with existing OSB services using JMS. I assume that reader has some previous experiences with creating business and proxy services in OSB.

First of all, we have to create JMS Connection factory and JMS Queue in weblogic. There are plenty examples on web, how to do it, i.e. here, and here.

Now, lets assume that we have existing simple SOAP service exposed in OSB and proxy just routes messages to business service. For the sake of this tutorial there was created simple WSDL with just one operation to simulate whole process.

 

OSB proxy flow

First, we have to creat new Business service, which will send data to created JMS queue. Lets name it BamBS

OSB JMS Business service creation

Choose jms as protocol. Add URL of your JMS queue. In my case, I created JMS connection factory with jndi name jms/OsbBamConnFactory and JMS queue with jndi name jms/OsbBamQueue so the resulting URL will look like this: jms://host:port/jms.OsbBamConnFactory/jms.OsbBamQueue - slash in jndi name is replaced with dot

OSB JMS Business service creation

Select Queue as Destination Type and Text as Message Type

OSB JMS Business service creation

When creation of business service is finished, we have to change original proxy routing, so it sends every message to BamBS: Select Edit Message Flow -> Click on proxy -> Add Pipeline Pair -> Add stage -> Edit stage

OSB change proxy flow

We will now publish messages to BamBS

OSB publish messages

Select service

OSB Business Service selection

Save all changes. When CreateUser operation is called, message is now send also to JMS Queue. Lets test if everything works.
Launch test console and execute call

OSB test proxy

Go back to Weblogic console, select JMS QUEUE you created and select monitoring tab. Select queue and click on Show Messages. 

Weblogic JMS messages

Now select message and you will see whole content of message

Weblogic JMS message overview

So that was OSB part. Are you tired already? Dont despair, the sweet end is near :) We will now move to BAM console. Log in to BAM console, and select Architect tab.

BAM main screen

We have to create BAM data object, which will hold values which come from JMS Queue. In top left corner select Data Objects and choose directory, where you want to put your object. In my case it is in Samples directory. Select Create Data Object.

BAM Data Object creation

Name the object and add required fields. Sometime it takes a little bit longer to create data object. It may look like nothing is happening for while, quite the contrary. 

BAM Data Object creation

We now have to create Enterprise Message Source to pull data from JMS Queue. In top left corner select Enterprise Message Sources and select Create

BAM Enterprise Message Source creation

Name Message source, fill JNDI Service Provider URL, Connection Factory Name and Queue Name and select created data object

BAM Enterprise Message Source creation

Fill data correspondingly to your message element and map message to data object. Save configuration. It may take a while again :)

BAM Enterprise Message Source creation

Enterprise Message Source is stopped when created. You have to start it first to receive messages.

BAM Start Enterprise Message Source

Now, thats it. All is set up. When you now look back to your data object, in content tab, you can see message which arrived from JMS queue (if not, send it again).

BAM Enterprise Message Source test

You can now create dashboards with graphs and charts containing KPIs, showing realtime data which flow through your webservices exposed in OSB.

Publikované: 10. dec 2014 15:02 | Počet prečítaní: 5911
  • Martin Mitro

    Java Developer

    Martin v Davinci software pracuje ako Java Developer, ale venuje sa aj databázam. Vo voľnom čase pracuje na appkách pre Android, ktoré ho, podľa jeho slov, urobia boháčom. Medzi kolegami si buduje povesť veľkého fanúšika Mira Jaroša. Jeho obľúbeným hudobným štýlom je však electro. Zo športov mu najviac imponuje reálny futbal (žiadna FIFA). Neznáša kolobežkovanie.

We want you

Do you see yourself working with us? Check out our vacancies. Is your ideal vacancy not in the list? Please send an open application. We are interested in new talents, both young and experienced.

Join us

Podobné články