Amazon SQS with C # and SQL Server

I was prompted to use Amazon SQSin our new system. Our business relies on what tasks / requests from customers are provided to our support agents, and once a customer submits their task / request, it has to be queued in my SQL Server database and all queued tasks have to be assigned not busy agent because the thread says that the agent can process or process one task / request at the same time, so if my system received 10 tasks / requests, everything should be queued, then the system should send the task to the agent, which is now free of charge, and as soon as the agent solves the problem, he must receive the next one, if any, otherwise the system must wait for any agent before completing its current task in order to assign a new one, and, of course,there should be no duplication in the processing of tasks / requests ... etc.

What do I need now?

  • A simple link that might clarify what Amazon SQS is, since this is my first time using the Queuing service?

  • How can I use the same thing with C # and SQL Server? I have read this section , but I still feel like there is something messy as I cannot get started. I'm just aiming at how I can process a task at runtime and assign it to an agent, then close it and get a new one as I explained above.

+3


source to share


1 answer


Asking us to develop a system based on a paragraph of prose is a pretty high order.
SQS is just a cloud queuing system. Based on your description, I'm not sure if this will make your system better.

First, you already store everything in your database, so why would you want to store things in a queue? If you want to have queue semantics when storing stuff in your database, you can consider SQL Server Service Broker ( https://technet.microsoft.com/en-us/library/ms345108(v=sql.90).aspx#sqlsvcbr_topic2 ) which supports queues in SQL.Alternatively, if your scale isn't going to be high enough (more than 100 tasks / per second, maybe), you can simply query the table for the tasks to be matched.



Second, it looks like you might have a workflow around tasks that can span more than one queue for agents to pick up. For example, do you perform any action on tasks (email clients to ask them how their service is, pause the task until the client comes back to you, etc.)? If so, you can look at the Simple Workflow Service ( https://aws.amazon.com/swf/ ), or since you are already on the Microsoft stack, you can look at the Windows Workflow Service ( https: // msdn. microsoft.com/en-us/library/ee342461.aspx )

BTW, SQS does not guarantee delivery of "just one" by default, so if you have a big problem, you will either have to do your own deduplication or use FIFO queues ( http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide /FIFO-queues.html ), which support deduplication, but are limited to 300 transactions per second (aka: roughly 100 messages per second for the standard send API send โ†’ receive โ†’ delete. Using batch processing, obviously the number could be much higher, but, given your use case, it doesn't seem like you can use batch processing without a lot of work).

+2


source







All Articles