Tuesday, October 23, 2018

Dynamic Partnerlink in BPEL | SOA

How to setup dynamic partnerlink in BPEL. This is used to override the targetsystem URL in the run time. The URL can be stored in AIAConfigurationProperties.xml or variable or URL can be received as input too.

  • Create two variables(TargetEndpointLocation & EndpointReference) as shown below.

For variable "EndpointReference", you can download the schema from below url.

  • Then create an Assign activity with 3 copy actions. Assuming "TargetEndpointLocation" variable already have the Address URL.


Source Code for this assign:
<assign name="AssignPartnerlinkEndpointReference">
<copy>
<from>
<wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<wsa:Address/>
</wsa:EndpointReference>
</from>
<to variable="EndpointReference"/>
</copy>
<copy>
<from variable="TargetEndpointLocation"/>
<to variable="EndpointReference"
                query="/wsa:EndpointReference/wsa:Address"/>
</copy>
<copy>
<from variable="EndpointReference"/>
<to partnerLink="OrderManagementOSM"/>
</copy>
</assign>

Note: If you are using AIA, you can use the below java code to retrieve the URL from AIAConfigurationProperties.xml




Monday, July 30, 2018

WLST Script : To Create CFS Key in EM Console - SOA

How to Connect to WLST?

Run ./wlst.sh command under $ORACLE_HOME/common/bin/wlst.sh

It will be in offline mode. So,
connect()
Enter username and password along with your admin host and port.



Once its online, Run the below command.

How to Create CFS Key?

createCred(map="mapName", key="keyName", user="userName", password="passW", [desc="description"])

Sample: createCred(map="oracle.wsm.security", key="Test-key", user="username", password="pwd123", desc="Test WLST")



As you can see the command has created the Key Successfully. To verify, you can login to EM Console and validate the same.
http://adminhost:port/em/
Expand Weblogic domain -> Right Click on SOA Server ->Security->Credentials




Other Operations you can perform on CFS key's are,
  • listCred - returns the list of attribute values of a credential in the domain credential store with given map name and key name
  • updateCred - modifies the type, user name, and password of a credential in the domain credential store with given map name and key name.
  • deleteCred - removes a credential with given map name and key name from the domain credential store


Thursday, July 19, 2018

How to Disable a Proxy Service in OSB

Login to SBConsole.
Select the proxy service you want to disable.
Navigate to "Operational Settings" tab.
Disable the Check box on State.




Save the changes.
Activate the Session.

JMS Topic and Subscribers in OSB Proxy service

JMS Queue vs JMS Topic

JMS Queue is Point-to-point solution based on Publisher/ Subscriber model, which means there can be only one Subscriber per queue. If the Subscriber is down, the messages will persist in the queue until the Subscriber comes up. Once the Subscriber is up, the message will be consumed and processed.

JMS Topic is a distribution mechanism for publishing messages that are delivered to multiple subscribers, which means there can be multiple subscribers per Topic. Single message can be consumed by multiple subscribers and processed individually. 


  • With Durable Subscription Enabled in Proxy :- If one of the subscriber is down, the message will be persisted in Topic till that subscriber is available.However the same message will be consumed by other consumers.

  • With Durable Subscription Disabled in Proxy :- If one of the subscriber is down, the message will not be persisted in Topic. However the message will be consumed by other consumers(whatever is up and running).
So based on your scenario you can decide whether to create a durable subscriber or not. We will see both the options here.

First lets create a JMS Topic.
Login to Weblogic console. Navigate to JMS Module and select the module you want to create the topic.









You can select one of your JMSServers as the Target.

We have the JMS Topic ready, now we can start creating the Subscribers in OSB Proxy Service.

Login to SbConsole and Create a new Project.
And Create a new Proxy Service with service type as "Any XML Service"



Select JMS as Protocol and enter host,port and Jndi name of topic.
Sample: jms://22.22.22.22:7001/weblogic.jms.XAConnectionFactory/test.topic


Select option as "Topic"


This is the place where you have to  decide whether you need Durable Subscriber or not.!!! First lets create Proxy service with Durable Subscription disabled.



Now click Last and save the configuration.

Lets add a alert in the proxy pipeline .So that we can validate the execution of Proxy service.

** assuming you already a alert destination.
 

Now create a another proxy service to listen to the same topic. (you can just clone the first proxy service) and edit the alert summary as "Testing Topic -Proxy Service 2".

Now we have created 2 proxy service listening to the same JMS topic.

So once you produce the message, both proxy service should consume the message and create the alert messages.

To produce the message into topic, i'm creating a new business service with same JNDI details. (testing purpose).
Finally  your project will look something like below.


Activate the Session.

And your Topic will look like below.


Since you have created a proxy without durable subscription. you will not see any rows in Durable subscribers tab.


Execute the Business Service with some sample XML.
You will immediately see 2 alerts generating in the operations tab.


Hence you can confirm your message have been picked up by both proxy service and your subscribers are working fine.

******************************************************************

Now lets enable the durable subscription in proxy service(both proxy service).

Once you have enabled the durable subscription and activated the session. You  can see the changes in weblogic console as well. Now Durable subscribers tab will have 2 new rows and its status.



You can test the scenarios, like 
Keep both proxy services up and running, see what happens.
Disable one of the proxy service and see whether the messages are stored in Topic.
Disable both proxy service and see what happens.

How to disable a Proxy Service ? Click here

Monday, June 18, 2018

Disable Auto Compile in Jdeveloper 12C after saving Composite.xml

One of the (annoying)feature which gets enabled by default after installing Jdeveloper 12c is auto build after saving composite.xml

To disable the same, Navigate to  Tools->Preferences->Code Editor->Save Actions and delete the below action (Build Project after save).



Pause JMS Queue Message Consumption At Server Startup - Weblogic

How do we pause JMS Queue Message Consumption at Server Startup/ Restart

  • Login to Weblogic Console.
  • Navigate to JMS Module-> Module name -> Select the Queue you want to pause.
  • In Configuration-> expand Advance and enable the check box at Pause Message Consumption At Startup
After you finish, You must restart Server for the changes to reflect.





If you want to pause all the queues hosted in JMS servers, You can do the same configuration in JMS servers as well.

Navigate to Services >Messaging > JMS Servers> select the JMS server
  • In Configuration-> expand Advance and enable the check box at Pause Message Consumption At Startup

Saturday, May 26, 2018

How to Verify/Apply the Patches Applied to an Oracle Home

To List the patches applied to your Oracle Home.

Go to Oracle Home and Run opatch under OPatch Folder
(Provide the full path for Oracle Home while running the command)

/soa/oracle/OPatch/opatch lsinventory



How to Apply Patch

Extract the Patch folder you downloaded from Oracle Support Site.
Go into the Extracted folder and run below command. Before Running, make sure you shutdown all the servers including admin server.
$ORACLE_HOME/OPatch/opatch apply
Example: /soa/oracle/OPatch/opatch apply




Saturday, May 19, 2018

How to create Proxy Server in OSB Business Service | SOA 12C

For few of the web services with downstream systems, we need to invoke them via a proxy servers.
In the below screenshot, i have shown the how to create a proxy server and associate it with Business service in OSB.

Expand System project(which is a default project with empty folders in OSB).
Select Proxy Server.


Right Click on Proxy Servers folder, then Create -> Create Proxy Server.

 Give a Proxy Server name and details, as shown below.



Once the Proxy Server is created successfully, Open your Business Service and select the Transport Detail page. In the Advanced Options, select the Proxy server you have created in the previous step.


And you are done!!

Thursday, May 17, 2018

The invocation resulted in an error: Server chose TLSv1, but that protocol version is not enabled or not supported by the client.

Error while invoking HTTPS URL from OSB Business service.

Error Message: The invocation resulted in an error: Server chose TLSv1, but that protocol version is not enabled or not supported by the client.

Steps to Resolve: 
  • Open weblogic console., Click on Servers

  •  Click on OSB Server

  • Navigate to Configuration->Server Start



  • Add the below property in Arguments

Dweblogic.security.SSL.minimumProtocolVersion=TLSv1


Now Restart the OSB Server for the changes to reflect.

Reference: https://docs.oracle.com/middleware/1213/wls/SECMG/ssl_version.htm#SECMG636

Wednesday, May 16, 2018

ESS (Enterprise Scheduler Service) for Inbound JCA Adapters in SOA 12C

Enterprise Scheduler Service (ESS) is a scheduler that is part of SOA Suite 12c. ESS supports a number of scheduling activities around the SOA Suite.
With the help of em console, we can manage job requests, define metadata and schedule jobs, and APIs to define metadata and create schedules in ESS.
In this section, we are going to create a schedule and assign it to a Inbound JCA (jms,file,db polling,etc..) adapter.

Scenario: Deactivate the DB adapter at 10 PM everyday and activate it back at 8 AM next morning. In this case, records created  by system between 10 PM to 8 AM will not be processed immediately.

Expand Scheduling Services, Right click on ESSAPP. Job Requests-> Define Schedules.


Click on Create to create a new schedule.

Now we have to create 2 Schedules, One for activation and other for Deactivation. (Sequence doesn't matter)
Please note that package have to be mentioned as "soa".
First Deactivation,
 Now Activation,



If you want to look at the schedules, you can just click on name of one the schedules.


Now you can go to your composite, And click on adapter.

 Click on calendar icon on the right corner.

Select the schedules created in above steps and click on Apply Schedules.


And you are done!!!!

Note: I have experienced a issue with clustered ESS servers, the schedules created were not displaying in the adapter. So i brought down one of the ESS server and tried the same and it worked. Not sure whether its product bug, so keep this as a workaround if adapters are not showing the schedules created.