diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/cloud-login.md b/queue-decouple-app-message-filter-fairness/cloud-login/cloud-login.md new file mode 100755 index 00000000..dd3abb9a --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/cloud-login/cloud-login.md @@ -0,0 +1,61 @@ +# Get started - Cloud login + +## Introduction + +Oracle Cloud is the industry's broadest and most integrated cloud provider, with deployment options ranging from the public cloud to your data center. Oracle Cloud offers best-in-class services across Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS). + +Estimated Time: 5 minutes + +### Types of Cloud Accounts + +We offer two types of Cloud Accounts: + +*Free Tier Accounts*: After you sign up for the free [Oracle Cloud promotion](https://signup.cloud.oracle.com) or sign up for a paid account, you’ll get a welcome email. The email provides you with your cloud account details and sign in credentials. + +*Oracle Cloud Paid Accounts*: When your tenancy is provisioned, Oracle sends an email to the default administrator at your company with the sign-in credentials and URL. This administrator can then create a user for each person who needs access to the Oracle Cloud. Check your email or contact your administrator for your credentials and account name. + +### Objectives + +- Learn how to log in to your Oracle Cloud Account + +### Prerequisites +- Cloud Account Name - The name of your tenancy (supplied by the administrator or in your Oracle Cloud welcome email) +- Username +- Password + +## Task 1: Log in to Oracle Cloud +If you've signed out of the Oracle Cloud, use these steps to sign back in. + +1. Go to [cloud.oracle.com](https://cloud.oracle.com) and enter your Cloud Account Name and click **Next**. This is the name you chose while creating your account in the previous section. It's NOT your email address. If you've forgotten the name, see the confirmation email. + + ![Cloud Account Name](./images/cloud-oracle.png " ") + +2. Choose **Identity Domain** + + ![Click Continue Single Sign-In](./images/cloud-login-default.png " ") + + + ![Click Continue Single Sign-In](./images/cloud-login-oracle-identity.png " ") + + Click **Next** to reveal the login input fields. + +3. Enter your Cloud Account credentials and click **Sign In**. Your username is your email address. The password is what you chose when you signed up for an account. + + ![Sign in](./images/oci-signin.png " ") + +4. Based on the Multi-factor authentication setup for your account, provide authentication to sign into the account. For example, click **Allow** on the app or enter your **authentication code** and click **Verify** based on the authentication setup. For more details, refer the [Managing Multifactor Authentication documentation](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/usingmfa.htm) + + ![Click Allow in the app](./images/sso-multi-factor-authentication.png " ") + + ![Enter authentication code and click Verify](./images/sso2-multi-factor-authentication.png " ") + +5. After verification, you will be signed in to Oracle Cloud! + + ![OCI Console Home Page](https://oracle-livelabs.github.io/common/images/console/home-page.png " ") + +You may now **proceed to the next lab**. + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 \ No newline at end of file diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/files/accountname.txt b/queue-decouple-app-message-filter-fairness/cloud-login/files/accountname.txt new file mode 100644 index 00000000..b8d9164f --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/cloud-login/files/accountname.txt @@ -0,0 +1,2 @@ +This image shows the Oracle Cloud Account page. On this page you sign in to your Oracle Cloud Account. The page contains a field to enter your cloud account name. +Under that field, is the Next button. \ No newline at end of file diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/files/username.txt b/queue-decouple-app-message-filter-fairness/cloud-login/files/username.txt new file mode 100644 index 00000000..e3e5208b --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/cloud-login/files/username.txt @@ -0,0 +1 @@ +This image shows the page for your Oracle Cloud Account sign in. The page reflects the Cloud account name. Below are two fields: "User Name or Email" and "Password". The Sign In button below these fields. \ No newline at end of file diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-homepage.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-homepage.png new file mode 100755 index 00000000..8c4268cf Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-homepage.png differ diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-login-default.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-login-default.png new file mode 100644 index 00000000..4f828766 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-login-default.png differ diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-login-oracle-identity.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-login-oracle-identity.png new file mode 100644 index 00000000..b0eb7cdc Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-login-oracle-identity.png differ diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-oracle.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-oracle.png new file mode 100644 index 00000000..ab415670 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/cloud-oracle.png differ diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/multi-factor-authentication.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/multi-factor-authentication.png new file mode 100644 index 00000000..032f46a2 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/multi-factor-authentication.png differ diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/oci-signin.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/oci-signin.png new file mode 100644 index 00000000..8774428d Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/oci-signin.png differ diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/sso-multi-factor-authentication.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/sso-multi-factor-authentication.png new file mode 100644 index 00000000..226cde2c Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/sso-multi-factor-authentication.png differ diff --git a/queue-decouple-app-message-filter-fairness/cloud-login/images/sso2-multi-factor-authentication.png b/queue-decouple-app-message-filter-fairness/cloud-login/images/sso2-multi-factor-authentication.png new file mode 100644 index 00000000..7f8b54b2 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/cloud-login/images/sso2-multi-factor-authentication.png differ diff --git a/queue-decouple-app-message-filter-fairness/introduction/introduction.md b/queue-decouple-app-message-filter-fairness/introduction/introduction.md new file mode 100644 index 00000000..41697800 --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/introduction/introduction.md @@ -0,0 +1,36 @@ +# Introduction + +## About this Workshop + +Oracle Cloud Infrastructure (OCI) Queue is a fully managed, high-throughput messaging service designed to enable secure communication between decoupled application components or microservices. By leveraging OCI Queue, developers can implement scalable, resilient, and loosely coupled architectures to support asynchronous messaging and ensure system flexibility. +In this workshop, you will learn to create and manage OCI Queues and integrate them with various SDKs and APIs to develop decoupled applications. Whether you're using the OCI SDKs or open-source protocols like STOMP, this hands-on experience will help you understand key features like message fairness, channel management, and more. + +### Objectives + +In this workshop, you will learn how to: + +* **Deploy OCI Queue** Learn how to provision and configure an OCI Queue to enable asynchronous communication for your applications. +* **Decouple Application Components/ Micro-services using the OCI Queue SDK** Implement decoupling patterns between micro-services using the OCI Queue SDK. +* **Queue Channels - Filter Messages and Messaging Fairness using OCI Queue SDK** Explore how to send and receive messages from specific queue channels while ensuring messaging fairness and proper load distribution. +* **Decouple Application Components/ Micro-services Using Open-Source STOMP API** Understand how to integrate OCI Queue with the widely adopted open-source STOMP protocol. +* **Queue Channels - Filter Messages and Messaging Fairness using open source STOMP API** Combine the capabilities of OCI Queue and STOMP APIs to develop messaging systems with channel-specific fairness. + +### Prerequisites + +This lab assumes you have: + +* An Oracle account. +* Familiarity with queue and concepts of micro-services are required. +* Some understanding of Linux shell commands. +* Familiarity with Oracle Cloud Infrastructure (OCI) components like OCI Compute, networking. +* Basic familiarity with python. + +## Learn More + +* [OCI Queue Blog](https://blogs.oracle.com/cloud-infrastructure/post/announcing-oci-queue) +* [OCI Queue Documentation](https://docs.oracle.com/en-us/iaas/Content/queue/home.htm) + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 diff --git a/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/images/2.png b/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/images/2.png new file mode 100644 index 00000000..df13f63e Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/images/2.png differ diff --git a/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/images/3.png b/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/images/3.png new file mode 100644 index 00000000..1ada0f9e Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/images/3.png differ diff --git a/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/lab1-deploy-queue.md b/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/lab1-deploy-queue.md new file mode 100644 index 00000000..3408642d --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/lab1-deploy-queue/lab1-deploy-queue.md @@ -0,0 +1,120 @@ +# Lab 1: Deploy OCI Queue + +## Introduction + +In this lab, you will create an OCI Queue and configure it to enable asynchronous communication between application components. + +Estimated Lab Time: 20 minutes + +### Objectives + +In this lab, you will: + +* Create an IAM policy for OCI Queue +* Create an OCI Queue + +### Prerequisites + +This lab assumes you have: + +* An Oracle Cloud account + +## Task 1: Log in to the OCI Console + +1. Open the [OCI Console](https://cloud.oracle.com/) in your browser. +2. Log in using your Oracle Cloud account credentials. + +## Task 2: Add Required IAM Policies + +Before creating a queue, ensure that the appropriate IAM policies are in place to allow the required actions. Follow these steps: + +1.**Navigate to the IAM Service:** + +* Open the navigation menu (☰) in the OCI Console. +* Under **Identity & Security**, select **Identity** → **Policies**. + +2.**Create a New Policy:** + +* Click **Create Policy**. +* Provide the following details: + * **Name:** Enter a unique name for the policy, such as QueuePolicy. + * **Compartment:** Select the compartment where you want to apply the policy. + * **Description:** Optionally, add a description, such as "Policy to allow Queue management." + +3.**Define the Policy Statements:** +Use the following policy statements as per your requirement: + +* Allow queue management (administrators): + +``` + + Allow group QueueAdmins to manage queue-family in compartment + + ``` + +* Allow application developers to produce and consume messages: + + ``` + + Allow group QueueDevelopers to use queues in compartment + + ``` + +Replace *compartment-name* with the name of your compartment and QueueAdmins / QueueDevelopers with the appropriate user groups in your OCI tenancy. + +4.**Create the Policy:** + +* Click **Next**, review the details, and then click Create Policy. + +5.**Assign Users to Groups (if not already done):** + +* Ensure that the necessary users are part of the QueueAdmins or QueueDevelopers groups based on their role. + +## Task 3: Create an OCI Queue + +1. From the OCI Console home page, open the navigation menu (☰) in the top-left corner. +2. Under **Developer Services**, select Application Integration, select Queue. +3. On the **Queues** page, click **Create Queue**. +4. Enter the following details: + +* **Name:** Provide a unique name for the queue. For example, *MyQueue*. +* **Compartment:** Select the compartment where the queue will reside. +* **Description (optional):** Add a description for the queue, such as "*Queue for decoupling microservices.*" +* **Queue Settings:** Choose **Default Configuration** or optional **Custom Configuration** + +## Task 4: Custom Configuration (Optional) + +1. **Retention Period:** Specify the time (in seconds) messages will be retained in the queue. For example, *86400seconds (1 day)*. +2. **Visibility Timeout:** Set the duration (in seconds) for which a message remains invisible after being read. For example, *30 seconds*. +3. **Maximum Channel Consumption (percentage):** Maximum amount of the queue's storage and throughput that a channel can consume. For example *100%*. +4. **Dead letter Queue Settings:** + + **Maximum Delivery Attempts:** The maximum number of retries for a message consumption before it is sent to a dead letter queue (DLQ). + +5. **Encryption settings:** + + **Encryption Key:** Leave as Default Encryption Key or select a customer-managed key (CMK) from the OCI Vault for enhanced security. + +6. **Tags:** Optionally, add tags to help with resource organization and cost tracking. + +## Task 5: Review and Create + +1. Review your configuration in the **Summary** section. +2. Click **Create** to provision the queue. +![Create Queue](images/2.png) + +## Task 6: Verify Queue Creation + +1. Once the queue is created, it will appear in the list on the **Queues** page. +2. Click the *queue name* to open its details page and verify the configuration. +![Queue Details](images/3.png) + +## Learn More + +* [OCI Queue Blog](https://blogs.oracle.com/cloud-infrastructure/post/announcing-oci-queue) +* [OCI Queue Documentation](https://docs.oracle.com/en-us/iaas/Content/queue/home.htm) + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 diff --git a/queue-decouple-app-message-filter-fairness/lab2-decouple-application-oci-queue-sdk/lab2-decouple-application-oci-queue-sdk.md b/queue-decouple-app-message-filter-fairness/lab2-decouple-application-oci-queue-sdk/lab2-decouple-application-oci-queue-sdk.md new file mode 100644 index 00000000..5a8fa5a5 --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/lab2-decouple-application-oci-queue-sdk/lab2-decouple-application-oci-queue-sdk.md @@ -0,0 +1,275 @@ +# Lab 2: Decouple application components/ micro-services using OCI Queue SDK + +## Introduction + +In this lab, you will create a compute instance, install Python, set up the OCI SDK, and write producer and consumer applications to send and retrieve messages from an OCI Queue. + +Estimated Lab Time: 30 minutes + +### Objectives + +In this lab, you will: + +* Produce messages to Queue using OCI SDK +* Consume messages from Queue using OCI SDK + +### Prerequisites + +This lab assumes you have: + +* An Oracle Cloud account +* All previous labs successfully completed + +## Task 1: Create a Compute Instance + +1. **Navigate to Compute Service:** + + * Log in to the [OCI Console](https://cloud.oracle.com/). + * Open the navigation menu (☰), and under **Compute**, select **Instances**. + +2. **Create a New Instance:** + + * Click **Create Instance**. + * Enter the following details: + * **Name**: Enter a name for the instance (e.g., OCIQueueLabInstance). + * **Compartment**: Select the appropriate compartment. + * **Image and Shape**: + * Select the image (e.g., Oracle Linux 8 or Ubuntu 22.04). + * Choose the shape based on your requirements (e.g., VM.Standard.E2.1). + * **Networking**: + * Select an existing Virtual Cloud Network (VCN) or create a new one. + * Assign a public IP for easy SSH access. + * Click **Create**. + +3. **Connect to the Instance**: + + * Once the instance is running, copy the public IP. + * Use an SSH client to connect: + + ``` + + ssh -i opc@ + + ``` + +## Task 2: Install Python and Required Packages + +1. **Update the System:** + + ``` + + sudo apt update && sudo apt upgrade -y # For Ubuntu sudo dnf update -y # For Oracle Linux + + ``` + +2. **Install Python:** + + ``` + + sudo apt install python3 python3-pip -y # For Ubuntu sudo dnf install python3 python3-pip -y # For Oracle Linux + + ``` + +3. **Install OCI SDK:** + + ``` + + pip3 install oci + + ``` + +4. **Verify Installation:** + + ``` + + python3 -c "import oci; print('OCI SDK Installed Successfully')" + + ``` + +## Task 3: Set Up OCI Configuration + +1. **Generate an API Key:** + + * In the OCI Console, go to your user profile and select API Keys. + * Click **Add API Key → Generate API Key Pair**. + * Download the private key and copy the public key fingerprint. + +2. **Upload the Public Key to OCI:** + + Upload the public key to your user profile in OCI. + +3. **Create the Configuration File:** + + On your instance, create a .oci directory: + + ```ssh + + mkdir -p ~/.oci + + ``` + + Create the config file: + + ``` + + nano ~/.oci/config + + ``` + + Add the following content: + + ``` + + [DEFAULT] + user= + fingerprint= + key_file=~/.oci/ + tenancy= region=us-phoenix-1 + + ``` + + Replace placeholders (*user\_ocid*, *tenancy\_ocid*, etc.) with your specific details. + +4. **Set Permissions:** + + ``` + + chmod 600 ~/.oci/ + +``` + +## Task 4: Write the Producer Application + +1. **Create the Producer Script:** + + Save the provided producer code to a file named *producer.py*: + + ``` + + nano producer.py + + ``` + + The producer code: + ```python + + import oci + + def send_messages(queue_id, message_content_list): + # Load the OCI config from the default file + config = oci.config.from_file() + + # Initialize QueueClient + queue_client = oci.queue.QueueClient(config, service_endpoint="https://cell-1.queue.messaging..oci.oraclecloud.com") #Replace with your messaging endpoint + + # Create message entries + messages = [oci.queue.models.PutMessagesDetailsEntry(content=content) for content in message_content_list] + put_message_details = oci.queue.models.PutMessagesDetails(messages=messages) + + # Send messages to the queue + response = queue_client.put_messages(queue_id=queue_id, put_messages_details=put_message_details) + + print("Messages sent successfully:") + for put_message in response.data.messages: + print(f"Message ID: {put_message.id}") + + if __name__ == "__main__": + QUEUE_ID = "" # Replace with your OCI Queue OCID + REGION = "us-phoenix-1" # Replace with your region + MESSAGE_CONTENT_LIST = ["Message 1", "Message 2", "Message 3"] + + send_messages(QUEUE_ID, MESSAGE_CONTENT_LIST) + + ``` + +2. **Run the Producer Script:** + + ``` + + python3 producer.py + + ``` + +3. **Verify Message Sent:** +Check the OCI Console to see messages in the queue. + + +## Task 5: Write the Consumer Application + +1. **Create the Consumer Script:** + + Save the provided consumer code to a file named *consumer.py*: + + ``` + + nano consumer.py + + ``` + + The consumer code: + ```python + + import oci + + def receive_messages(queue_id): + # Load the OCI config from the default file + config = oci.config.from_file() + + # Initialize QueueClient + queue_client = oci.queue.QueueClient(config, service_endpoint="https://cell-1.queue.messaging..oci.oraclecloud.com") #Replace with your messaging endpoint + + # Retrieve messages from the queue + get_messages_response = queue_client.get_messages(queue_id=queue_id, limit=5) + get_message_list = get_messages_response.data.messages + + print("Received messages:") + for get_message in get_message_list: + print(f"Message ID: {get_message.id}") + print(f"Receipt: {get_message.receipt}") + print(f"Content: {get_message.content}") + print(f"Visible After: {get_message.visible_after}") + print(f"Expire After: {get_message.expire_after}") + print(f"Delivery Count: {get_message.delivery_count}") + print("-" * 30) + + # Acknowledge and delete messages from the queue + delete_message_entry_list = [oci.queue.models.DeleteMessagesDetailsEntry(receipt=message.receipt) for message in get_message_list] + + if delete_message_entry_list: + delete_details = oci.queue.models.DeleteMessagesDetails(entries=delete_message_entry_list) + batch_delete_message_response = queue_client.delete_messages(queue_id=queue_id, delete_messages_details=delete_details) + print("Acknowledged and deleted messages:") + for entry in batch_delete_message_response.data.entries: + if hasattr(entry, 'error_code'): + print(f"Error code: {entry.error_code}, Error message: {entry.error_message}") + else: + print("Message deleted successfully") + + if __name__ == "__main__": + QUEUE_ID = "" # Replace with your OCI Queue OCID + + receive_messages(QUEUE_ID) + + + ``` + +2. **Run the Consumer Script:** + + ``` + + python3 consumer.py + + ``` + +3. **Verify Message Retrieval:** +Ensure that messages are retrieved and acknowledged as deleted in the OCI Console. + +## Learn More + +* [OCI Queue Blog](https://blogs.oracle.com/cloud-infrastructure/post/announcing-oci-queue) +* [OCI Queue Documentation](https://docs.oracle.com/en-us/iaas/Content/queue/home.htm) + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 diff --git a/queue-decouple-app-message-filter-fairness/lab3-message-filter-fairness-oci-queue-sdk/lab3-message-filter-fairness-oci-queue-sdk.md b/queue-decouple-app-message-filter-fairness/lab3-message-filter-fairness-oci-queue-sdk/lab3-message-filter-fairness-oci-queue-sdk.md new file mode 100644 index 00000000..cf2c4809 --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/lab3-message-filter-fairness-oci-queue-sdk/lab3-message-filter-fairness-oci-queue-sdk.md @@ -0,0 +1,212 @@ +# Lab 3: Queue Channels - Filter Messages and Messaging Fairness using OCI Queue SDK + +## Introduction + +In this lab, you will learn how to use OCI Queue SDK to produce and consume messages while utilizing channels. Channels help ensure messaging fairness by categorizing messages and consuming them based on their assigned channel. + +Estimated Lab Time: 30 minutes + + + +### Objectives + +In this lab, you will: + +* Produce messages to Queue Channels using OCI SDK +* Filter messages and consume messages from Queue Channels using OCI SDK + +### Prerequisites + +This lab assumes you have: + +* An Oracle Cloud account +* All previous labs successfully completed + + +## Task 1: Set Up the Environment + +1. **Ensure Your Instance is Ready:** + + * Use the compute instance created in **Lab 2**. + * Confirm Python and the OCI SDK are installed. + +2. **Verify OCI Configuration:** + + * Ensure the *.oci/config* file is correctly set up with the required API credentials. + * Test connectivity with a basic OCI SDK script to verify proper setup. + +## Task 2: Write the Producer Application + +1. **Create the Producer Script:** + + On your instance, create a file named *producer\_with\_channels.py*: + + ``` + + nano producer_with_channels.py + + ``` + + The producer code: + + ```python + + import oci + + def send_messages(queue_id, message_content_list, channel_id=None): + config = oci.config.from_file() + queue_client = oci.queue.QueueClient(config, service_endpoint="https://cell-1.queue.messaging..oci.oraclecloud.com") # Replace with your messaging endpoint + + messages = [ + oci.queue.models.PutMessagesDetailsEntry( + content=content, + metadata=oci.queue.models.MessageMetadata( + channel_id=channel_id, + custom_properties={ + 'custom_key': 'custom_value' + } + ) if channel_id else None + ) + for content in message_content_list + ] + put_message_details = oci.queue.models.PutMessagesDetails(messages=messages) + + response = queue_client.put_messages(queue_id=queue_id, put_messages_details=put_message_details) + + print("Messages sent successfully:") + for put_message, message in zip(response.data.messages, messages): + channel_metadata = message.metadata.channel_id if message.metadata else "None" + print(f"Message ID: {put_message.id}, Channel ID: {channel_metadata}") + + if __name__ == "__main__": + QUEUE_ID = "" # Replace with your Queue OCID + CHANNEL_ID = "Channel1" + MESSAGE_CONTENT_LIST = ["Message 1", "Message 2", "Message 3"] + + send_messages(QUEUE_ID, MESSAGE_CONTENT_LIST, channel_id=CHANNEL_ID) + print("Messages sent successfully.") + + ``` + +2. **Run the Producer Script:** + + ``` + + python3 producer_with_channels.py + + ``` + +3. **Verify Messages Sent:** + + * The script will print confirmation with message IDs and channel IDs. + * Confirm the messages in the OCI Console under the **Queue Details** page. + + +## Task 3: Write the Consumer Application + +1. **Create the Consumer Script:** + + On your instance, create a file named *consumer\_with\_channels.py*: + + ``` + + nano consumer_with_channels.py + + ``` + + The consumer code: + + ```python + + import oci + + def receive_messages(queue_id, channel_id=None): + config = oci.config.from_file() + queue_client = oci.queue.QueueClient(config, service_endpoint="https://cell-1.queue.messaging..oci.oraclecloud.com") # Replace with your messaging endpoint + + get_messages_response = queue_client.get_messages( + queue_id=queue_id, + visibility_in_seconds=30, + timeout_in_seconds=20, + limit=5, + channel_filter=channel_id + ) + get_message_list = get_messages_response.data.messages + + if not get_message_list: + print("No messages available to process.") + return + + print("Received messages:") + for get_message in get_message_list: + print(f"Message ID: {get_message.id}") + print(f"Content: {get_message.content}") + print("-" * 30) + + delete_message_entry_list = [ + oci.queue.models.DeleteMessagesDetailsEntry(receipt=message.receipt) + for message in get_message_list + ] + + if delete_message_entry_list: + delete_details = oci.queue.models.DeleteMessagesDetails(entries=delete_message_entry_list) + batch_delete_message_response = queue_client.delete_messages(queue_id=queue_id, delete_messages_details=delete_details) + print("Acknowledged and deleted messages:") + for entry in batch_delete_message_response.data.entries: + if hasattr(entry, 'error_code'): + print(f"Error code: {entry.error_code}, Error message: {entry.error_message}") + else: + print("Message deleted successfully") + + if __name__ == "__main__": + QUEUE_ID = "" # Replace with your Queue OCID + CHANNEL_ID = "Channel1" # Optional: Replace with your Channel OCID + + receive_messages(QUEUE_ID, channel_id=CHANNEL_ID) + + ``` + +2. **Run the Consumer Script:** + + ``` + + python3 consumer_with_channels.py + + ``` + +3. **Verify Messages Consumed:** + + * The script will print the details of received messages. + * Ensure that the messages correspond to the specific channel (if filtered). + +## Task 4: Test Messaging Fairness + +1. **Simulate Multiple Producers and Consumers:** + + * Run the *producer\_with\_channels.py* with multiple channel IDs to simulate channel-based distribution. + * Use multiple instances of the *consumer\_with\_channels.py* with specific channel filters. + +2. **Monitor Message Flow:** + + * Ensure that each consumer only processes messages from its assigned channel. + * Verify fairness in message distribution across channels in the OCI Console. + +## Task 5: Cleanup (Optional) + +1. **Delete Unprocessed Messages:** + + Ensure that all messages in the queue are processed and acknowledged. + +2. **Terminate Resources:** + + If no longer needed, delete the queue and compute instance to avoid additional costs. + +## Learn More + +* [OCI Queue Blog](https://blogs.oracle.com/cloud-infrastructure/post/announcing-oci-queue) +* [OCI Queue Documentation](https://docs.oracle.com/en-us/iaas/Content/queue/home.htm) + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 diff --git a/queue-decouple-app-message-filter-fairness/lab4-decouple-application-stomp/lab4-decouple-application-stomp.md b/queue-decouple-app-message-filter-fairness/lab4-decouple-application-stomp/lab4-decouple-application-stomp.md new file mode 100644 index 00000000..320a2943 --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/lab4-decouple-application-stomp/lab4-decouple-application-stomp.md @@ -0,0 +1,257 @@ +# Lab 4: Decouple Application Components/Microservices Using Open-Source STOMP API + +## Introduction + +In this lab, you will use the open-source STOMP protocol to produce and consume messages from an OCI Queue. This lab demonstrates how to integrate with OCI Queues using STOMP for decoupling application components. + + +Estimated Lab Time: 30 minutes + +### Objectives + +In this lab, you will: + +* Produce messages to Queue using open source STOMP +* Consume messages from Queue using open source STOMP + +### Prerequisites + +This lab assumes you have: + +* An Oracle Cloud account +* All previous labs successfully completed + +## Task 1: Prepare the Environment + +1. **Ensure Your Instance is Ready:** + + * Use the compute instance created in **Lab 2**. + * Ensure Python 3 is installed. + +2. **Install Required Python Libraries:** + + Install the stomp.py library for STOMP integration: + + ``` + + pip3 install stomp.py + + ``` + + Confirm the installation: + ``` + + python3 -c "import stomp; print('STOMP library installed successfully')" + + ``` + +3. **Verify OCI Configuration:** + + Confirm the OCI Queue OCID, user credentials, and region-specific STOMP endpoint. + +## Task 2: Generate OCI Credentials for STOMP + +OCI Queue's STOMP endpoint uses credentials associated with Auth Tokens in OCI. Here is how to create them - + +1. **Locate Your OCI Username** + + * Log in to the [OCI Console](https://www.oracle.com/cloud/sign-in.html) + * Click your profile icon in the upper-right corner and select **User Settings**. + * Note your **Username** from the details shown. + +2. **Create an Auth Token for STOMP** + + * In the **User Settings**, scroll down to the Auth Tokens section. + * Click **Generate Token**. + * Provide a description (e.g., *STOMP Auth Token*) and click **Generate Token**. + * Copy the generated token immediately. It will serve as your **password** for STOMP connections. + +3. **Use Credentials in STOMP Applications** + + * **Username**: Your OCI username + * **Password**: The Auth Token + +## Task 3: Write the Producer Application + +1. **Create the Producer Script:** + + On your instance, create a file named *stomp_producer.py*: + + ``` + + nano stomp_producer.py + + ``` + + Paste the producer code: + + ```python + + import time + import stomp + import base64 + import ssl + + # OCI Queue ID and STOMP endpoint + queue_id = '' # Replace with your OCI Queue OCID + hosts = [('cell-1.queue.messaging..oci.oraclecloud.com', 61613)] # Replace with your region's STOMP host and port + + username = '/' # Replace with your parent tenancy and user name + password = '' # Replace with your password + encoded_password = base64.b64encode(password.encode("utf-8")).decode("utf-8") + + conn = stomp.Connection(host_and_ports=hosts) + conn.set_ssl(for_hosts=hosts) + + conn.connect(username=username, passcode=encoded_password, wait=True) + + try: + print("Sending messages to OCI Queue...") + count = 1 + while True: + message = f'Hello OCI Queue via STOMP! Message {count}' + conn.send(body=message, destination=queue_id) + print(f"Sent message: {message}") + count += 1 + time.sleep(1) + + except KeyboardInterrupt: + print("Producer interrupted. Disconnecting...") + conn.disconnect() + + + ``` + +2. **Run the Producer Script:** + + ``` + + python3 stomp_producer.py + + ``` + +3. **Verify Messages Sent:** + + * The script will output sent messages. + * Confirm the messages in the OCI Console under the Queue Details page. + +## Task 4: Write the Consumer Application + +1. **Create the Consumer Script:** + On your instance, create a file named *stomp_consumer.py*: + + ``` + + nano stomp_consumer.py + + ``` + + The consumer code: + + ```python + + import time + import stomp + import base64 + import ssl + + # Define a Listener class inheriting from stomp.ConnectionListener + class Listener(stomp.ConnectionListener): + def __init__(self, conn): + self.conn = conn + + def on_error(self, frame): + print(f"Received an error: {frame.body}") + + def on_message(self, frame): + print(f"Received a message: {frame.body}") + self.conn.ack(id=frame.headers['message-id'], subscription=frame.headers['subscription']) + print(f"Message {frame.headers['message-id']} acknowledged (deleted).") + + # OCI Queue configuration + queue_id = '' # Replace with your OCI Queue OCID + hosts = [('cell-1.queue.messaging..oci.oraclecloud.com', 61613)]. # Replace region and port for SSL (61614) + + # OCI User credentials + username = '/'. # Replace with your OCI username + password = ''. # Replace with your OCI password + encoded_password = base64.b64encode(password.encode("utf-8")).decode("utf-8") + + # Initialize STOMP connection with SSL + conn = stomp.Connection(host_and_ports=hosts) + conn.set_ssl(for_hosts=hosts, ssl_version=ssl.PROTOCOL_TLS) + + # Set the listener for handling messages + conn.set_listener('', Listener(conn)) + + # Connect to the queue + try: + print("Connecting to OCI Queue...") + conn.connect(username=username, passcode=encoded_password, wait=True) + print("Connected successfully.") + + conn.subscribe(destination=queue_id, id=1, ack='client-individual') + + print("Waiting for messages...") + while True: + time.sleep(1) + + except KeyboardInterrupt: + print("Disconnecting consumer...") + conn.disconnect() + + except Exception as e: + print(f"Error: {e}") + conn.disconnect() + + + ``` + +2. **Run the Consumer Script:** + + ``` + + python3 stomp_consumer.py + + ``` + +3. **Verify Messages Consumed:** + + * The script will print received messages. + * Acknowledged messages will be deleted from the queue. + +## Task 5: Test the Producer and Consumer + +1. **Simultaneous Testing:** + + * Open two terminal sessions. + * Run the producer script in one session and the consumer script in another. + * Verify real-time message exchange between the producer and consumer. + +2. **Monitor Queue Activity:** + + Use the OCI Console to monitor the queue's activity and ensure messages are processed correctly. + +## Task 6: Cleanup (Optional) + +1. **Stop the Producer and Consumer:** + + Interrupt the running scripts using Ctrl+C. + +2. **Delete Messages:** + + Ensure all messages in the queue are processed and acknowledged. + +3. **Terminate Resources:** + + If no longer needed, delete the compute instance to avoid additional costs. + +## Learn More + +* [OCI Queue Blog](https://blogs.oracle.com/cloud-infrastructure/post/announcing-oci-queue) +* [OCI Queue Documentation](https://docs.oracle.com/en-us/iaas/Content/queue/home.htm) + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 diff --git a/queue-decouple-app-message-filter-fairness/lab5-message-filter-fairness-stomp/lab5-message-filter-fairness-stomp.md b/queue-decouple-app-message-filter-fairness/lab5-message-filter-fairness-stomp/lab5-message-filter-fairness-stomp.md new file mode 100644 index 00000000..ebb78b0e --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/lab5-message-filter-fairness-stomp/lab5-message-filter-fairness-stomp.md @@ -0,0 +1,276 @@ +# Lab 5: Queue Channels - Filter Messages and Messaging Fairness using open source STOMP API + +## Introduction + +This lab demonstrates how to produce and consume messages using the open-source STOMP protocol with OCI Queue channels. You will use channel metadata to enable message categorization and fairness in consumption. + +Estimated Lab Time: -- minutes + +### Objectives + +In this lab, you will: + +* Produce messages to Queue Channels using open-source STOMP +* Filter messages and consume messages from Queue Channels using open-source STOMP + +### Prerequisites + +This lab assumes you have: + +* An Oracle Cloud account +* All previous labs successfully completed + +## Task 1: Prepare the Environment + +1. **Ensure Your Instance is Ready:** + + * Use the compute instance created in **Lab 2**. + * Confirm that Python 3 and the stomp.py library are installed: + + ``` + + pip3 install stomp.py + + ``` + +2. **Verify OCI Configuration:** + + * Confirm your OCI Queue OCID, user credentials, and STOMP endpoint are correctly configured. + * For channel-specific operations, verify that the channel ID is correctly defined. + +## Task 2: Generate OCI Credentials for STOMP + +OCI Queue's STOMP endpoint uses credentials associated with Auth Tokens in OCI. Here is how to create them: + +1. **Locate Your OCI Username** + + * Log in to the [OCI Console](https://www.oracle.com/cloud/sign-in.html). + * Click your profile icon in the upper-right corner and select **User Settings**. + * Note your **Username** from the details shown. + +2. **Create an Auth Token for STOMP** + + * In the **User Settings**, scroll down to the **Auth Tokens** section. + * Click **Generate Token**. + * Provide a description (e.g., *STOMP Auth Token*) and click **Generate Token**. + * Copy the generated token immediately. It will serve as your **password** for STOMP connections. + +3. **Use Credentials in STOMP Applications** + **Username**: Your OCI username + **Password**: The Auth Token + + +## Task 3: Write the Producer Application + +1. **Create the Producer Script:** + + On your instance, create a file named *stomp_producer_channel.py*: + + ``` + + nano stomp_producer_channel.py + + ``` + + The producer code: + + ```python + + #!/usr/bin/python3 + import time + import stomp + import base64 + import ssl + + # OCI Queue ID and STOMP endpoint + queue_id = '' # Replace with your OCI Queue OCID + channel_id = f'{queue_id}/STOMPCH1' # Replace with your Channel + hosts = [('cell-1.queue.messaging..oci.oraclecloud.com', 61613)] # Replace with your region's STOMP host and port + + # OCI User credentials + username = '/' # Replace with your username + password = '' # Replace with your password + + # Encode the password to Base64 as required for OCI STOMP connections + encoded_password = base64.b64encode(password.encode("utf-8")).decode("utf-8") + + # Initialize STOMP connection with SSL + conn = stomp.Connection(host_and_ports=hosts) + conn.set_ssl(for_hosts=hosts) + + # Connect to the queue + conn.connect(username=username, passcode=encoded_password, wait=True) + + try: + print("Sending messages to OCI Queue with Channel...") + count = 1 + while True: + # Message content + message = f'Hello OCI Queue via STOMP! Message {count}' + + # Include channel metadata in headers as needed + # headers = { + # 'x-oci-metadata-channel-id': queue_id + # 'x-oci-custom-properties-custom_key': 'custom_value' + # } + + # Send message to the destination queue + conn.send(body=message, destination=channel_id) # include headers=headers if headers specified earlier + print(f"Sent message: {message} via Channel: {channel_id}") + count += 1 + time.sleep(1) # Send messages every second + + except KeyboardInterrupt: + print("Producer interrupted. Disconnecting...") + conn.disconnect() + except Exception as e: + print(f"Error: {e}") + conn.disconnect() + + + ``` + +2. **Run the Producer Script:** + + ``` + + python3 stomp_producer_channel.py + + ``` + +3. **Verify Messages Sent:** + + * The script will output messages sent with the channel ID. + * Check the OCI Console to verify the channel-specific messages. + +## Task 4: Write the Consumer Application + +1. **Create the Consumer Script:** + + On your instance, create a file named *stomp_consumer_channel.py*: + + ``` + + nano stomp_consumer_channel.py + + ``` + + The consumer code: + + ```python + + #!/usr/bin/python3 + import time + import stomp + import base64 + import ssl + + # Define a Listener class inheriting from stomp.ConnectionListener + class Listener(stomp.ConnectionListener): + def __init__(self, conn): + self.conn = conn + + def on_error(self, frame): + print(f"Received an error: {frame.body}") + + def on_message(self, frame): + print(f"Received a message: {frame.body}") + + # Acknowledge (delete) the message after processing + self.conn.ack(id=frame.headers['message-id'], subscription=frame.headers['subscription']) + print(f"Message {frame.headers['message-id']} acknowledged (deleted).") + + # OCI Queue configuration + queue_id = '' # Replace with your OCI Queue OCID + channel_id = f'{queue_id}/STOMPCH1' # Replace with your Channel + hosts = [('cell-1.queue.messaging..oci.oraclecloud.com', 61613)] # Replace region and port for SSL (61614) + + # OCI User credentials + username = '/' # Replace with your OCI username + password = '' # Replace with your OCI password + + # Encode the password to Base64 + encoded_password = base64.b64encode(password.encode("utf-8")).decode("utf-8") + + # Initialize STOMP connection with SSL + conn = stomp.Connection(host_and_ports=hosts) + conn.set_ssl(for_hosts=hosts, ssl_version=ssl.PROTOCOL_TLS) + + # Set the listener for handling messages + conn.set_listener('', Listener(conn)) + + # Connect to the queue + try: + print("Connecting to OCI Queue...") + conn.connect(username=username, passcode=encoded_password, wait=True) + print("Connected successfully.") + + # Subscribe to the queue with channel filter + #Optional header as needed + # headers = { + # 'x-oci-metadata-channel-id': queue_id + # } + conn.subscribe(destination=channel_id, id=1, ack='client-individual') #include headers=headers if specified earlier + + print("Waiting for messages...") + while True: + time.sleep(1) # Keep the consumer alive + + except KeyboardInterrupt: + print("Disconnecting consumer...") + conn.disconnect() + + except Exception as e: + print(f"Error: {e}") + conn.disconnect() + + ``` + +2. **Run the Consumer Script:** + + ``` + + python3 stomp_consumer_channel.py + + ``` + +3. **Verify Messages Consumed:** + + * The script will print received messages with the channel ID. + * Confirm the messages are deleted after acknowledgment. + +## Task 5: Test Messaging Fairness + +1. **Simulate Multiple Channels:** + + * Modify the producer script to send messages to multiple channels. + * Use separate consumer scripts to consume messages from different channels. + +2. **Monitor Activity:** + + * Use the OCI Console to monitor message distribution across channels. + * Verify that each channel's consumer receives only its designated messages. + +## Task 6: Cleanup (Optional) + +1. **Stop the Producer and Consumer:** + + * Interrupt the running scripts using Ctrl+C. + +2. **Delete Messages:** + + * Ensure all messages in the queue and channels are processed and acknowledged. + +3. **Terminate Resources:** + + * If no longer needed, delete the compute instance to avoid additional costs. + +## Learn More + +* [OCI Queue Blog](https://blogs.oracle.com/cloud-infrastructure/post/announcing-oci-queue) +* [OCI Queue Documentation](https://docs.oracle.com/en-us/iaas/Content/queue/home.htm) + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/banner-info-highlight.png b/queue-decouple-app-message-filter-fairness/need-help/images/banner-info-highlight.png new file mode 100644 index 00000000..9d902d40 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/banner-info-highlight.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/banner-info-highlight2.png b/queue-decouple-app-message-filter-fairness/need-help/images/banner-info-highlight2.png new file mode 100644 index 00000000..e6481648 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/banner-info-highlight2.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/click-groups.png b/queue-decouple-app-message-filter-fairness/need-help/images/click-groups.png new file mode 100644 index 00000000..b3298649 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/click-groups.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/compartment-select.png b/queue-decouple-app-message-filter-fairness/need-help/images/compartment-select.png new file mode 100644 index 00000000..1ccdd51a Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/compartment-select.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/compartment-select2.png b/queue-decouple-app-message-filter-fairness/need-help/images/compartment-select2.png new file mode 100644 index 00000000..918a36e1 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/compartment-select2.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/domain-groups.png b/queue-decouple-app-message-filter-fairness/need-help/images/domain-groups.png new file mode 100644 index 00000000..dd4f443a Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/domain-groups.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/e-mail.png b/queue-decouple-app-message-filter-fairness/need-help/images/e-mail.png new file mode 100644 index 00000000..764e2405 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/e-mail.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/help-button.png b/queue-decouple-app-message-filter-fairness/need-help/images/help-button.png new file mode 100644 index 00000000..0b44830a Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/help-button.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/help-button2.png b/queue-decouple-app-message-filter-fairness/need-help/images/help-button2.png new file mode 100644 index 00000000..c26e3ce0 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/help-button2.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/login-demo1.png b/queue-decouple-app-message-filter-fairness/need-help/images/login-demo1.png new file mode 100644 index 00000000..ec520646 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/login-demo1.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/policy-missing.png b/queue-decouple-app-message-filter-fairness/need-help/images/policy-missing.png new file mode 100644 index 00000000..7ebd0109 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/policy-missing.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/private-ssh-key-denied.png b/queue-decouple-app-message-filter-fairness/need-help/images/private-ssh-key-denied.png new file mode 100644 index 00000000..4b89890e Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/private-ssh-key-denied.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/rate-this-workshop.png b/queue-decouple-app-message-filter-fairness/need-help/images/rate-this-workshop.png new file mode 100644 index 00000000..c8a1e36e Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/rate-this-workshop.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/reset-password2.png b/queue-decouple-app-message-filter-fairness/need-help/images/reset-password2.png new file mode 100644 index 00000000..fabe596d Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/reset-password2.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/select-compartment.png b/queue-decouple-app-message-filter-fairness/need-help/images/select-compartment.png new file mode 100644 index 00000000..589c7426 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/select-compartment.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/select-domain.png b/queue-decouple-app-message-filter-fairness/need-help/images/select-domain.png new file mode 100644 index 00000000..15342a07 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/select-domain.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/view-login-info.png b/queue-decouple-app-message-filter-fairness/need-help/images/view-login-info.png new file mode 100644 index 00000000..6be63aa8 Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/view-login-info.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/images/workshop-homepage-2.png b/queue-decouple-app-message-filter-fairness/need-help/images/workshop-homepage-2.png new file mode 100644 index 00000000..37bb0f3d Binary files /dev/null and b/queue-decouple-app-message-filter-fairness/need-help/images/workshop-homepage-2.png differ diff --git a/queue-decouple-app-message-filter-fairness/need-help/need-help-livelabs.md b/queue-decouple-app-message-filter-fairness/need-help/need-help-livelabs.md new file mode 100644 index 00000000..9a86889b --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/need-help/need-help-livelabs.md @@ -0,0 +1,107 @@ +# Need help? + +## Introduction +This page is designed to help you solve some common problems users face in this LiveLab. + +After reading those troubleshooting tips, if you still find yourself stuck or would like to report an issue with the workshop, click the question mark icon in the upper right corner to contact the LiveLabs team directly via email. + +![Help button](./images/help-button2.png) + +For more about getting support using our email, click [here](#HowtoFormatYourSupportEmailRequest). + +### Common Issues Table of Contents + - [Can't Log in to Oracle Cloud](#CantLogintoOracleCloud) + - [Can't Create An Oracle Database? Nothing In Your Compartment?](#CantCreateanOracleDatabase?NothinginYourCompartment?) + - [Connectivity Issues?](#ConnectivityIssues?) + - [Cannot Access Cloud Shell?](#CannotAccessCloudShell?) + - [Cannot Connect to the Marketplace Compute Instance Using a Private SSH Key?](#CannotConnecttotheMarketplaceComputeInstanceUsingaPrivateSSHKey?) + - [Cannot Create Passwords for Database Users?](#CannotCreatePasswordsforDatabaseUsers?) + +## How to Format Your Support Email Request +This will construct an email in your default mail application that is auto-populated to address our LiveLabs support inbox and will also include your current workshop in the subject line. Follow the steps below to contact us and get a quick resolution to your issue. + +1. In the subject line please provide the **Workshop Name** (see example). + ![Email](./images/e-mail.png) + +2. Include the **Lab Number**, **Task Number**, and **Step Number** where you've encounter the issue. Also, include the **environment** where you are running this workshop (your tenancy or the LiveLabs sandbox tenancy). + +3. Include the description of your **issue** and any pertinent information in the contents of your email. + +4. Attach a **Screenshot** and **Any Troubleshooting Steps** you've tried, so that we can recreate the issue and provide a timely and accurate solution. + +## Can't Log in to Oracle Cloud +1. Double-check that you are using the information and credentials provided to you in the lab banner. + + ![Lab banner](./images/banner-info-highlight.png) + +2. Make sure you are using the tenancy, username, and password provided to you in the lab banner. + + ![Login information](./images/login-demo1.png) + +3. If you need to view your login information anytime, click **View Login Info**. + + ![View Login Info](./images/view-login-info.png) + +## Can't Create an Oracle Database? Nothing in Your Compartment? +1. Ensure that under "List Scope", you are selecting the compartment provided to you in the lab banner. + +2. If you can't find your compartment in the drop-down box, make sure you *set your region* to the one provided in the lab banner. + + ![Set region](./images/compartment-select.png) + +## Connectivity Issues? + +Are you connected to a **VPN**, **Corporate Network**, or behind a strict **Firewall**? + +If any of these three conditions are true, some ports in your network may be closed to traffic. + +For uploading data through Database Actions in your web browser and applications like the Oracle Analytics Tool could be restricted and may appear to "Hang" or freeze. + +While connecting to a noVNC workshop, you might get "Hmmm... can't reach this page" error and could not access the workshop. + +Try these options to access the environment again: + +1. Please disconnect from your VPN and try again if applicable. + +2. If you are connected to a corporate network, try switching to a public or a "clear" network if allowed. + +3. Check and disable the ad blocker if there is one setup for your browser. + +4. Try running the workshop in a different browser other than your current browser. + +5. For the noVNC workshop, check if you can open port 6080. + +6. For other standard scenarios, check if you can open ports such as 80, 443, and 22 (for ssh). + +7. Alternatively, contact your IT Administrator to see if adding exceptions to your network or firewall would be viable. + +## Cannot Access Cloud Shell? + + ![Policy Missing Error](./images/policy-missing.png " ") +If the workshop asks you to open the cloud shell, but you cannot access it, please make sure that you are in the compartment assigned to you. + +1. Click the **Navigation Menu** in the upper left, navigate to **Compute**, and select **Instances**. + + ![Compute Instances](https://oracle-livelabs.github.io/common/images/console/compute-instances.png " ") + +2. Select the compartment you are assigned to (check which compartment you are assigned to on the LiveLabs *Login Info* page). Expand the **root** compartment and then the **Livelabs** compartment. Select the compartment assigned to you. + ![Lab banner](./images/banner-info-highlight.png) + ![Select Compartment](./images/select-compartment.png " ") + +3. Relaunch your cloud shell. You should be able to open your cloud shell. + ![Cloud Shell](https://oracle-livelabs.github.io/common/images/console/cloud-shell.png " ") + +## Cannot Connect to the Marketplace Compute Instance Using a Private SSH Key? + + ![Policy Missing Error](./images/private-ssh-key-denied.png " ") +1. If you cannot connect to your compute instance using your private SSH key, please make sure the private key you provide and use matches the public SSH key you provide when you reserve the workshop on LiveLabs. + + +## Cannot Create Passwords for Database Users? + +1. Make sure the password you enter satisfies the following [restrictions](https://docs.oracle.com/en/cloud/saas/marketing/responsys-user/Account_PasswordRestrictions.htm). + +## Acknowledgements + +* **Author** - Abhishek Bhaumik, Product Manager +* **Last Updated By/Date** - Abhishek Bhaumik, January 2025 \ No newline at end of file diff --git a/queue-decouple-app-message-filter-fairness/workshops/tenancy/index.html b/queue-decouple-app-message-filter-fairness/workshops/tenancy/index.html new file mode 100644 index 00000000..6acdb69d --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/workshops/tenancy/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/queue-decouple-app-message-filter-fairness/workshops/tenancy/manifest.json b/queue-decouple-app-message-filter-fairness/workshops/tenancy/manifest.json new file mode 100644 index 00000000..55da59bd --- /dev/null +++ b/queue-decouple-app-message-filter-fairness/workshops/tenancy/manifest.json @@ -0,0 +1,40 @@ +{ + "workshoptitle": "OCI Queue : Decouple application components, message filtering and fairness using OCI Queue", + "help": "livelabs-help-oci_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction to OCI Queue", + "filename": "../../introduction/introduction.md" + }, + { + "title": "Get Started", + "filename": "../../cloud-login/cloud-login.md" + }, + { + "title": "Lab 1: Deploy OCI Queue", + "filename": "../../lab1-deploy-queue/lab1-deploy-queue.md" + }, + { + "title": "Lab 2: Decouple application components/ micro-services using OCI Queue SDK", + "filename": "../../lab2-decouple-application-oci-queue-sdk/lab2-decouple-application-oci-queue-sdk.md" + }, + { + "title": "Lab 3: Queue Channels - Filter Messages and Messaging Fairness using OCI Queue SDK", + "filename": "../../lab3-message-filter-fairness-oci-queue-sdk/lab3-message-filter-fairness-oci-queue-sdk.md" + }, + { + "title": "Lab 4: Decouple Application Components/Microservices Using Open-Source STOMP API", + "filename": "../../lab4-decouple-application-stomp/lab4-decouple-application-stomp.md" + }, + { + "title": "Lab 5: Queue Channels - Filter Messages and Messaging Fairness using open source STOMP API", + "filename": "../../lab5-message-filter-fairness-stomp/lab5-message-filter-fairness-stomp.md" + }, + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename": "../../need-help/need-help-livelabs.md" + } + ] +}