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