Go to primary content
Oracle® Retail Service Backbone Developers Guide
19.0
F23588-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

4 Introduction to Alerts

Alerts are generated by OSB monitoring framework and they help to diagnose problems when they occur. Oracle Service Bus provides two types of alerts:

Pipeline/Business Alerts

Pipeline alerts can be raised in the message flow of the proxy service. You can use alerts in a message flow for:

  • Detecting business errors in a message flow.

  • Indicating business occurrences.

SLA Alerts

SLA alerts are raised in Oracle Service Bus to indicate potential violation of the Service Level Agreements (SLAs). You can use SLA alerts for:

  • Monitoring and generating email notification of WS-Security errors

  • Monitoring the number of messages passing through a particular pipeline

  • Detecting the violation of service level agreements with third-party products

  • Detecting a non-responsive endpoint

Consider the following use case to verify the service level agreements:

Assume that a particular proxy service is generating SLA alerts due to slow response time. To investigate this problem, you must log in to the Oracle Service Bus Administration Console and review the detailed statistics for the proxy service. At this level, you can identify that a third-party web service invocation stage in the pipeline is taking a lot of time and is the actual bottleneck.

You can use these alerts as the basis for negotiating SLAs. After successfully negotiating SLAs with the third-party web service provider, you should configure alert metrics to track the web service provider's compliance with the new agreement terms.

There are different ways to add SLA alerts and Business alerts in RSB decorator projects. SLA alerts can be added from OSB console after the decorator has been deployed in a OSB server. Pipeline alerts can be added from either JDeveloper or from OSB console. It is recommended to add pipeline alerts in the JDeveloper and then export the decorator jar.

Default Alerts in RSB Decorator Projects

RSB decorator jars have a default SLA alert configured for each proxy and business service. The default alert rule name is ErrorCountRule. This alert is configured to generate an SLA alert whenever an error condition occurs in the message flow. This is just a sample SLA alert. It is recommended to delete this rule and create a new rule for the actual SLA criteria for that environment.

How to add new SLA alert

SLA alerts are operational settings and they can be added or modified only from OSB console. Follow the steps to delete the default alert rule and add a new rule:

  1. Log in to OSB console and access the Projects page. Surrounding text describes image082-1.png.

  2. Click the project for which you want to modify SLA alert.

    The steps to add or modify an SLA alert are same for both business service and proxy service. In this example, we will show steps for a business service. Browse to the business service and go to SLA Alert Rules tab of that service.

    Surrounding text describes image083-1.png.
  3. Click Create in the Change Center to create a new section. Surrounding text describes image084-1.png.

  4. Select the rule and click Delete. The rule is deleted.

    Surrounding text describes image085-1.png.
  5. Click add to add a new rule.

  6. Enter appropriate values for Rule Name and Alert Summary fields. It is recommended to have a good summary of why this alert rule should be generated. Having proper description of all fields will be useful when looking at rules in RIC console and it will help better in diagnosing the issues. Surrounding text describes image087-1.png.

  7. For Alert Destination, click browse. Surrounding text describes image088-1.png.

  8. Click Search to display all alert destinations. Surrounding text describes image089-1.png.

  9. Select Alert Destination and click OK. Surrounding text describes image090-1.png.

  10. Click Next. You can build the expression which defines the criteria for alert rule on the next page. Surrounding text describes image091-1.png.

  11. Now in the Condition Builder area, you can build the expression for which you want to generate SLA alert. In this example, we will build an expression to generate an SLA alert whenever the response time of business service is more than one second. Click add. Surrounding text describes image092-1.png.

  12. Select the appropriate values in the condition and click update. Surrounding text describes image093-1.png.

  13. You can build more complex expression using join and split condition buttons to build the rule. After the expression is build, select the condition and click Create. Surrounding text describes image094-1.png.

    Surrounding text describes image095-1.png.

    In the above page, you will see all the details about the new rule. We recommend that the condition expression is copied into the description filed as well, so that when the SLA alert is displayed in RIC, the exact condition of causing the alert is also displayed. The condition expression is not available in RIC, but the description field is available. Therefore we should have a good description for the alert. Follow the steps to copy the condition expression into the description field. To edit the rule and add the description, click edit.

  14. Paste the condition expression into the Rule Description field and click Save. Surrounding text describes image096-1.png.

  15. Click Activate and then Submit to commit the changes in server.

This completes the steps to create new SLA alert rule.


Note:

SLA alerts are operational settings and can be added and modified only from OSB console. If the decorator jar is re-deployed on the server, remember that all the operational settings and SLA alerts will be lost. After deploying the new decorators, the SLA alerts will need to be created again.

How to Add New Pipeline/Business Alert

Pipeline alerts are also called Business Alerts in RSB context. The reason for calling them business alerts is that they are used mostly to identify unusual business conditions or errors. For example, a customer may want to see an alert whenever a request is made with a very large amount.

Pipeline alerts can be added in proxy services only. In RSB decorators, the message flow is defined in local proxy services. Therefore any new pipeline alerts should be added in local proxy service.

In this example, we will take an oms-CustomerOrderService where a business alert needs to be raised when grand total > 500000. The following steps are for adding a new pipeline alert:

  1. Drag the Stage component from Components windows. Surrounding text describes image097-1.png.

  2. Enter appropriate name for the stage.

  3. In the stage, add a new If Then flow, drag the If Then component from the Components window to the newly added stage.

  4. For the first If condition, select the If condition and click the <Condition> link in If properties window to access Xquery access expression builder. Surrounding text describes image098-1.png.

  5. In this screen, you can build the expression for the alert rule. Select the request schema element body > createCustomerOrder > CustOrderDesc > grand_total for the operation: Surrounding text describes image099-1.png.

  6. Click Insert into Expression to add to Expression field. Surrounding text describes image100-1.png.

  7. Click OK. Select Condition link from If variable window. Surrounding text describes image101-1.png.

  8. Click Launch Xquery expression builder link next to Operand field. Select body > createCustomerOrder > CustOrderDesc > grand_total and click Insert into Expression. Enter appropriate value in the Value field. Surrounding text describes image103-1.png.

  9. Click OK and then click Add to add the condition.

  10. You can build more complex expression using the And and Or options. After building the condition expression, click OK. Surrounding text describes image105-1.png.

  11. Now we need to add an Alert action for this If condition.

  12. The alert action gets added, right click the If condition added in the above steps, select Insert Into > Alert. Surrounding text describes image106-1.png.

  13. In the Expression field, you can enter the xml that you want to see in alert description when alert is generated. For example, you may want to see the whole SOAP body which caused the alert to be generated or a subset of the SOAP body. Click the <Expression> link in the Alert-Properties window to select the XML. Surrounding text describes image107-1.png.

  14. In this example, we will add CustOrderDesc element to the expression. Surrounding text describes image108-1.png.

  15. Drag CustOrderDesc to the Expression window. Surrounding text describes image109-1.png.

  16. Click OK. In the Summary field, enter an appropriate name for the alert.

  17. Select Destination link from the Alert - Properties window for the Alert. You should select the destination that was created by default in this project. Surrounding text describes image110-1.png.

  18. Click OK to close the dialog box. Surrounding text describes image111-1.png.

This finishes up the steps for adding new business alert to a message flow in a decorator.

How to add E-mail Notification for Alerts

The default alert destination created by RSB only sends alerts on OSB reporting provider JMS. The alert destination can also be configured to send email notifications; this will be useful to get immediate notifications for SLA alerts. For generating email notifications first step is to create SMTP server configuration in OSB server. You need to have a SMTP server running and URL, port number information available. Following are the steps to create SMTP server configuration using OSB console:

  1. Create a new session in OSB console.

  2. Go to System > SMTP Servers page. Surrounding text describes image112-1.png.

  3. Right click SMTP Servers and select Create > Create SMTP Server. Surrounding text describes image113-1.png.

  4. Create SMTP Server window is displayed. Surrounding text describes image114-1.png.

  5. Provide a name and URL of the SMTP server. If the SMTP server is running on localhost, then the URL will be localhost.

  6. Enter SMTP port number, generally it is 25.

  7. If it is secured, then provide username/password. Generally it is not required when running on localhost.

  8. Click Save. Click Activate and Submit to commit changes to the server.

  9. This completes the steps for creating SMTP server configuration. Following is a screenshot of this:

    Surrounding text describes image115-1.png.

After creating SMTP server configuration, we need to update alert destination to use the SMTP server for sending notifications.

  1. Create a new session in OSB console.

  2. Go to Project Explorer tab and browse to the project for which you want to modify the alert destination. In this example, we will update cm-Customer-AppServiceDecorator project. When you click the project; it shows the list of files in that project. The default alert destination follows the naming convention as <appName>-<ServiceName>-AppServiceDecoratorAlert. So the file name here will be cm-Customer-AppServiceDecoratorAlert.

  3. Click the alert destination to go to alert destination configuration page. Surrounding text describes image116-1.png.

  4. In the e-mail Recipients section, click add. In the next page, you need to provide details about senders and receivers of e-mail notifications as shown below: Surrounding text describes image117-1.png.

    • Mail Recipients: This needs the email addresses of the persons who should receive email notification.

    • SMTP Server: Select the name of the SMTP server that was created earlier.

    • From Name: The name of the person on whose behalf the notification is sent.

    • From Address: Email address of the person on whose behalf the notification is sent.

    • Reply To Name: Name of the person which should show in reply-to field of the email.

    • Reply To Address: Email address which should show in reply-to field of email. Surrounding text describes image118-1.png.

  5. Click OK after entering all the values. Click Activate and Submit to commit changes to the server. This completes the steps required for setting up email notifications for alerts.