Lab 4: Configuring the System to Use Simple Queue Service.

In this lab, I will create a notification system for orders, first I need to go to AWS and create a new queue is SQS management.

sqs.PNG

Now I must test to make sure the queue is actually working by sending a test message to it. I just called the message test.

sqs1.PNG

Now I need to replace some code inside of the Checkout.aspx.cs file.

sqscode.PNG

I had so many issues with this code… I made the changes and it just kept giving me errors on launch. after an hour of fault checking, it was because I had a time difference on my local PC compared to AWS. My time was out by an hour because of my dual Linx boot.

For this code to work I also had to add a few more using statements.

sqsusuing.PNG

I know need to add credentials to my web.config file to link to AWS I did add these you are going to have to trust me. The next step would not work otherwise!

So I will now create a new order and once I confirm it, it should appear in my queue.

T-Rexcheckoutpayment

Now I have brought my T-Rex lets see the order. It’s there!

sqs5.PNG

I now need a new application that can pull the orders, auto polls and add’s to the database, called OrderProcessor Program.cs

I have now added the Order program file into my solution.

nawyea.PNG

I now need to edit the program.cs code to link to my queue.

queue2queue1

I now need to edit the app.config file

data.PNG

I now needed to set up the order processing to be on startup

net702

and untick “sign the ClickOnce Manifests

net702 yo

Issues!

So I tried to run it and nothing would work, It could not see my AWS packages… I tried adding them via using with no luck. So lucky I made a backup I reloaded that.

Now following the guide “Add the folder to the code” is easier than said. I found that if I add an item then look for the program file and click that It loads the program into the solution.

After re-adding the above it still would not run, I was having credential errors with MySql, so I checked over everything and decided to just copy lines from the other files that I knew worked and put it here. (AWS Key and Database Link)

Now it works!

fhdskj.PNG

dinnn.PNG

Note: A lot of the issues I encounter a code side…. I am learning it as I go but having a good understanding of C# and the IDE would make it easier.

 

 

 

Post Author: Techdox

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.