1
votes

I would like to find a solution to create a pub/sub medium for 2 microservices to talk to each other, I am aware i can use some third parties E.g Redis, RabbitMQ Implementing event-based communication between microservices (integration events)

The challenge lies on the client is unable to allow install any third parties tool due to security reason. The messageQueue server in Windows won't be allowed to use too. I can only use the applications that is only existed in the server.

Therefore i am asking if there is anyway that i can create one simple app using windows service. It is a one-to-many relationship. I have one service that will be dealing with data, once if there is any update, it will publish to those services that is subsribed to it.

It seems my problem could be similar with

.NET Scalable Pub/Sub service implementation

WCF Pub/Sub with subscriber caching(link is dead on the WCF pub-sub)

but i dont see any critical solutions.

I was thinking to use data notifications that MSSQL offers as last alternatives, but seems like it could cause a bottle neck when the applications get scale up. The internet is so much flooded with articles using third parties tool.

Thanks

1
Where do these 2 microservices live? Both on the same pc? Are they two different applications? - Hasan Emrah Süngü
If it's only 2 applications then you just need a table (or two, for simplicity) to queue up published event information that gets removed as soon as it's handled. Pub/sub only really gets more complicated when you have different endpoints subscribing to different events. - Reinstate Monica Cellio
Are you sure the client want to pick "security" over "untested, potentially unreliable communications"? - Damien_The_Unbeliever
I've successfully implemented a queue-like communication with a table in SQL Server (you seem to suggest that is available). I only had one publisher and one consumer, so there was no issues with a queue message consumed twice. - trailmax
@EmrahSüngü yes, they are living in the same PC, yes, they are different apps. One responsible for data changes, and let the rest know. The other perform actions based on latest data. - csamleong

1 Answers

1
votes

Check out Rebus library, that allows using different transport methods to send end receive messages in just a line of code (so in the future you can change it without effort).

You could use SQL Server or try to develop your own transport method