Sunday 9 June 2013

SOA Suite 11g: truly singleton with AQ Adapter

If you need to consume messages one by one from an AQ using a composite, here's how you accomplish this.

Go to your dequeue interface and set the following properties:
1
activationInstances = 1
2
singleton = true
 

Binding properties for singleton behaviour


By doing this, you're telling the engine to use only one thread (the activationInstances parameter) on each managed server to do the dequeue, and then you tell it to run the process from just one managed server (the singleton parameter, obviously). If the node elected to run the process goes down, the engine recognizes this and another node is selected to run it, so there's no human intervention associated.

With this configuration, you have only one thread listening to events from the database, but as the nature of AQ is asynchronous, once this thread instantiates a composite, it goes back to the database to get another message. In order to avoid this, you have to change the binding WSDL to include a response.
To keep it simple, I created the output part using the input data structure:
1
<wsdl:portType name="DEQUEUE_ptt">
2
   <wsdl:operation name="DEQUEUE">

3
      <wsdl:input message="tns:WF_EVENT_T_msg"/>
4
      <wsdl:output message="tns:WF_EVENT_T_msg"/>

5
   </wsdl:operation>
6
</wsdl:portType>

Now, you have to add a reply action to your BPEL - if there's no BPEL flow associated to the interface, no worries - when you create it, the reply will be generate automatically. If you already have a flow, update the interface and insert the action:

BPEL with Reply action


That's it. Deploy your project, and it will start consuming messages one by one, no concurrency whatsoever.
Tested with SOA Suite 11.1.1.5.

One last word: my understanding about this approach is that if you need to go this way (environment-wide singleton), there's a slight chance that something is wrong with your design. Check it carefully. I got to this configuration while exploring the adapter's behaviour - not intend to use it anytime soon :-)

Tuesday 4 June 2013

Which Weblogic version is installed

Ever wondered what type of Weblogic version is installed including all the sub components? A simple script shows you this. This info is very usefull for Oracle Support, when you create a service request


$ . setDomainEnv.sh
$ java weblogic.version -verbose

WebLogic Server 10.3.4.0 Fri Dec 17 20:47:33 PST 2010 1384255 ImplVersion: 10.3.4.0
Oracle Service Bus Server Side Dependencies 11.1 Thu Aug 19 02:10:08 PDT 2010 ImplVersion: 11.1.1.4
Oracle WebLogic Server Module Dependencies 10.3 Thu Oct 28 06:03:12 PDT 2010 ImplVersion: 10.3.4.0
Oracle WebLogic Server on JRockit Virtual Edition Module Dependencies 10.3 Thu Sep 23 15:02:15 PDT 2010 ImplVersion: 10.3.4.0
Oracle Virtual Machine Manager Client implementation ImplVersion: 1.1.0.0
WebLogic Descriptors for J2EE 1.5 Wed May 5 14:32:58 EDT 2010 ImplVersion: 1.5.0.0
WebLogic Descriptors for J2EE 1.5 Binding Bundle ImplVersion: 1.5.0.0
WebLogic Specific Descriptors 1.3 Tue Sep 14 18:48:42 PDT 2010 ImplVersion: 1.3.3.0
.....
For more info
http://orasoa.blogspot.sg/2011/05/which-weblogic-version-is-installed.html