Monday, March 16, 2020

12c SOA - JMS adapter - publish a message to a distributed queue

Implementation steps:
Create a SOA Project
 
 Create a XSD
 <?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>
 Drag and drop JMS adapter




 Choose publish Message
 select Destination Name

 Use Default JNDI.
 Use the schema


 drag and drop a Oneway BPEL



 Take a Invoke activity and wire with JMS partnerlink.


 assign the inputs

 Deploy and test
 You can see that message has been published to distributed queue.

 From Admin console,
To set custome JMS Header properties ⏩12c-soa-set-custom-jms-header-property

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

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...