You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
Symptom
Monetization Notifications are not working and hence emails are not being sent to the subscribed users.
Error Message
The emails about Monetization notification to the subscribed people will not be sent. No error messages will be observed.
About Monetization event notifications
Monetization supports event notifications that enable you to:
- Notify all developers about events such as new products, new versions of T&C's, or new rate plans.
- Notify specific developers about events such as a billing document being published or when a percentage of their target number of transactions is reached (if they purchased an adjustable notification rate plan).
- Notify an API provider about developer-related events, such as when a developer registers for an account or when a developer signs up for a rate plan.
- More details on this on what type of notifications are there and how one can set it up can be found here.
Prerequisites
Be sure the following prerequisites have been met:
- Rate Plan Acceptance
For the following Monetization notifications, check if the developers have accepted the corresponding rate plan :
- New Rate Plan
- Revised Rate Plan
- Expired Rate Plan
- Renewed Rate Plan
- Rate Limit Exceeded
- Depleted Freemium Rate Plan
If the developer has not accepted the rate plan, then these notifications will not trigger for that specific developer.
- Job Scheduler should be run for the specific Notification
Monetization provides a job scheduler and a set of jobs that are pre-scheduled to run at pre-designated times. The job scheduler needs to be run for a specific notification. If it is not run, then the notifications will not be triggered.
- Use the instructions provided in the following doc to see if the scheduled job for a specific notification has run:
Note: You can always change the schedule based on your use case.
- If the scheduled job for the specific notification has already run and you are still not getting the notifications, then proceed to Possible Causes section to troubleshoot this issue further.
- If not, then wait till the scheduled job for the specific notification runs.
- Use the instructions provided in the following doc to see if the scheduled job for a specific notification has run:
Possible Causes
Some of the possible causes for this issue are:
Cause | Description | Troubleshooting Instructions Applicable For |
---|---|---|
SMTP Configuration Incorrect | The SMTP configuration provided is not correct. | Edge Private Cloud Users |
The notification job hasn't started. | Edge Public Cloud and Private Cloud Users |
Cause 1: SMTP Configuration Incorrect
Diagnosis
- Check
/opt/apigee/edge-mint-management-server/conf/apix-mint.properties
file and verify if the following SMTP properties are set correctly.mint.notification.javaMail.properties={"mail.smtp.host": "smtp.gmail.com", "mail.smtp.port": "465", "mail.smtp.starttls.enable": "true", "mail.smtp.auth": "true", "mail.smtp.username": "blah@gmail.com", "mail.smtp.password": "blah" }
- Verify if the SMTP server and user settings are correct. If these settings are incorrect or not set, proceed to Step #3. If this is correct, proceed to Step #4.
- Update the SMTP server and user settings correctly by using the instructions in the following doc:
- Re-check again if the Monetization notifications are now working. If not, please proceed to Step 5.
- If the SMTP settings are correct, then run View notifications sent API call to see the status of the notification sent.
- This API returns a JSON with all the notification that have been fired and the status of each of those.
- A sample JSON is provided below :
{ "hasMoreItems" : false, "notifications" : [ { "fromAlias" : "No Reply", "fromEmail" : "****@apigee.com", "id" : "4e2d0d9a-69a4-4430-957d-02fa2a3cb581", "notificationType" : "EMAIL", "orgId" : "myorg", "rawMessage" : "...", "retryCount" : 0, "retryStatuses" : [ { "responseCode" : 0, "responseMessage" : "{\"Headers\":null,\"Content : \":null,\"StatusCode\":\"0\"}", "retriedAt" : 1518605291092, "retryAttempt" : 0 } ], "source" : "MailTo: [****@blah.com], Org: [myorg], EventType: [UPDATE_DEVELOPER]", "status" : "FAILED", "subject" : "Notification of developer changing company details", "templateId" : "814315c8-d8ca-4b3e-90bb-a8366600e625", "templateName" : "DEFAULT_UPDATE_DEVELOPER_TEMPLATE", "templateParametersJSON" : "{\"developer.legalName\":\"\",\"developer.name\":\"John Smith\"}", "toAlias" : "***@blah.com", "toEmail" : "***@blah.com", "unsubscribeURL" : "..." }
If you check the JSON, it shows the status as 'FAILED' for the above particular notification 'Update Developer'.
- This could possibly be caused because the SMTP server and port might not be reachable from the Management Server. Use the telnet command to check if you are able to connect to the specified SMTP server on the specified port.
telnet <SMTP-server-IP-address> <SMTP-Port#>
If you get the error "Connection timed out" or "Connection refused" for the telnet output, then proceed to Resolution.
Resolution
- Work with your network administrator and ensure the SMTP server is able to accept connections from other machines and also the specific port is open to outside world for communication.
- If the issue still persists, then proceed to the Must Gather Diagnostic Information with the
Cause 2: Notification Job Schedule
The notification job hasn't started.
Diagnosis
- Run the following API call to view all currently scheduled monetization jobs.
- Check whether the notification condition is present and is enabled for the notification that is not working. If it is not present, proceed to Step #3 to create the notification condition and skip the rest of the steps.
- If its present, then check whether its enabled to true. If not, then run the Update a notification condition and action API to update the notification condition.
OR
- Use the UI to update the notification condition using the process provided in the below doc:
- Run the Create a notification condition and action API call to create the appropriate notification condition and the corresponding action.
- Once the notification condition is created, run the List notification conditions and actions API call to verify if the notification condition has been created.
- You can also reprocess the notification using Reprocess a notification API.
- This step is only applicable for Private Cloud users. If the notification condition is present from step #1 and the notification emails are still not coming, then check the management server log
/opt/apigee/var/log/edge-management-server/logs/system.log
and see if the notification condition has been triggered.grep "Executing Mint Scheduler" /opt/apigee/var/log/edge-management-server/logs/system.log | grep -o "Executing Mint Scheduler : \[.*\]" | grep -v "for org : \[null\]" |sort | uniq -c
- If the notification condition is triggered, and you are still not getting the notifications, then proceed to Must Gather Diagnostic Information with information and output from above steps captured.
- If its present, then check whether its enabled to true. If not, then run the Update a notification condition and action API to update the notification condition.
Resolution
- Reprocess the notification using the Reprocess a notification API
Must Gather Diagnostic Information
If the problem persists even after following the above instructions, please contact Apigee Edge Support
and provide the following diagnostic information.
Public and Private Cloud users should provide the below information:
- Organization Name
- Environment Name
- Monetization Notification condition that did not work
- Details about what sections in this Playbook has been tried and any other insights that will help us to fastrack resolution of this issue.
In addition to the above information Private Cloud users should also provide the following information:
- Management Server log
/opt/apigee/var/log/edge-management-server/logs/system.log