Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 months ago.
Improve this question
I have seen many socket application in which there is use of MSMQ. But when I go in details I think that we can do it without MSMQ also, so I want to know what is key benefit of MSMQ. Why should someone use MSMQ in his own application.
MSMQ is a great piece of Windows. It is basically a message-oriented middleware that helps a lot in some software architectures.
This mainly addresses the common use case of asynchronous message processing: you have a service Service1 that communicates (send messages) with another part of your software architecture, say Service2.
Main problem: what if Service2 becomes suddenly unavailable? Will messages be lost?
If you use MSMQ it won't: Service1 will send messages into a queue, and Service2 will dequeue when it is available.
MSMQ will resolve following common issues:
temporary unavailability of a service: messages are persisted on the disk and will be dequeued when the service becomes available again, so no messages are lost
as it's fully asynchronous, it'll help a lot in case of punctual peak load: your Service2 won't die under the heavy load, it'll just dequeue and process messages, one after one
Pros of MSMQ vs another message-oriented middleware:
free and built-in (shipped with Windows)
light
good integration with other Microsoft products (for instance there is the System.Messaging namespace in .Net to deal with MSMQ)
monitoring capabilities (using perfmon counters: number of message received per second...)
transactional queues
persistence on disk so messages are never lost
available through the network (remote queues)
Related
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 days ago.
Improve this question
I am creating a single Azure Container App that will need to run whenever there is a new message in a Pub/Sub subscription.
I am a little confused as to how I will set up the Container App to process the messages.
In Azure Functions, "the platform" is responsible for invoking my Function. I simply need to specify the trigger. So for instance, if I wanted to have the Function run whenever there was a message in Service Bus, it was the platform that was subscribed to the topic and would invoke my function, passing in the payload as a parameter to my Function, whenever it received a new message.
I do not know if similar functionality is available or if I have to create my app as a BackgroundService and subscribe to receive each message.
To add to my confusing: KEDA. It seems like this is what is responsible to scaling out the number of instances, but I don't think it works like Functions where it would pass in the payload as a parameter.
Finally, Pub/Sub also has Push delivery, which means I should be able to stand up an HTTP endpoint and have the messages sent there.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I want to send Email and SMS in bulk in c# MVC. So, method would be better, cron in a web application or separate scheduler service for it?
I have a web application running already. So, should I integrate the cron in the web app itself or create a new scheduler service for it.
I want to use the best method in terms of reliability, speed and load of data.
its better to make separate service for that for the below reasons :
1- Maintainability : If there is a problem in sending mails or SMS you know where you need to check without going to your main solutions.
2- Availability & Scalability : You can scale this Module only or if any thing happens to your main app, your mailing and sms will still be working.
3- Separation of Concerns : SMS and Emailing is considered to be a cross cutting functionality that it will be used in alot of places in system, so it is better to have it in one separate place.
4- I/O latency : like this you will avoid any latency or any performance effects on your main business domain.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
We are trying to create a solution for high frequency trading application on SOA. As resident of .NET, we are using WCF services. Searching Google, I found REST payload is less than the SOAP payload. REST is faster than the SOAP. At the same time, SOAP has some other advantages like Transaction support, more binding support, so on.
Which will be faster netTCPbinding with SOAP or REST with JSON?
Which one should has more advantages for high load and low latency system?
Any pointers?
Generally speaking REST has a better performance, you may check this entry Rest vs. Soap. Has REST a better performance?
Anyway for HFT this could be not enough, as Udi said, you may pay attention to your application architecture and your infrastructure, avoid closing connections, use TCP protocol directly instead HTTP, use non-blocking io technics to improve TPS, maybe using messaging systems (kind of JMS) ...
is a broad topic
For any type of low latency scenario, you should be avoiding network calls like the plague. If you really want to play in the HFT space, you'll need to handle much deeper architectural questions than the ones raised here.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am building a WPF frontend that interacts with another EXE that is acting as a TCP service. I had never looked at this before today... being focused on the front end..
However, when I looked at it today, it uses a While true loop with a Thread.sleep(5000) in it to keep it alive and able to process requests from the GUI. However, this seems ridiculous. while it's sleeping, it can't respond to requests and this is causing the GUI to hang while it waits.
Shouldn't this be implimented as a service running in IIS or as a window's service? At least that way it would be more responsive and manageable through the IIS management console?
Thanks
Harold
Rather than sleeping in the loop, it should be waiting for new incoming requests. IIS/ASP.NET could do this for you, but that may be overkill, and may impose hosting requirements that conflict with other requirements. Assuming you don't want to use ASP.NET, a service in C# should inherit from System.ServiceProcess.ServiceBase, which has virtual functions you implement that are called to start and stop the service. These should start and stop one or more secondary threads which do all the processing. Depending on what kind of connection it is expecting, you'd have different ways of waiting for new requests. Assuming it's raw sockets, Such processing should not involve sleeping, as it should be accepting connections on a socket with Socket.Accept and then waiting for instructions (request details) using Socket.Receive, then immediately processing the request and going back to waiting on new input. None of those involve sleeping and make it possible to not only respond quickly, but respond to multiple requests simultaneously.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am working on a newsletter. Newsletter content is saved in the table along with frequency such monthly, weekly, daily. Newsletter also have start date. What I have to do is based on the data and frequency. Newsletters are emailed to all the subscribers. My confusion is that whether I need to write a sql server job for this or simply asp.net can do this. If yes then how would I be able to do this.
As your web application will be terminated in times of inactivity, you usually have a service or task scheduler run such periodical tasks. Also your web application is responsible to return requests quickly and should run with a very limited set of permissions that might not be enough for your jobs (it is preferable not to allow the app pool account to send e-mails to lots of accounts).
There are various alternatives that differ in terms of convenience and deployment of your application.
An important requirement besides the capability to run jobs periodically is how you can trace errors in the job, so you should think about your logging strategy before the first problems arise.
Besides writing a SQL Server job, you could also:
Create a console application and use Windows task scheduler to run it periodically (interval is the minimum of your scheduling options, in your question daily). This is easy to implement, but requires some steps to deploy it to a computer.
Create a dedicated windows service that is installed to the computer. While this requires more effort to create and test the service, you can also create an installer to simplify the deployment.
I eventually went for the application events. I set the timer in application event and it works similar like jobs and windows services.