Wednesday, March 18, 2020

12c SOA -UMS Adapter send outbound email

To send an outbound email, we have to configure following 2 steps:
  • Email driver setup.
  • UMS adapter configurations.
Here I will show you the UMS adapter configuration and send outbound emails without attachment.

Implementation:
Create a SOA project.


 Create a XSD:


 <?xml version='1.0' encoding='windows-1252'?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.email.soa" targetNamespace="http://www.email.soa" elementFormDefault="qualified">
   <xsd:element name="EmailInput" type="EmailType"/>
   <xsd:complexType name="EmailType">
      <xsd:sequence>
         <xsd:element name="Email">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="EmailContent" type="xsd:string"/>
<xsd:element name="EmailSubject" type="xsd:string"/>
                  <xsd:element name="From" type="xsd:string"/>
                  <xsd:element name="To" type="xsd:string"/>
                  <xsd:element name="EmailAttachmentString" type="xsd:string"/>
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
</xsd:schema>

UMS Adapter Configuration:






 Create a BPEL Process



 Take a invoke and call the UMS partnerlink

 Assign the email content.

 In the invoke properties, we will assign the jca to from etc. properties.
 Deploy and test


Tuesday, March 17, 2020

12c SOA - JMS Message rollback

Introduction:
When a JMS adapter consumes a message from a Weblogic JMS queue/topic, the message is removed from it. Imagine a situation where a SOA process consumes a messages from a JMS through JMS adapter but the process fails before its execution is complete. This will lead to message loss as the message was already removed from the JMS and cannot be recovered even if the SOA transcation is rolled back. JMS adapter in Oracle SOA behaves as an asynchronous service (one-way service). This will cause the BPEL engine to split the execution into two parts.
  • First, and always inside the caller transaction, the insert into the dlv_message table, and
  • secondly the transaction & new thread that executes the workitems, and creates a new instance.
Hence the JMS adapter and the SOA components (BPEL and Mediators) work in different transactions. The message consumed by JMS adapter from JMS is stored in dlv_message table and the transaction is committed. The BPEL worker threads then picks up the message from the dlv_message and executes in a different transaction.In case of any error in the BPEL process the message from the JMS is lost and cannot be retried.



 Following way we can rollback the JMS messages without losing them in case of any error in the BPEL process.

Solution: Using Synchronous process
we modify the wsdl of the JMS adapter.
The wsdl of the JMS adapter that is generated is asynchronous(one-way) we change it to synchronous.

Add an empty element in the schema of the wsdl.
<element name="empty"/>
Create a new message type.
<wsdl:message name="Ignore_Message_msg">
<wsdl:part name="ignore" element="empty"/>
</wsdl:message>
Add an output to the operation in the wsdl with the newly created message.
<wsdl:output message="tns:Ignore_Message_msg"/>
This will make the wsdl as synchronous.

In the BPEL, add a reply activity and connect it to the JMS adapter, when asked for variable just mention the message type you have just created in the wsdl.
Note: In this approach we need not to add following properties in the Composite.xml file.
  • bpel.config.transaction
  • bpel.config.oneWayDeliveryPolicy

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

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