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.

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