28

For me JMS and ESB seem to be very related things and I'm trying to understand how exactly they are related.

I've seen a sentence that JMS can be used as a transport for ESB - then what else except the transport should be present in such an ESB? Is JMS a simple ESB or if not, then what it lacks from the real ESB?

afrish
  • 3,167
  • 4
  • 30
  • 38
  • 4
    The cynical amongst us would say that JMS is a specific Java API, where "ESB" is a marketing term that covers a multitude of related technologies and design methods, and means very little. – skaffman Mar 16 '11 at 10:42
  • 1
    @skaffman even some bright-eyed optimists might agree with you ;-) – djna Mar 16 '11 at 21:39

8 Answers8

31

JMS offers a set of APIs for messaging: put a message on a queue, someone else, sometime later, perhaps geographically far away takes the message off the queue and processes it. We have decoupled in time and location of the message provider and consumer. Even if the message consumer happens to be down for a time we can keep producing messages.

JMS also offers a publish/subscribe capability where the producer puts the message to a "topic" and any interested parties can subscribe to that topic, receiving messages as and when they are produced, but for the moment focus just on the queue capabilty.

We have decoupled some aspects of the relationship between provider and consumer. However some coupling remains. First, as things stand every message is processed in the same way. Suppose we want to introduce different kinds of processing for different kinds of messages:

 if ( message.customer.type == Platinum )
      do something special

Obviously we can write code like that, but an alternative would be to have a messaging system that can send different messages to different places we set up three queues:

 Request Queue, the producer(s) puts their requests here
 Platinum Queue, platinum consumer processing reads from here
 Standard Queue, a standard consumer reads messages from here

And then all we need is a little bit of cleverness in the queue system itself to transfer then messsage from the Request Queue to the Platinum Queue or Standard Queue.

So this is a Content-Based Routing capability, and is something that an ESB provides. Note that the ESB uses the fundamental Queueing capabilities offered by JMS.

A second kind of couppling is that the consumer and producer must agree about the message format. In simple cases that's fine. But when you start to have many producers all putting message to the same queue you start to hit versioning problems. New message formats are introduced but you don't want to change all the existing providers.

  Request Version 1 Queue  Existing providers write here
  Request Version 2 Queue  New provider write here, New Consumer Reads here

And the ESB picks up the Version 1 Queue messages and transforms them into Version 2 messages and puts them onto the Version 2 queue.

Message transformation is another possible ESB capability.

Have a look at ESB products, see what they can do. As I work for IBM, I'm most familiar with WebSphere ESB

djna
  • 54,992
  • 14
  • 74
  • 117
  • 1
    So JMS brings only basic queuing capabilities. ESB gives much more capabilities to manage those queues, their subscribers and providers and can be based at the low level on JMS? Or there is something else in ESB except that? – afrish Mar 16 '11 at 12:43
  • 1
    There's a whole area of debate as to what should be done "in the Bus" and what should be done outside the ESB. Different vendors have different answers. I think it's best to start with ESB as a set architectural patterns, and then look at what bits products you are considering may do for you. – djna Mar 16 '11 at 21:38
5

I would say ESB is like a facade into a number of protocals....JMS being one of them.

Arash Sharif
  • 542
  • 7
  • 16
2
  • An addition to the above list is the latest Open Source ESB - UltraESB

JMS is not well suited for the integration of REST services, File systems, S/FTP, Email, Hessian, SOAP etc. which are better handled with an ESB that supports these types natively. For example, if you have a process that dumps a CSV file of 500MB at midnight, and you want another system to pickup the file, parse CSV and import into a database, this can easily be accomplished by an ESB - whereas a solution with just JMS will be bad. Similarly, integration of REST services, with load balancing/failover to multiple backend instances can be done better with an ESB supporting HTTP/S natively.

Asankha
  • 312
  • 1
  • 3
  • 2
    Dumping CSV and picking up for processing can be done in several other ways.. Expensive ESB solution is not needed for that. Any better and complex use case that ESB can handle is going to be a good candidate for it. – Kevin Rave Aug 18 '14 at 18:54
1

This Transformation does not happen automatically. You need to configure the mapping or write transformation service

Look at https://access.redhat.com/knowledge/docs/en-US/JBoss_Enterprise_SOA_Platform/4.2/html/SOA_ESB_Message_Transformation_Guide/ch02s03.html

Regards, Raja Nagendra Kumar, C.T.O www.tejasoft.com

1

ESB offers integration with a lot of different protocols in addition to JMS.
Most use JMS behind the scenes to transfer, stor and move messages. One such solution OpenESB, uses XML format messages.

There are open source ESB which you could checkout -

JMS implementation like ActiveMQ come with Camel inbuilt into them.

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
Padmarag
  • 7,067
  • 1
  • 25
  • 29
0

JMS is a protocol for communicating with an underlying messaging layer. ESB operates at a higher level, offering integration with multiple technologies and protocols, one of which would be JMS, in a uniform way that makes management of complex flows much simpler.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Robert Morschel
  • 341
  • 3
  • 11
0

There are JMS message brokers , that you can easily configure with ESB. https://docs.wso2.com/display/ESB470/JMS+Transport

Waruna Perera
  • 68
  • 1
  • 2
0

JMS and ESB both provide a way of communication between different applications. But the context for JMS and ESB are different. JMS is for simple need. JMS is implemented by JMS Provider. It is Java specific.

Examples of JMS Providers are: Apache Active MQ, IBM MQ, HornetQ etc.

ESB is for complex need. ESB is a component in EAI providing communication facility to various applications. It is generic & not specific to Java. JMS is one of the supported protocols.

Examples of ESB provider are: MuleESB, Apache Camel, OpenESB

Use Case: It may be an overhead to use ESB, if all our communicating applications are in Java and are using the same message format. Here JMS may be sufficient.

Dexter
  • 4,036
  • 3
  • 47
  • 55