This post look on how applications components typically interact. Event-based programming, also called event-driven architecture (EDA) is an architectural style in which one or more components in a software system execute in response to receiving one or more event notifications.

 

1. Request-response interactions

Client formulate a request, It is sent across the internet to a web server. Client wait while the server constructs a response. This response is returned across the internet to client.

 

image

In a synchronous interaction the provider is expected to send a response back

image

 

2. Events and the principle of decoupling

Events are sometimes used to represent changes of state. The system being monitored is represented as a set of resources each of which is associated with state information. Event producers send events then internal state values change. This allows monitoring applications to be notified immediately when something happens, without their having to continually poll all the resources.

In a decoupled event processing system an event producer does not depend on a particular processing or course of action being taken by an event consumer. Moreover, an event consumer does not depend on processing performed by the producer other than the production of the event itself.

 

Above chart shows Decoupling of Entities from Object-Orientation to Event-Driven Architecture.

 

3. Push-style event interactions
 
In here events are often sent as one-way messages. It pushes the event to each consumer as a one-way message as below diagram. Event producer wait for a response from the consumer

image

 

4.  Channel-based event distribution

In 3 model, producer has to send multiple copies of the same event to consumers. The event producer can find their identities by consulting an external information source.

image

 

5. Request-response interactions to distribute events

In pull-style distribution, the consumer uses the standard request-response pattern to request an event from a producer, or from an intermediary channel.To avoid having to hold on to events and to avoid having to service requests from multiple consumers, event consumer 1 sending a pull request directly to the event producer (message 1).
producer uses a regular push (message 3) to send the event to the channel, and consumer 2 requests it (message 3.1) from the channel. This approach can be extended to send multiple events in
the response messages.

image

Where is this useful

  • A consumer that is only available occasionally
  • A producer that is unable to distribute events
  • A consumer that is physically unable to receive unsolicited incoming events(eg: due to firewall)
  • A consumer that wants to regulate its processing of events and have control
    over exactly when it receives them
0

Add a comment

We used have  Singleton Design Pattern in our applications whenever it is needed. As we know that in singleton design pattern we can create only one instance and can access in the whole application. But in some cases, it will break the singleton behavior.

There are mainly 3 concepts which can break singleton property of a singleton class in java. In this post, we will discuss how it can break and how to prevent those.

Here is sample Singleton class and SingletonTest class.
13

Microservices can have a positive impact on your enterprise. Therefore it is worth to know that, how to handle Microservice Architecture (MSA) and some Design Patterns for Microservices. General goals or principles for a microservice architecture. Here are the four goals to consider in Microservice Architecture approach [1].

Reduce Cost: MSA will reduce the overall cost of designing, implementing, and maintaining IT services.
12

Last few years has been a great year for API Gateways and API companies. APIs (Application Programming Interfaces) are allowing businesses to expand beyond their enterprise boundaries to drive revenue through new business models. Larger enterprises are adopting API paradigm — developing many internal and external services that developers connect to in order to create user-facing products.
1

kubectl (Kubernetes command-line tool) is to deploy and manage applications on Kubernetes. Using kubectl, you can inspect cluster resources; create, delete, and update components.

NOTE

You must use a kubectl version that is within one minor version difference of your cluster. If not you may see errors as below

1.
2

WSO2 Enterprise Integrator is shipped with a separate message broker profile (WSO2 MB). In this Post I will be using message broker profile in EI (6.3.0).

1) Setting up the message broker profile

1.1) Copy the following JAR files from the <EI_HOME>/wso2/broker/client-lib/ directory to the <EI_HOME>/lib/ directory.
1

When two or many applications want to exchange data, they do so by sending the data through a channel that connects the each others. The application sending the data may not know which application will receive the data, but by selecting a particular channel to send the data on, the sender knows that the receiver will be one that is looking for that sort of data by looking for it on that channel.
2

Microservices are going completely over the enterprise and changed the way people write software within an enterprise ecosystem.

Let build you microservices with msf4j for Auto Mobile.

The SMPP inbound endpoint allows you to consume messages from SMSC via WSO2 ESB OR EI.

1.  Start SMSC

2.  Create custom inbound end point with below parameter. (Make sure you pick correct system-id and password correct for your SMSC)

3. Create Sequence for Inbound EP.

4. Once ESB or EI start.
1

WSO2 APIM Components

WSO2 API Manager includes five main components as the Publisher, Store, Gateway, Traffic Manager and Key Manager.

API Gateway - responsible for securing, protecting, managing, and scaling API calls. it intercepts API requests and applies policies such as throttling and security checks. It is also instrumental in gathering API usage statistics.
I am
I am
Archives
Total Pageviews
Total Pageviews
2 0 5 8 0 4 4
Categories
Categories
Loading