Wednesday 21 May 2014

Communicate Between 2 Weblogic domains using SAF

 

I seen there are lots of material available in internet on implementation of Store And Forward JMS mechanism between two weblogic domains. Here in this blog I’ll repeat the same thing in simpler steps.

Configuration

1. First you need to have 2 weblogic domain up and running , for my case those two domains running on same machine.

2.For both of the domain go to domain name –>security from weblogic admin console .

image  

Select cross domain security enabled and enter credentials and confirm credentials , for my case I’ve given welcome1.It might ask you to restart the server , please do the same.

3. Now assume you are producing one message in JMS queue of domain1 and same should be available to JMS queue of domain2. So in domain1 create a file based persistence store , give physical directory location and target the same to either admin or any managed server. For my case I targeted to SOA managed server.

image

4. Create a new JMS server say TestJMSServer and point to the persistence store that you created earlier

image

5.Create a new JMS module say TestJMSModule and create a new subdeployment say TestSubDeployment which point to TestJMSServer .So whatever the resource will be created under this module will be targeted to TestSundeployment.

image

Here is my Subdeployment tab,

image

6.So now in domain1 we’ll create a TestLocalQ where the message will be produced.So add a queue resource type under TestJMSModule and give a JNDI, I’ve given jms/b2b/TestLocalQ, but it can be any unique thing.

image

7.Then create RemoteSAFContext resource under the same module and give the URL of domain2 like below,

image

The port in the URL may vary depends on where your remote queue deployed, it might be remote admin server as well instead of any managed one.Give the remote weblogic username and password.

8.Now Create a SAFErrorHandling resource under the same module like below,

image

9.Then create SAFImportedDestinations resource and select remote saf context and saf error handling from the dropdown that you have created in earlier steps. Give some prefix for JNDI prefix , it will be useful at later stage.

image

10. Go to the Queue tab of TestSAFImportedDestinations  and create a new SAF queue.Here it will ask for JNDI of local and remote queue . At step 6 we created a local queue with JNDI jms/b2b/TestLocalQ . Similarly create a queue in domain2 with some JNDI say jms/b2b/TestRemoteQ .

image

11. So we almost set, create a Store-and-forward agent from weblogic console.

image

image

12. Bounce the server, both Admin and Managed.We’ll use BPEL JMS adapter to produce message on TestSAFQueue that we created in step 10 and that message should be available to the remote queue having JNDI jms/b2b/TestRemoteQ .

After restarting the server go to SAF agent that you created in step 10 and go to monitoring tab,Verify all the sub-tabs

image

13. Now create a SOA Composite and add a JMS adapter in external reference.

image

Definitely you’ll not find the SAF queue that you created in step 10, so give any other queue name and complete the wizard selecting any XSDs.

14. Edit the jca file of JMS adapter and change the DestinationName to SAF queue JNDI,

image

To find the correct JNDI go to admin console and select the server where you targeted your JMS module and server. In my case I pointed to SOA managed server and click on JNDI tree there,

image

From the list search for JNDI prefix you gave at step 9 and copy binding name , which need to be updated in the JCA file.

image

15.Now deploy the composite and test it

image

Go to domain2 queue and check the message there.

image

Sunday 18 May 2014

Oracle B2B Healthcare Integration With Inbound ADT File

 

In recent time I’m playing with different features available in Oracle Healthcare integration , its really cool one and have enriched GUI. Tons of sample SOA projects available to get start with on OTN , below are links :

http://www.oracle.com/technetwork/middleware/healthcare/learnmore/index.html and https://java.net/projects/oraclesoasuite11g/pages/HealthCare

These will clarify all the concepts which is nothing but same as Oracle B2B product. So couple of things I noticed ,         

  1. when you create a endpoint in healthcare UI , corresponding trading partner in same name getting created in B2B.
  2. Its applicable for creation of agreement and document upload for each trading partners, but healthcare UI put an abstraction layer on B2B , so manipulation of the same are very easy.
  3. If I compare the source code for TPs after exporting the same I can notice one extra property createdByUI="fastpath-ui for healthcare endpoint which is not there for B2B TP, there might be other identifiers will explore that later.
  4. Whenever you will create send to internal queue under internal delivery channel under administration on healthcare UI , same will be created in channel marked as internal of host TP in B2B console.
  5. Whenever you will create receive from internal queue on healthcare UI same channel will be created in Administration—>Listening Channel of B2B console marked as internal.
  6. The last one which I’ll detail in this blog, whenever you configure a endpoint with transport protocol file then corresponding listening channel will be created in B2B which is NOT marked  as internal.

So while exploring the sample project I find that all are getting started using b2bsimulator like below command,                  ant -f b2bsimulator-util.xml b2bsimulatorstart -Dargs="hl7-config.properties"      where properties file have the MILP port for server and multiple clients.But I remember in B2B we used to place a file in a directory from where the listening channel used to poll and pick and interestingly I didn’t find any such sample.So in this blog I’ll go through that use case.

First prepare the SOA composite with healthcare adapter in Jdev using any ADT doc.

image

For receive below is my adapter configuration,

image

For sending the data to lab same document definition has chosen for outbound healthcare adapter configuration.In mediator just assign the value like below,

image

I also set the resequence expression in the mediator,

image 

Now deploy the composite in SOA Server.

Log in to healthcare UI and create a new endpoint with FILE as transport protocol like below,

image

Here give the polling directory and under the composite dropdown select the one that you just created above.Verify the listening channel under B2B console after enabling the same,this is what I said in point 6 above.

image

That’s all, we are ready to go, place a file in the polling folder and from SOA em console you can see the instance,

image

Go to healthcare UI report and verify the same,

image

So like B2B we can also start the healthcare integration from file polling instead of using b2bsimulator.