7

Currently we are working on a project and we are in design and architecture phase of the project following are main points of projects.

  • There are switches which are generating real time data
  • We have two components in to be made in Java/Java EE, call it CompA and CompB
  • CompA apply some process based on input record from switch without contacting to any databases, CompA does not have DB access.
  • CompB takes process record of CompA and apply processing also, this involves business database
  • CompA and CompB have multiple instances in system for scalability and fault tolerance.
  • Record is text record having multiple fields
  • Record is transactional , On record is considered processed if it is process from both CompA and CompB , other wise it will be roll backed and resend again

Now the problem is what is best way for communication between CompA adn Comp B

One way is

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

Requirment: There will be more than one CompA and CompB is the system and if any component fails it load will be shared by other peers e.g if CompA fails its load will be shared by other CompA instances in the system. For that we are going for second option with JMS so that CompA is not tightly bound with CompB. But as new Component (Messaging Server)is introduced this may cause performance degradation as the record processing is transactional the system is real time.
Your suggestions and expert advices will be highly appriciated

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
zaffargachal
  • 802
  • 7
  • 21

2 Answers2

5

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

It is very reliable, you can do things like set message expirations and enforce priorities and it is perfect for your model which is basically a "Multiple producer/multiple consumer" over the network.

JMS supports transactions and it is built for reliability - by far it is the most reliable mechanism available. Performance-wise, you should talk about "scalability" more than "raw performances". Provided your hardware can cope, JMS will.

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

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

thedayofcondor
  • 3,860
  • 1
  • 19
  • 28
  • We need transaction and where each compA should be able to process 6 million records per hour. I have gone through stress testing with JBoss and HornetQueue with CompA it is process almost 2 million records/Hr – zaffargachal Nov 05 '12 at 11:50
  • 1
    JMS supports transactions and it is built for reliability - by far it is the most reliable mechanism available. Performance-wise, you should talk about "scalability" more than "raw performances" – thedayofcondor Nov 05 '12 at 11:57
1

I would suggest to use JMS with spring integration. check example

In my case we have used ActiveMq with spring integration so that we were able to handle loadbalancing and fail over fetures easily.

someone
  • 6,577
  • 7
  • 37
  • 60
  • We have used JMS with spring integration on client(producer and consumer) side, and Using JBOSS with hornet queue as messaging server. The problem is what if our messaging server fail down? that all component can't communicate with each other, it means again we need to take care of Messaging server failover – zaffargachal Nov 05 '12 at 12:09
  • 1
    In the ActiveMq you can provide multiple messaging server URL by comma separately. if first one fail it load go to second messaging server. for consumers also scenario is same. Even you can configure that multiple server to load balancing as well. – someone Nov 05 '12 at 14:08
  • thanks btw I was not aware of multiple URL thing, it will help me alot, thanks – zaffargachal Nov 05 '12 at 14:14