Friday, March 13, 2020

12c SOA - Configure Retry-able Jms Queue

JMS queues are used for reliable messaging. In some scenarios we need to configure retry able JMS queues that means when something error out in transaction ,we want that it should retry the same message multiple times.

Follow below steps to configure retry-able JMS queue.

Go to your JMS queue⇾Go to "Deliver Failure" tab 

Fill required values
Redelivery Delay Override : Time interval between retries. It is in milliseconds.
Redelivery Limit: number of retries
Expiration Policy:
     Redirect : redirect message to different queue.
     Log : log the message.
     Discard : discard message and it will be lost.
Error Destination: If you choose "Redirect" then choose the queue to which you want to redirect message.


12c SOA - JMS adapter - consume a message from a distributed queue


Implementation steps:
Create a SOA project and drag and drop jms adapter to the exposed service lane
 Select Oracle Weblogic JMS
 Select Appserver connection or create one to use.

 select Consume Message option
 Browse for Destination name.
 Search Queue name
 Put default JNDI eis/wls/Queue or if u want, use your created one.
 select the schema for the message to be consumed.



XSD used:
<?xml version= '1.0' encoding= 'UTF-8' ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cal.org" targetNamespace="http://www.cal.org"
     elementFormDefault="qualified">
    <xsd:element name="process">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Id" type="xsd:string"/>
                <xsd:element name="FirstName" type="xsd:string"/>
                <xsd:element name="LastName" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

 create a BPEL process and use the same schema.


 wire the JMS adapter to BPEL Process
 delete the default one and wire with JMS Service partner link.

 Deploy the service to EM console and create a message manually to the queue from Admin console or publish a message to the queue.
XML payload used:
<?xml version="1.0" encoding="UTF-8" ?>
<process xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cal.org emp.xsd"
         xmlns="http://www.cal.org">
  <Id>1</Id>
  <FirstName>Sri</FirstName>
  <LastName>Das</LastName>
</process>

 Bang! It is successfully consumed.

Friday, March 6, 2020

LINUX - UNIX - AIX commands -3 Ways to Create a Text File Quickly Through the Linux Terminal

3 Ways to Create a Text File Quickly Through the Linux Terminal

  • The cat command
  • The touch command
  • The standard redirect symbol

Here i am showing only the cat command:

The cat Command:
The cat command is very helpful when dealing with text files in Linux. It helps you in achieving three basic purposes:

  • Creating a text file
  • Printing contents of a text file in your Terminal
  • Printing contents of a text file to another text file

Creating a text file:
Enter the following command in your Terminal:
$ cat > filename.txt

After entering this command, the next prompt will not appear; rather the cursor will display for you to enter the text for the file you just created
Once you have entered all the text, hit enter to move to the next line and then use the Ctrl+D control to tell the system that you are done with entering the text. The usual command prompt will then appear for you to move on with further operations.

Printing contents of a text file in your Terminal:
Through the cat command, you can then view the contents of the file as follows:

$ cat filename.txt
Printing contents of a text file to another text file:

$ cat filename.txt > $ cat filename1.txt

Wednesday, March 4, 2020

Unix or AIX - SFTP or SSH - no matching host key type found. Their offer: ssh-dss

While we are doing sftp or ssh from unix/AIX box, we came across with the following error:

Error:
Unable to negotiate with {IP} port 22: no matching host key type found. Their offer: ssh-dss

Solution:

Temporary fix:
Instead of using the command: sftp user@host or ssh {IP}, Use the following:

sftp -oHostKeyAlgorithms=+ssh-dss user@host
or
ssh -oHostKeyAlgorithms=+ssh-dss {IP}

Permanent fix:
Create a file called “~/.ssh/config” with the following content:
Host {IP}
HostKeyAlgorithms=+ssh-dss

Command:
cat > ~/.ssh/config
Host {IP}
HostKeyAlgorithms=+ssh-dss

Than press CTRL + D to save it.

Note: If you mention empty above file then you will get following error:
/home/oracle/.ssh/config: line 1: Bad configuration option: \001.
/home/oracle/.ssh/config: terminating, 1 bad configuration options

Monday, February 24, 2020

12c SOA - DVM - lookup multiple domain values

Here I will show you how to get multiple domain values from a DVM using dvm:lookupValue1M() function.

Implementation steps:
Create a SOA Project


 Select Empty composite
 Create the contract schema which is used for exposing the client.



 <?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.citydetails.poc"
            targetNamespace="http://www.citydetails.poc" elementFormDefault="qualified">
  <xsd:element name="clientRequest">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="cityName" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="clientResponse">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="cityName" type="xsd:string"/>
        <xsd:element name="cityCode" type="xsd:string"/>
        <xsd:element name="state" type="xsd:string"/>
        <xsd:element name="capital" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema> 

Create WSDL based on this schema.



 Take a BPEL Process and select based on wsdl template and choose the created the wsdl.




 Create a City DVM



 In the BPEL, Drag and drop Transformation activity and use dvm:lookupValue1M() function to get multiple values and store them in a variable and then use the variable in fields mapping.

We use dvm:lookupValue and dvm:lookupValue1M XPath functions to look up a domain value map for a single value or multiple values at runtime from DVM tables. Here I have used the dvm:lookupValue1M Xpath function in XSL to get the city detail by passing CityName as a KeyColumn to lookup dvm table.

XSLT:
 <?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator" xmlns:oracle-xsl-mapper="http://www.oracle.com/xsl/mapper/schemas" xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue" xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction" xmlns:oraxsl="http://www.oracle.com/XSL/Transform/java" xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.citydetails.poc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions" exclude-result-prefixes=" oracle-xsl-mapper xsi xsd xsl ns0 socket dvm mhdr oraxsl oraext xp20 xref"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:tns="http://xmlns.oracle.com/SOAApplication/DVM1ToManyProject/cityDetails">
   <oracle-xsl-mapper:schema>
      <!--SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY.-->
      <oracle-xsl-mapper:mapSources>
         <oracle-xsl-mapper:source type="WSDL">
            <oracle-xsl-mapper:schema location="../WSDLs/cityDetails.wsdl"/>
            <oracle-xsl-mapper:rootElement name="clientRequest" namespace="http://www.citydetails.poc"/>
         </oracle-xsl-mapper:source>
      </oracle-xsl-mapper:mapSources>
      <oracle-xsl-mapper:mapTargets>
         <oracle-xsl-mapper:target type="WSDL">
            <oracle-xsl-mapper:schema location="../WSDLs/cityDetails.wsdl"/>
            <oracle-xsl-mapper:rootElement name="clientResponse" namespace="http://www.citydetails.poc"/>
         </oracle-xsl-mapper:target>
      </oracle-xsl-mapper:mapTargets>
      <!--GENERATED BY ORACLE XSL MAPPER 12.2.1.0.0(XSLT Build 151013.0700.0085) AT [MON FEB 17 13:56:32 IST 2020].-->
   </oracle-xsl-mapper:schema>
   <!--User Editing allowed BELOW this line - DO NOT DELETE THIS LINE-->
    <xsl:variable name="CityDetails"
   select="dvm:lookupValue1M('DVM/CityDetails.dvm','CityName',/ns0:clientRequest/ns0:cityName,'CityCode','State','Capital')"/>
   <xsl:template match="/">
      <ns0:clientResponse>
         <ns0:cityName>
            <xsl:value-of select="/ns0:clientRequest/ns0:cityName"/>
         </ns0:cityName>
         <ns0:cityCode>
            <xsl:value-of select="$CityDetails/CityCode"/>
         </ns0:cityCode>
         <ns0:state>
            <xsl:value-of select="$CityDetails/State"/>
         </ns0:state>
         <ns0:capital>
            <xsl:value-of select="$CityDetails/Capital"/>
         </ns0:capital>
      </ns0:clientResponse>
     
   </xsl:template>
</xsl:stylesheet>
 Deploy and test


Wednesday, February 19, 2020

12c SOA - Weblogic - how to modify datasource connection and resume the suspended datasource services

Implementation steps:
Go the Admin console⇾Domain⇾Services⇾Data Sources
 Click on the data-source to be modified.
 Go to the Connection pool tab

Take the lock and update the connection

Update done. Restart the impacted manage servers.(Domain⇾Environment⇾Servers⇾Control tab)
Go to Monitoring tab⇾Testing and test the data source on servers.
If any server is suspended then go to the control tab and resume the suspended servers.
Yes
The data source instances are resumed.
Go back to monitoring tab⇾testing and test all the data-source instances.

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...