27

I'm looking at integrating an ESB into an existing Java/Maven web based product. Specifically, I'm looking at ServiceMix and Mule. The product will connect to several different services, including email, Quartz, RESTful webservices over HTTP, SMS and IM. I've only quickly glanced at the documentation and the two options seem to be pretty heavyweight and fairly complex. It seems like a textbook example of when to use an ESB, but I don't want to spend a great deal of time just learning one or the other system.

Like I said, I already have a web app built by Maven and was hoping integrating one of the systems would be fairly straightforward, even just for something as simple as sending an email, but it looks like adding either will pull in half the world in terms of jars and would be hard to embed in the existing product.

Is it worth trying to pull in one of these options? Is there an easy way of integrating them into an existing app without completely restructuring it? Are there other, lighter weight options? Are there some aspects that I should consider that would make their use worthwhile?

рüффп
  • 4,475
  • 34
  • 62
  • 99
Tim
  • 6,531
  • 11
  • 38
  • 45
  • 2
    What's an ESB buying you besides more complexity? Why do you think you need it? How many services is "several", and how many do you think you have to have to make an ESB necessary? – duffymo Sep 02 '09 at 00:43
  • 1
    I'm expecting to have in the low double digits of external services by the time we hit production. And they will be varied, but many of them will be serving similar purposes. Notification via email, IM or SMS, for instance, where the only difference is the medium. – Tim Sep 02 '09 at 15:56
  • 4
    A followup more than a year later. Ended up swapping out Mule for Camel. We've been very happy with Camel. Amazingly vibrant community, lightweight and there is now a book to supplement the generally good documentation. I'd say start with Camel unless there is some obvious reason you'd need a full fledged ESB. – Tim Jan 05 '11 at 14:53
  • And you could use camel inside servicemix, thus when, later on, you need things not feasable with camel alone you could use other servicemix features. – redben May 11 '11 at 10:47

5 Answers5

13

Mule is quite simple to use in terms of plugging services together with XML and they have plenty of video examples which I found really helpful.

ESBs are supposed to be future and as you say - yours does seem like a textbook example of where to use it.

I'll try to answer all your questions:

Is it worth trying to pull in one of these options? I think this is a question you need to ask yourself - what are you trying to achieve? if you're trying to make it easier to implement it will probably take the same time via pure code or ESB what with all the setup included. If you're thinking of doing it as a learning exercise it may be worthwhile.

Is there an easy way of integrating them into an existing app without completely restructuring it? Short answer no. You will require some re-engineering to integrate with most third-party libraries/frameworks.

Are there other, lighter weight options? Mule is quite simple really. You might be able to use an MQ to do the HTTP, SMS and IM. Possibly ActiveMQ or RabbitMQ.

Are there some aspects that I should consider that would make their use worthwhile? Yes, ESBs are designed for enterprises where new services are added often and the configuration is likely to change. Having it all in XML makes this change a bit easier. So if you are just building a one-off piece of software it might not be the right way to go. But if you will be adding more later and constantly connecting different services it may be the best route.

Corehpf
  • 560
  • 1
  • 6
  • 14
  • 1
    I was able to get Mule working with the project without *too* much trouble, though it does seem to pull in most every jar imaginable. When I finally got the right incantations in place, the impact on my code was pretty minimal, which is good, but the documentation wasn't great for integrating Mule into an existing webapp. I still don't have a feel for whether it will be worthwhile, but I now have a means of determining that. Thanks. – Tim Sep 07 '09 at 13:08
12

You may also want to take a look at Apache Camel framework which is really powerful for all the integration needs you mentioned without the penalties of a full blown ESB.

Ashwin
  • 444
  • 5
  • 8
  • 2
    Funny you should mention that as I am evaluating Camel right now as a potential option instead of Mule as it does seem to be more lightweight. I have not made any decisions yet, but it does seem that it might give me what I need without as much overhead. – Tim Nov 12 '09 at 01:15
4

Ross Mason, the founder of the Mule project wrote a really good article on this topic, To ESB or Not to ESB. I recommended taking a look at it. Also, you may want to check out Mule iBeans which offers a much simpler model if you are building this as a web app and just want to do some lightweight integration and are not interested in mediation.

Ken
  • 377
  • 1
  • 4
1

I advice not to waste your valuable time with MULE. My experience so far isn't good. I wouldn't use it for any critical system. It's far away from being a mature product. Apart from that RESTful services definitely promise a lot of simplicity and has real use cases.

asahin
  • 29
  • 2
1

I would say that it is worth the investment if you have more than two applications or databases that need to talk to each other AND they are using more than one communication protocol. Or, if you expect this situation to be true in the future. Sounds like your requirements certainly fits this.

Another situation that would suggest the use of an ESB or at least a message bus would be where you expect or need one or more of the applications to evolve independently of the others. For example one is under active development and the others are not. An ESB can isolate the stable systems from changes in the actively developed systems removing the need to always be updating everything.

The true power of an ESB is that applications can delegate all decisions about how to communicate and whom to communicate with to the ESB and let that component take full responsibility for those aspects. All other components become isolated from each other and need not worry about each other greatly reducing problems of combinations of dependencies.

In terms of the learning curve I have found Mule ESB to be fairly straight forward to pick up and would certainly be a much lower learning curve that trying to learn all the required APIs to talk the the multiple services that you are trying to connect to.

Mark
  • 1,815
  • 14
  • 22