What is best for communication between two components

We are currently working on a project, and we are in the design and architecture stages of the project, the following project highlights.

  • There are switches that generate real-time data.
  • We have two components that must be executed in Java / Java EE, name it CompA and CompB
  • CompA applies some process based on input from the switch without accessing any databases, CompA does not have access to the database.
  • CompB takes the CompA recording process and applies the processing as well, it includes a business database
  • CompA and CompB have multiple instances in the system for scalability and fault tolerance.
  • A record is a text record that has several fields.
  • The record is transactional, the record is considered processed if it is processed both with CompA and CompB, otherwise it will be rolled back and resubmitted

Now the problem is that the best way to communicate between CompA adn Comp B

One of the methods -

  1. CompA --------> CompB
  2. CompA --------> Messaging Server (JMS) ------> CompB

Requirement:. There will be more than one CompA, and CompB the system, and if any component fails, the download will be used by other peers, for example, if CompA does not fulfill its load, they will be shared by other instances of CompA in the system. To do this, we will use the second option with JMS, so that CompA is not closely related to CompB. But with the advent of the new Component (Messaging Server), this can lead to performance degradation, because real-time transaction processing records the system.
Your suggestions and expert advice will be highly appreciated

+7
source share
2 answers

JMS is the way to it - http://docs.oracle.com/javaee/6/tutorial/doc/bnceh.html

It is very reliable, you can do things like message expiration and priority setting, and it is ideal for your model, which basically consists of โ€œseveral manufacturers / several consumersโ€ over the network.

JMS supports transactions and is built for reliability - today it is the most reliable mechanism. In terms of performance, you should talk more about "scalability" than about "raw performances." If your equipment can handle it, JMS will.

Wikipedia has a very good list of available JMS implementations: http://en.wikipedia.org/wiki/Java_Message_Service#Provider_implementations

I used Apache ActiveMQ, Open Message Queue, and OpenJMS, and even if I have no experience deploying JMS servers in a clustered environment, I agree that ActiveMQ is the most reliable solution I have used.

+5
source

I would suggest using JMS with spring integration . check example

In my case, we used ActiveMq with spring integration so that we can easily handle load balancing and errors.

+1
source

All Articles