You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update to the demo readme
* ACA auto scaling
* restore provider.conf.json
* Update demo readme. Remove patterns from MWA and add a reference
* Remove patterns from RWA and add a reference
You can test and configure the code-level design patterns introduced in this implementation: strangler fig, queue-based load leveling and competing consumers, and distributed tracing. The following paragraphs detail steps to test these code-level design patterns.
4
+
5
+
As an evolution of the Reliable Web App (RWA), the Modern Web App (MWA) reference sample also includes design patterns that were showcased in RWA: retry, circuit-breaker, and cache-aside. For more information on these patterns and how to test them (both in RWA and MWA), see [Reliable Web App Pattern Simulations](https://github.com/Azure/reliable-web-app-pattern-java/blob/main/demo.md).
6
+
3
7
## Strangler Fig Pattern
4
8
5
9
Read the [Strangler Fig Pattern](./docs/SranglerFig.md) documentation.
6
10
7
-
After you deploy CAMS using `azd up`, the application is configured to use the legacy email service. This is simulated by issuing a log message when the email functionality is called. To simulate the functionality, follow the steps below:
11
+
After you deploy CAMS using `azd up`, the application is configured to use the new email service. The default value for `CONTOSO_SUPPORT_GUIDE_REQUEST_SERVICE` is set to `queue` for the App Service. Email requests go to the Azure Service Bus and are processed by the `email-processor` container app. This setting is defined in Azure App Configuration.
To simulate the functionality, follow the steps below:
8
16
9
17
1. Open the CAMS application in a browser.
18
+
1. Upload a support guide by clicking on the `Support Guides` link in the navigation bar and click `Upload New Guide`. The guides are located in the `contoso-guides` directory.
1. To see email requests go to the Azure Service Bus, change the `CONTOSO_SUPPORT_GUIDE_REQUEST_SERVICE` environment variable to `queue` for the App Service.
1. Follow the same instructions to send an email to the customer. You will see the log messages from the `email-processor` container app and `CAMS`. Refresh the page and you will see that `CAMS` processed a response from the `email-processor`.
42
+
You will see the log messages from the `email-processor` container app and `CAMS`.
43
+
44
+
**Note**: It may take a few minutes for the message to be processed and the logs to appear.
45
+
46
+
1. Refresh the page and you will see that `CAMS` processed a response from the `email-processor`.
To see messages go though the old email service, change the value of the `CONTOSO_SUPPORT_GUIDE_REQUEST_SERVICE` key to `email` in Azure App Configuration. This is simulated by issuing a log message when the email functionality is called.
You can also simulate the Strangler Fig Pattern and view the distributed tracing logs in Azure Monitor.
65
+
66
+
1. Navigate to the Azure Application Insights in the Azure portal and select the **Transaction Search** blade. Search for `New Message Received` to see the trace messages from the `email-processor` container app and the `CAMS` application running on App Service.
The `email-processor` container app is configured to autoscale based on the number of messages in the Azure Service Bus. The `email-processor` container app scales out when the number of messages in the Service Bus exceeds a certain threshold.
1. Navigate to the Container App in the Azure portal and click on the `Revisions and replicas` link under `Application` in the left navigation. Finally, click on the `Replicas` tab. You will see that the number of replicas has increased.
Copy file name to clipboardExpand all lines: docs/SranglerFig.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,9 @@ The new email service is implemented (here)[https://github.com/Azure/modern-web-
22
22
23
23
4.**Gradually migrate functionality**: The email functionality is gradually migrated from the old service to the new service. This can be done by routing a percentage of the email requests to the new service and gradually increasing the percentage over time.
24
24
25
-
Change the `CONTOSO_SUPPORT_GUIDE_REQUEST_SERVICE` environment variable from `email` to `queue` to migrate the email functionality to the new email service that's integrated with Azure Service Bus.
25
+
The `CONTOSO_SUPPORT_GUIDE_REQUEST_SERVICE` environment variable changes the behavior of CAMS. Possible values for `CONTOSO_SUPPORT_GUIDE_REQUEST_SERVICE` are `email` and `queue`.
26
+
*`email` refers to the old functionaly where the the monolithic CAMS application sent out emails directly.
27
+
*`queue` is the new functionality where messages are sent to to the new email service through Azure Service Bus.
0 commit comments