Click here to Skip to main content
15,886,919 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralHave a nice weekend, the Bates, Billie Jean Pin
0x01AA30-Dec-22 7:31
mve0x01AA30-Dec-22 7:31 
GeneralRe: Have a nice weekend, the Bates, Billie Jean Pin
trønderen30-Dec-22 9:27
trønderen30-Dec-22 9:27 
QuestionThis is not a programming question... Pin
dandy7230-Dec-22 5:31
dandy7230-Dec-22 5:31 
AnswerRe: This is not a programming question... Pin
Gerry Schmitz30-Dec-22 5:53
mveGerry Schmitz30-Dec-22 5:53 
GeneralRe: This is not a programming question... Pin
dandy7231-Dec-22 6:38
dandy7231-Dec-22 6:38 
AnswerRe: This is not a programming question... Pin
Rick York30-Dec-22 6:12
mveRick York30-Dec-22 6:12 
GeneralRe: This is not a programming question... Pin
dandy7231-Dec-22 6:33
dandy7231-Dec-22 6:33 
AnswerRe: This is not a programming question... Pin
raddevus30-Dec-22 6:24
mvaraddevus30-Dec-22 6:24 
How fast can you explain how to use the mailslots system to someone else?

Now, here is an opposing idea that I'm putting forth as a much simpler idea.

Since this is within the confines of one Business Entity I'm suggesting that there is a central SQL Server (or other DBMS ) running on site.

How about if you broadcast a message (write a request to a table) that each service which wants to use the request simply reads it?
Think about the DBMS resiliency that you get. It's always running, failed writes are traceable etc. But it is also a "common" system for devs. Most devs can write an entry (insert) and read entries (select) easily from any language.

The table might look something like:
Subscribers Table
ServiceName, SubscriberServiceName, Active
ServiceName = publisher
SubscriberServiceName = subscriber

WorkRequest Table
SubscriberServiceName, Status, FunctionToRun, Created, Updated, Active

SubscriberServiceName = subscriber
Status = O (Open) C (Complete), E (Error)
FunctionToRun (the individual service will know what this is)

Now, the Publisher Service simply :
1. does select for all services that are subscribed to the service (Subscribers table)
2. writes a WorkRequest for each of those subscribers

Each Subscriber polls (yes this is polling) DB and checks WorkRequest for any O(pen) records that match it's SubscriberServiceName.

When it finds those it runs the functionality.

Now, everything simply depends upon writing to two tables.

Benefits
You get all the uptime benefits of SQL Server (or other Enterprise DBMS) and you can tell another dev how to use your system in minutes.

You tell Dev:

1. write a subscriber record into the subscribers table that matches your apps name (needs to be unique over company) -- this is a one-time thing. Also, the service can unsubscribe at any time.
2. Poll the database at X interval for your app and query the WorkRequestTable for O(pen) records -- so the service doesn't accidentally do the work twice.
3. When you complete the entry for the WorkRequest and succeed, write a C(losed) value in Status.
3a. If your process fails write a E(rror) in Status to indicate a failure.

Shoot Holes In This
You can shoot holes in this idea, but keeping the this simple for your devs is a strong motivator.
Also, anyone can come along and understand it. I have no idea how to use mailslots.

Also, any type of service (web app, windows forms, linux app, java app) can access the database and leverage this messaging functionality.

That's my 52 cents on the subject.

One last thing, keep in mind that a Enterprise DB Server is basically always up and if it isn't then there is a major problem at the enterprise which must be fixed by Hardware people or DBA etc.
That means you wouldn't be able to process records in this system but that would be "fine" because your point of failure is the DB which others keep running.

If you have a network failure in the current system then you have to handle all of that and it would be problematic and difficult to research (probably). Where did your failed message go?

Since my proposal depends upon Optimistic Concurrency (Implementing Optimistic Concurrency (C#) | Microsoft Learn[^]) and the DBMS you will basically never lose a message and you don't have to manage much.

Basically my point is that you get this all for free. If the DB has an issue you can't read the record and do the work, which indicates other problems.

modified 30-Dec-22 12:36pm.

GeneralRe: This is not a programming question... Pin
dandy7231-Dec-22 6:11
dandy7231-Dec-22 6:11 
GeneralRe: This is not a programming question... Pin
jschell2-Jan-23 14:02
jschell2-Jan-23 14:02 
AnswerRe: This is not a programming question... Pin
0x01AA30-Dec-22 6:56
mve0x01AA30-Dec-22 6:56 
GeneralRe: This is not a programming question... Pin
trønderen30-Dec-22 7:01
trønderen30-Dec-22 7:01 
GeneralRe: This is not a programming question... Pin
dandy7231-Dec-22 5:40
dandy7231-Dec-22 5:40 
JokeRe: This is not a programming question... Pin
dandy7231-Dec-22 6:35
dandy7231-Dec-22 6:35 
AnswerRe: This is not a programming question... Pin
trønderen30-Dec-22 7:15
trønderen30-Dec-22 7:15 
GeneralRe: This is not a programming question... Pin
jmaida30-Dec-22 14:19
jmaida30-Dec-22 14:19 
GeneralRe: This is not a programming question... Pin
dandy7231-Dec-22 5:42
dandy7231-Dec-22 5:42 
AnswerRe: This is not a programming question... Pin
englebart30-Dec-22 10:25
professionalenglebart30-Dec-22 10:25 
GeneralRe: This is not a programming question... Pin
PIEBALDconsult30-Dec-22 10:31
mvePIEBALDconsult30-Dec-22 10:31 
GeneralRe: This is not a programming question... Pin
Ravi Bhavnani31-Dec-22 18:11
professionalRavi Bhavnani31-Dec-22 18:11 
PraiseRe: This is not a programming question... Pin
Randor 31-Dec-22 18:57
professional Randor 31-Dec-22 18:57 
GeneralRe: This is not a programming question... Pin
dandy723-Jan-23 7:23
dandy723-Jan-23 7:23 
GeneralRe: This is not a programming question... Pin
Randor 5-Jan-23 15:20
professional Randor 5-Jan-23 15:20 
AnswerRe: This is not a programming question... Pin
jschell2-Jan-23 14:11
jschell2-Jan-23 14:11 
NewsDO NOT INSTALL THIS WINDOWS UPDATE: Windows 11, version 22H2 Pin
Slacker00730-Dec-22 3:11
professionalSlacker00730-Dec-22 3:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.