This blog post provides a detailed description how to configure and send an email notification with User Notification Service (UMS). In detail it shows how to configure the following properties in a OSB pipeline:

  • the subject
  • the receiver of the email
  • the sender of the email
  • the message body

There exists a lot of interesting blog entries about using UMS, but they don’t show how to set the above email properties in a OSB pipeline. The instructions afterwards are tested with OSB 12.2.1.1.

Prerequisites

  • Prepare an Email Server to receive messages. You can use FakeSMTP (https://nilhcem.github.io/FakeSMTP/) as a simple solution.
  • Prepare a SOA Quickstart environment.
  • Configure and start the IntegratedWebLogicServer in JDeveloper 12.2.1.1.
  • Configure an Email Driver via Oracle Enterprise Manager (see References)

Configuration Steps

1. Open a Service Bus project in JDeveloper (Example: SendEmailTest).

2. In the „External Services“ swim lane activate the context menu and choose the menu Insert Adapters > UMS

3. Specify a name for the UMS Adapter Reference. Example: LocalEmailServer

4. Accept default connection factory settings.

5. Select „Outbound Send Notification“ as operation type. To get an immediate response from UMS also activate checkbox „Receive message ID as reply“.

6. Select „Email“ as notification type. Only specify „To:“ in Email Endpoint Configuration. All other values can be empty because it will be programatically set in the OSB pipeline.

7. Select „Message is String type“ and finish the configuration wizard.

8. Connect the pipeline with the configured UMS Adapter.

9. Open the „SendEmailPipeline“ pipeline in JDeveloper and add a „Transport Header“ activity in the request branch of the routing node.

Sender, Subject and other email properties can be configured by using JCA UMS Adapter properties. Such properties can be set in OSB bei using a „Transport Header“ activity.

10. In „Transport Headers“ configuration select as Protocol „jca“ from the list.

11. Add a new entry in the list, choose „Set“ in column Actions. In column Name select „jca.ums.subject“ from the list. In value enter the appropriate value for the subject.

12. Add 3 additional lines and configure the jca properties „jca.ums.to“, „jca.ums.from“ and „jca.ums.sender“. All these values have to contain valid email addresses.

13. Add a new „Assign“ activity to the pipeline and define a new variable with the name „messageBody“. Select the element „message“ of the XSD generated by the UMS Adapter.

14. Create a new XSLT map with the name „configureMessageBody.xsl“. In this example don’t specify an input source. As Target specify the XSD generated by the UMS Adapter.

15. Modify the XSLT map and provide the message body in the element payload.

16. Configure the „Assign“ activity previously added to the pipeline and add the XSLT map and use the variable messageBody.

17. Add a „Replace“ activity als final step to the pipeline. Configure the following values:

Location = body
Value = $messageBody
Replace Option: Replace node contents

Test

Now everything is prepared to test the email notification. Deploy the project to the IntegratedWebLogicServer and call the OSB service with the test console.

The message  arrived at the email server with the correct receiver …

and the correct message body.

The entire project can be obtained from gitlab.

Summary

In this blog post you saw which configuration steps are necessary to completely take control over messaging in a OSB project using the User Messaging Service from Oracle.

References