Posts

Showing posts from October, 2021

JMS: Deep dive in MQ systems and Roadmap to Kafka

Image
JMS: Java Messaging Service JMS is an example of Messaging Systems based on asynnchronous design pattern which is used by microservices to interact with each other to send data and events. For introductory part, please refer  here . JMS allow applications to create and send, receive and read messages in a shared environment. JMS: Programming Model Basic components to develop client based producer and consumer system are: ConnectionFactory : Use the Java Naming and Directory Interface (JNDI) to find a ConnectionFactory object, or instantiate a ConnectionFactory object directly and set its attributes. Based on delivery model, client has separate instance for connection factory to create a connection to a provider: Point to point :  QueueConnectionFactory Publish/subscribe: TopicConnectionFactory             The following snippet of code demonstrates how to use JNDI to find a connection factory object: Context ctx = new Init...

Enterprise applications - Need of messaging service and JMS

Why we need messaging system in enterprise applications ? If applications have dependency i.e microservices depends on each other for resources, then we need RPC , hence RPC systems were made. Remote procedure call (RPC) systems, including Java RMI, are synchronous i.e the caller must block and wait until the called method completes execution, and thus offer no potential for developing loosely coupled enterprise applications without the use of multiple threads. In other words, RPC systems require the client and the server to be available at the same time. However, such tight coupling may not be possible or desired in some applications. Message-Oriented Middleware (MOM) systems provide solutions to such problems. They are based on the asynchronous interaction model, and provide the abstraction of a message queue that can be accessed across a network. Note, however, that messaging here refers to asynchronous requests or events that are consumed by enterprise applications and not humans...