Sunday, May 10, 2020

Tip: How to use HTML5 Server Side Events

Server Side Events (SSE) allows the web server (node.js, IIS, Apache, etc) to keep a connection active with the client browser while server is pushing data to the client whenever needed. However SSE is not the same as WebSockets as it can only push data from server whereas WebSockets can both receive and push data. Below is a very simple SSE application developed using node.js and HTML.


Server Code



Client Code

You can include the following snippet in the html header section
You will receive the following in Chrome debugger if the message is sent successfully from the server.

Tuesday, February 18, 2020

Apache Kafka as an integration platform and technology

I came across Apache Kafka when I was searching the web for middleware integration platform. I discovered that many people are giving good comments about Apache Kafka as a high performant publish subscribe messaging platform. Below is a sample scenario/diagram that I could think of if i am to use it to integrate different systems in an organization.

One can imagine Kafka as a highway that connects all the systems in the application, whereby in traditional design, we use many APIs to connect to different systems. Kafka also serves as a component that promote the standardization of software integration by using similar connector and message protocol.

Use Cases Of Kafka
1. Fraud detection - one can monitor the events generated in Kafka and create different use cases to detect anomaly, possible frauds before a transaction is completed.
2. Microservices - Kafka can be the backbone of the microservice architecture and even for legacy applications when the right connector is used. Event driven design and architecture has become a norm for enterprise application development and that will rely heavily on a event streaming platform.
3. Capture Web Site User Behavior - Every mouse clicks that a user does can be tracked and is useful for behavioral analysis.

Friday, January 17, 2020

gRPC, a WCF Sibling?

I came across this term "gRPC " when talking to a CTO from UK. I heard of RPC but not "gRPC", so i did a quick search on Google and found out that it works similarly to Microsoft WCF, just that it supports different programming languages ranging from C++, C#, Ruby, Python, etc and it's developed by Google. WCF supports only .NET languages. To find out more here's a link https://stackoverflow.com/questions/35694273/whats-the-difference-between-grpc-and-wcf

One more thing that i would like to mention about WCF is, there's a community in the.NET Foundation that has started the effort to create an open source WCF (Currently WCF Client in development, but not the WCF core itself) targeting for .NET Core programming model. However it's still at a very infant stage and probably not ready for production use out of the box, unless user development team is willing to take on the extra effort to customize the codes and fix any new issues discovered.

The link to the WCF .NET Foundation https://www.dotnetfoundation.org/blog/2015/05/20/wcf-is-open-source

In ASP.NET Core, Visual Studio uses the Protobuf compiler to compile the proto code into C# code.
gRPC Web UI - https://github.com/uw-labs/bloomrpc which ease the testing for the gRPC service contract.