Apache Qpid M4 Released

January 28th, 2009  |  Published in AMQP, Open Source, Qpid  | Add to del.icio.us

The Apache Qpid community is pleased to announce the release of Apache Qpid M4!

Apache Qpid (http://qpid.apache.org) is a cross platform enterprise messaging solution which implements the Advanced Message Queueing Protocol (http://www.amqp.org).
It provides brokers written in Java and C++ and clients in C++, Java (including a JMS implementation), .Net, Python, and Ruby.

New features included in this release are:

  • .NET, WCF and excel support for AMQP 0-10
  • SSL added for C++ broker and all clients
  • Windows port for C++ client & broker
  • C++ Broker
    • ACL
    • Active-Active clustering
    • Federation, push bridges & dynamic routes
    • RDMA for C++ broker & C++ client (70-80us, yes us max latency on a well setup machines)
    • Support for message TTL
    • Queue options
      • added RING/ STRICT ring
      • LVQ
    • Exchange options
      • LVE
      • message sequencing
    • XQuery based XML Exchange now as plugin
  • Performance work
  • Management for AMQP 0-10
    • QMF C updates (console)
      • Python
      • C++
    • QMF Agent
      • C++
    • QMan JMX bridge for QMF
    • Alerts/ logger for QMF events
  • JMSXUserId
  • Java broker
    • Message Priority
    • bug fixes
    • some prep work for AMQP 0-10

It is available to download from:
http://www.apache.org/dist/qpid/M4/

Complete release notes are available here:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310520&styleName=Html&version=12313279

The art of spin bowling

December 23rd, 2008  |  Published in cricket  | Add to del.icio.us

I was always fascinated about spin bowling. I followed Shane Warne and Murali very closely over the years and tried to understand what made a spin bowler great. When YouTube came around there was plenty of videos to study. Then came Ajantha Mendis, who bought a completely different perspective to spin bowling and bamboozled batsmen and pundits alike.

Spin bowling is more art than science. The principles of spin bowling are very simple. One could learn to bowl spin by learning these principles, but mastering them is an art. A closer look at spinners who were successful at their trade, shows that each made an art out of these principles. They had something unusual to offer that set them apart from the rest of the pack.

Looking at some of the greatest spinners, for example Bhagwat Chandrasekhar had an unusually whippy action due to a withered arm which was a result of childhood polio. It is said that he delivered googlies, topspinners and leg breaks at near medium pace and eventually producing an unplayable delivery. Abdul Qadir had a fancy run up, the temperament of a fast bowler and good variety to back it up. His googly was probably the best. Muttiah Muralitharan was a vicious spinner of the ball on any type of surface. Saqlain Mushtaq was probably the first to use the “doosra” effectively. Shane Warne undoubtedly the best leg spinner we have seen so far, has quite a bit of variation. Then finally you have Ajantha Mendis who uses variation as his main weapon. All these folks mixed their unique talent (and their deformity in the case of Mural and Bhagawat) with these principles to create an art form that is almost magical. (For the die hard fans, the above is not an exhaustive list of great spinners. So if your favorite is not listed there please do not think I have thought less about your favorite spinner).

As a bowler you need to consistently beat a variety of batsmen to become a successful bowler. Sure you may get a few freebies when the batsmen eventually makes a mistake (every human is going to make a mistake at some point) or due to pressure at the other end. But if you need to improve your wickets column and become a champion spinner, then you have to ensure that the batsmen makes those mistakes while you are bowling.

There are several ways to beat a batsmen and more often than not a combination of those techniques is what buys you a wicket. Most of these techniques are intertwined. One technique is to try and out think a batsmen. For example Shane Warne always tried to anticipate a batsman’s move and bowled accordingly. Creating doubts in a batsman’s mind is another way. Ajantha Mendis is a master at this as he bowls very accurately with subtle changes in the direction where the ball spins. Bhagwat Chandrasekhar didn’t even know what would happens when he bowled and never planned his deliveries. When a batsman is not picking up the variations he begins to doubt and his confidence suffers, effectively stifling the scoring and increasing the chances of making a mistake. Deceiving a batsmen is another way. You could deceive a batsmen through changes in the amount of spin imparted, pace, line, length , flight or direction of spin by cleverly disguising your variations off the hand. For example a spinner could bowl a quick top spinner, a cleverly disguised googly or an arm ball. The batsmen depending on his ability and concentration level may not pick the subtle change in your action, the pace or the direction it takes off the pitch, Yet another way is to setup and lead a batsmen into a trap. For example a leg spinner or an off spinner could use their stock ball on a given line and length and then stealthily produce a googly or a doosra on the same line and length inviting the batsmen to make a mistake. Or the trap could come in the way of a cleverly placed field setting.

If we look closely most of the great spinners, have devised their own way of executing those techniques. The rest are ordinary bowlers who approach spin bowling mechanically as a science and most with a bit of coaching can get there. But the legendary spinners used what ever skill they had to transform spin bowling into an art of it’s own. Great spinners are not made, they are born.

Microsoft joining Apache Qpid and the AMQP working group

November 7th, 2008  |  Published in AMQP, Open Source, Qpid  | Add to del.icio.us

I guess by now many have heard that Microsoft is joining the Apache Qpid project and the AMQP Working Group. Sam Ramji mentioned this during his key note at the Apache Con US 2008. This is indeed great news for both the AMQP working group as well as the Apache Qpid community.

One of the engineers from Microsoft Anandeep Pannu, has written very excitedly about participating in Qpid.

In July Sam Ramji announced a sponsorship for the Apache Software Foundation. It kind of signaled about their intent to get their feet wet with playing an active role in open source. It seems that most large vendors have realized the importance of participating and promoting open source on one hand and also harnessing the power of open source on the other hand. IBM for instance played this strategy very well over the last decade or so. This is very good PR for the Qpid project and hopefully attract more participants and end users to the project. Definitely looking forward to working them in Qpid and the AMQP working group.

AMQP in 10 mins - update

November 7th, 2008  |  Published in AMQP  | Add to del.icio.us

A lot of folks have asked me as to why I have not written the next part in the series after Oct,2007. So I think I owe an explanation.
I guess I started the series a bit early, and at that time the protocol was going through a phase of rapid changes. So I decided to wait until the dust has settled, as there is no point in writing about something that may change within a short time. However it took the working group a bit longer than expected to thrash out the 0-10 version.
Now the AMQP working group is working towards a 1.0 release. So I think it would be worthwhile to wait until we have firmed up the 1.0 spec as it makes sense to write about a final 1.0 release than an interim version. I don’t expect a lot to change between 0-10 and 1.0, and most changes would be to remove certain unnecessary complexity in the 0-10 version and also to incorporate any feedback from the folks who worked on implementing the 0-10 version.

Gartner Hype Cycle

October 21st, 2008  |  Published in cartoon  | Add to del.icio.us

Gartner Hype Cycle

Art work is licensed under Creative Commons Attribution-NonCommercial 2.5 License.

5 reasons why Distributed Systems are hard to program

July 23rd, 2008  |  Published in Architecture, Distributed Systems, programming  | Add to del.icio.us

Here are 5 reasons why I found distributed system are hard to program. This is not some sort of thorough analysis, but merely my observations in dealing with such systems. For completeness, here is the definition of “Distributed System” I used.
A distributed system contains of more than one process that runs as a single system. These processes can be on the same computer or multiple computers that are on a local area network or geographically distributed over a wide area network.

Without any further do here are the reasons in no particular order.

1. Difficulty in identifying and dealing with failures.
When communicating between processes failures can happen at many levels. Dealing with them is not trivial. Of course you rely on frameworks based on technologies like RMI, CORBA, COM, SOAP, AMQP, REST(is an architectural style not a standard) etc to handle these. But the fact remains that you still need to clearly think about these cases and handle these situations properly.

For example if we consider a simple interaction between two processes on different computers, the following failures can happen.

  • Failures that occur within the process that initiates the communication (sending the message or invoking the RPC call).
  • Failures between the time the process hands over the request to the OS and the OS writing it to the network.
  • Network failures between the time it takes to transmit the packets from one computer to the other.
  • Failures between the time the OS on the receiving end receives the packets and then handing it over to the recipient process.
  • Failures that occur when the recipient process tried to process the request/message.

Sometimes the framework you use, is unable to/may not report all these error cases. Sometimes when the error is reported, it may not contain enough information to figure out at which level the error occurred.
Did it reach the remote computer? if so how far up the stack did it go?. If the receiving process got the request or message did the error occur before or after the request/message was processed?
In some cases where idempotency is built into the the receiving application or the framework/protocol (ex a message client that detects duplicate messages, or doing an HTTP GET) a simple retry maybe ok. In some cases Idempotency and retrying maybe expensive or difficult to implement. In such cases careful thought needs to be given on how these different errors are identified and handled.

2. Achieving consistency in data across processes.
One of the hardest problems in programming distributed systems is achieving a consistent view of data across the processes. When one processes updates some data, you need to replicate them across the other processes, so if any other process decides to operate on the same set of data, then it is doing so on the most current copy.
Lets look at two examples.

Assume a global banking application for ABC bank. A customer goes to a branch in New York, US and deposits money to an account. A few moments later his relative in London, UK does a withdraw on that account. Due to latency there is obviously a time lag before the process in London, UK sees the updated amount in the account.

In an online trading system, a user in NY places an item for sale. The transaction is updated on the closest data center which is in Boston. A few moments later another user in LA is searching for the exact same item and is served off a data center in Phoenix. The user in LA may or may not see the item due to the latency involved in replicating the data across

For example 1 strong consistency is required, while for example 2, you could get away with weak consistency, for example by setting an SLA that says data is valid within a 5 min time window.
This is not an easy problem to solve and this area itself is a subject on its own. Wener Vogels wrote a nice peice on this called Eventually Consistent which is worth reading.
Of course there are specialized frameworks/libraries that can handle this for you. But still there is no escape for you and you pretty much need to have an understanding of the pros and cons of various approaches, failure modes etc.

3. Heterogeneous nature of the components involved in the system.
A distributed system may contain components written in a variety of languages deployed across machines with different architectures and operating systems. Needless to say that this poses certain challenges (especially integration, interoperability issues) when implementing the system. A whole range of standards/technologies were presented to solve these issues, including but not limited to CORBA, SOAP, AMQP, REST (is an architectural style not a standard) and RPC based frameworks like ICE, Thrift, Etch etc. Anyone who has worked with these technologies knows that neither of these are trivial to use nor provide a complete solution in every situation.

If anybody has read the recent posts by Steve Vinoski and the discussions around it would realize the issues/challenges surrounding RPC. The following paper discuss the impedance mismatch problems when working with IDL based systems. The issues with type systems and data formats are not limited to RPC only. When using a message oriented approach like SOAP (doc lit style) or AMQP you will end up tunneling data thats not supported by the protocol as a string or a sequence of bytes. When using REST you would need to represent your resource in a format the requesting application understands/supports, which maybe quite different from the native format.

Again not an easy issue to deal with no matter what technology or framework is used. As an architect/developer you need to understand these issues and deal with them accordingly.

4. Testing a distributed system is quite difficult.
This is arguably one of the hardest aspects of developing a distributed system. Verification of the behavior and impact of your code in the system is not easy.
There are many aspects that needs to be tested, and doing so before every checkin is not a fun task at all. Running some of these tests before every checkin is not practical. But its a good idea to run them nightly and some tests during the weekend. Here are some of the areas that needs to be tested (I plan to write another blog entry elaborating on the testing aspects).

  • Functionality testing (can be covered with well written unit testing)
  • Integration testing - you need to test the distributed system as a whole with all the components involved
  • Interoperability testing - this is crucial when heterogeneous components (different languages, OS) are involved, and is quite different from integration testing
  • TCK compliance - If your system is based on standards/specifications, then you need to ensure that you haven’t broken anything w.r.t compliance
  • Performance testing - to ensure that your changes haven’t accidentally caused a degradation in performance
  • Stress testing - to ensure that your checkin hasn’t accidentally caused any stability issues - ex increased chance of deadlocks when the load increases
  • Soak testing - to ensure that your checkin hasn’t caused any longevity issues - ex a memory leak thats manifested after a couple hours, days

Most often than not developers cut corners in their testing as running these tests are tedious and time consuming. Also these tests need to be run regularly to catch issues in a timely manner and the best way to tackle this issue is to automate as much testing as possible. There many options with continuous build systems like cruisecontrol or using a plain old cron job.
Functionality testing, TCK compliance, certain types of integration and interoperability tests can be run periodically.
In most organizations test machines are just lying around doing nothing during the night (unless around the clock testing is done with development centers in different time zones.). Instead of wasting computing cycles, you could automate test suites to run during the night. More time consuming integration and interoperability tests, performance, stress and soak testing can be done nightly, while more longer duration soak testing can be scheduled to run during the weekends.

While testing is a tough issue for any type of system, distributed systems have a lot more failure points which adds to the complexity.
Getting these tests right to cover these failure points and executing them needs a lot of careful thought and planning.

5. The technologies involved in distributed systems are not easy to understand .
Distributed system are not easy to understand. Neither are the myriad of technologies used in developing these systems.
Most folks find it difficult to grasp the concepts behind these technologies. If you look into the discussions and misconceptions surrounding REST you can understand what I am trying to get at. CORBA was not an easy spec to understand, so is WS-* or AMQP. While it is true that you don’t need to understand everything to develop using them, you still need at least a reasonable understanding to figure how to tackle some of the above mentioned issues. Frameworks based on these technologies are touted as the cure for these problems. Sure they could help, but it still does not shift the burden away from you.
To compound the issue all sorts of vendors keep touting their technology/framework as the next silver bullet. No matter what vendor you use, at the end of the day you are still responsible for getting it right. And it is not an easy task. You need to face the reality that distributed systems are hard and that you cannot hide every complexity behind some framework.

Axis2/C has AMQP support via Apache Qpid

June 16th, 2008  |  Published in AMQP, Axis2, Qpid  |  1 Comment  | Add to del.icio.us

Danushka Menikkumbura has got AMQP support going for Axis2/C via the Apache Qpid project.
This will only work on Linux as the Qpid c++ client so far has only a Linux implementation. Currently there is ongoing work from two contributors trying to port the code base to support Windows and Solaris. This is scoped for the M3 release.

Watch the WSO2 blog space or the Axis2/C website for a tutorial/blog post from Danushka.

Restructuring Code

June 9th, 2008  |  Published in Architecture, programming  | Add to del.icio.us

Most programmers need to deal with restructuring the code they work on due to a variety of reasons. While most of the time it is driven by demand, sometimes it is also done for personal reasons. Here are some of the reasons I have had or seen within the teams that I have worked over the years.

  1. The current code would have reached a stage where it is impossible to do any more modifications without breaking something else
  2. The requirements have changed so much that the current architecture/design cannot handle it without a redesign
  3. The current application doesn’t/will not scale, perform well enough as it wasn’t designed to handle the current load/anticipated growth
  4. The folks who worked on the code are no longer there and nobody knows what the code really does (or what it was supposed to do)
  5. You don’t really like the current way it is implemented and think that there is a better way to do it using framework X or library Y

While sometimes restructuring could be done easily, but 90% of the time it is not a trivial task. When the frustration gets to you, you may have even entertained the idea of rewriting an application/module/section from scratch. Is this really a good idea? Sometimes this maybe the only option, but most of the time this may end up being a bad idea due to a variety of reasons.

  • One of the biggest mistakes is to throw away the old code without any due consideration simply based on the assumption that the old code is bad and we are going to write much better code.

    Throwing away the old code (especially if it was in production) means, you are throwing away months (or years) of tested, battle hardned code that may have had fixes for bugs that you aren’t even aware of. If you don’t take this into account, the new code you write may end up showing the same bugs that are already fixed in the old code. This will waste a lot of time ,effort, knowledge gained over the years

  • This method or class is ugly, lets throw it away and write again.

    That odd looking method or that badly written class may have some fix for a race condition or an optimization that one of your customers is depending upon. Discarding that code as crap without really understanding whats going on may end up with dire consequences for your team.

  • Not paying enough attention to the existing unit tests/ test frameworks when building the new system.

    These tests were added for a reason, possibly in response to a bug or some sort of intermittent failure that was reported on a production system. These failures/errors may have been reported way before you joined the company. Sometimes none of the current team members are aware of all the issues. So discarding the test code means you are throwing away years of hard work and knowledge

  • The current code is way behind all the cool technology we have today. The new framework X can do things a lot more elegantly, so lets re write.

    This is by far the worst mistake. If something is not broken then why try to fix it?. The code is ugly, or technology used is not cool are not good reasons. Simply bcos the style or structure of the code is not according to your personal preference is not a reason at all for unwanted restructuring .

I have been guilty of doing most the of the above mentioned points and through hard lessons I have realized that,

  • The best approach for restructuring starts with taking stock of the existing code base and tests written against that code. This will help you understand the strengths and weaknesses in the existing code, so you could ensure that you preserve the strong points while avoiding the mistakes.
  • It is best to reuse as much code as possible, bcos no matter how ugly the code is, it has been tested/reviewed etc.
  • Incremental changes are better than one massive code change. Incremental changes allows you to gauge the impact on the system more easily through feedback from tests etc. It is not fun to see 80 test failures after you make a change and can lead to frustration/preasure that will in turn result in more bad decesions . A couple of test failures is easy to deal with and provides a more managable approach.
  • After each iteration it is important to ensure that the existing tests pass. Analyze why the tests are failing, and make modifications/add new tests if nessacery if the existing tests are not sufficient enough to cover the changes you made. Failure to do so can result in a lot of pain down the road.
  • Avoid the temptation to rewrite everything. Personal preferences and ego shouldn’t get in the way. If something works then don’t change it.
  • Remember that humans make mistakes and restructing will always not garuntee that it will be atleast as good as the previous attempt. I have seen and have been part of several failed restructuring attempts

Having said all of that, sometimes you have no option but to rewrite from scratch. But IMHO that should be your last resort.

Axis2/Synapse - AMQP support via JMS Transport using Apache Qpid

June 8th, 2008  |  Published in AMQP, Axis2, Qpid, Synapse  | Add to del.icio.us

I have tested the following with Axis2 1.4 release and the up comming Synapse 1.2 release.

Documentation is broken into two sections.
It is important to read and understand the pros and cons for each option.

If you have any questions/suggestions please post on qpid-users@incubator.apache.org
And/Or open a JIRA at http://issues.apache.org/jira/browse/qpid
Your feedback is most welcomed.

  1. Configuring the JMS transport using Apache Qpid M2.1 release.
    • This version is the latest stable release and supports the 0-9 version of the AMQP protocol.
    • You can download it from here
    • It is recomended that you use the Java broker.
    • This is the recomended production version.
  2. Configuring the JMS transport using Apache Qpid trunk. (with the usual caveat that it is a less stable and a moving target).
    • The trunk supports the 0-10 version of the AMQP protocol and the next release is M3.
    • You can build it from source. https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid
    • Has the following enchancements in the JMS client over M2.1
      1. You can specify multiple binding keys per destination. i.e you could bind a queue to a particular exchange using several binding keys there by allowing you to listen from multiple sources.
      2. You can bind your queue to any exchange type using the binding URL.
      3. You can set the following options per JMS connection.
        • maxprefetch - The maximum number of pre-fetched messages per destination
        • sync_persistence - When true, a sync command is sent after every persistent message to guarantee that it has been received by the broker.
      4. A new blocking transport (as an alternative to MINA) that gives much better latency, memory and increased throughput in many cases.
      5. Currently only the c++ broker supports the 0-10 version and only works on linux.
      6. In the pipeline
        • Java Broker - expected to be in M3 release. Currently being refactored
        • C++ broker - solaris and windows port are in progress (likely to be in M3 release)

1.0 Configuring the JMS transport using Apache Qpid M2.1 release

  • 1.1 Qpid provides a convinient properties file based JNDI mechanism.
    • For provider URL please specify the location of the jndi.properties file.
    • The following link provides documentation for the jndi.properties file. JNDI How To
    • The connection URL format is given here. Connection URL format


    <parameter name="myTopicConnectionFactory">
    <parameter name="java.naming.factory.initial">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
    <parameter name="java.naming.provider.url">file:///opt/workspace/sandbox/axis2-1.4</parameter>
    <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
    </parameter>

  • 1.2 If you didn’t specify a custom destination for your service via the “transport.jms.Destination” parameter then the JMS transport will create a queue with the service name as its name. In AMQP world the above translates as follows. A queue will be created with service name as its name and will be bound to the amq.direct exchange with service name as the routing key
  • 1.3 If you specify a custom destination name via transport.jms.Destination in your services.xml then Qpid will look that up in the jndi.properties file and create queue based on the definition given in the file.
    The binding URL format is given here. Binding URL format

2.0 Configuring the JMS transport using Apache Qpid trunk
In addition to whats described above you can do the following.

  • 2.1 Specifing multiple binding keys per destination

    destination.wetherServiceQueue=topic://amq.topic/WeatherQueue?bindingkey='weather.us.*'&bindingkey='weather.ca.*'

    The above will create a queue named WeatherQueue and will bind it to amq.topic with ‘weather.us.*’ and ‘weather.ca.*’ as the binding keys. The broker will then route any messages that matches the above patterns into WeatherQueue.
  • 2.2 Binding your queue to any exchange type the broker supports by using the binding URL.

    For example if you want to bind your queue to a fanout exchange
    destination.top10StockQueue=fanout://amq.fanout/WeatherQueue

  • 2.3 Setting prefetch limit and sync_persistence per JMS connection

    amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672'&maxprefetch=2000&sync_persistence=true

  • 2.4 Using the new transport

    Set -Dtransport=io when starting Axis2 or Synapse.

Read the rest of this entry »

Synapse vs Camel

February 11th, 2008  |  Published in General, Open Source  |  5 Comments  | Add to del.icio.us

I had the opportunity of listening to my friend Bruce Snyder talk about Apache Camel during his talks on ActiveMQ/ServiceMix at the Colorado Software Summit 07. There was also some discussion on Camel on the Apache Synapse mailing list recently. I thought of replying to the thread comparing the two based on it’s routing and mediation aspects. In the process I decided to write a blog post instead. If I have misunderstood any Camel feature/architectural detail, please let me know and I will post a correction. Note this is not an in depth analysis, neither a verdict on either project. Readers should do their own research and come to conclusions.

Intent/Problem Space

  • Both Synapse and Camel have similar intents as Integration, Mediation and Routing Engines.
  • Synapse also positions itself as an ESB, treating your entire network as the bus.
  • Camel/ServiceMix is advertised as an ESB.
  • Both have routing,transformation,mediation,enrichment,validation, logging ..etc.
  • Initially Synapse was more focused on Web Services mediation. Since then, it has moved out of the Web Services umbrella and is trying to position itself as a general purpose integration/mediation/routing engine.
  • Synapse by design have a proper abstraction layer where you can adapt (implement) Synapse on top of any Environment. It is one of the least known aspects about Synapse. Most folks assume Synapse can only work on top of Axis2. I have implemented the Synapse environment interface inside the Apache Qpid broker to leverage its mediation/routing capabilities.
  • Camel on the other hand was designed to work on different environments from the begining. Camel can be used inside ServiceMix, ActiveMQ etc.

I haven’t experimented enough with Camel to compare performance, flexibility,extensibility or robustness with Synapse. Perhaps that would be an interesting topic to touch sometime later

Messaging Model

  • The Synapse messaging model is based on SOAP. The current implementation of Synapse is powered by Axis2 and takes any type of non SOAP message and creates a fictitious SOAP message and pumps it through the Synapse engine.
  • Camel has a neutral messaging model which I think is nice.
  • However you can implement your own Synapse MessageContext as well. I have created an AMQP based messaging model for Synapse for my work on embedding Synapse as an AMQP Exchange.
  • Synapse could also use generics to make it’s messaging model neutral. (I hope to make a proposal to this effect after my AMQP work).

Synapse Configuration vs Camel Context

  • Both use very similar models for representing a runtime instance of the rules/endpoints/registry ..etc.
  • Synapse has a XML based DSL for configuration.
  • Camel has a java and XML based DSL for configuration. You can use Spring to configure the Camel Context as well.
  • You can also use Synapse programatically all though we haven’t provided a clear API as such to the user community. I think such an API would be a valuable addition to Synapse.
  • There is support for configuring Axis2 with Spring, so I assume you can do the same for Synapse very soon (if not already).
  • Both supports the concept of a Registry. The registry mechanism is pluggable in both projects.

Synapse Mediators vs Camel Processors

  • A Synapse mediator, mediates a message as it passes through. It could be a transformation,validation, logging, audit ..etc.
  • You can chain mediators into sequences and combine different sequences to create a processing engine.
  • Camel processors does more or less the same.
  • In both Synapse and Camel you can write you own mediator by implementing the Mediator or Processor interfaces respectively.

Synapse Script Mediator vs Camel Predicates/Expressions
Again they both provide pluggable scripting support. Not much to be said there.

Endpoints/Transports

  • Both represents endpoints via URIs.
  • Camel and Synapse supports more or less the same set of transports with the following exceptions.
    • Camel has additional support for JBI,MINA, XMPP.
    • Synapse supports Non blocking HTTP, AMQP (native not via JMS).
      James Strachenanswered : “Camel supports non blocking HTTP too”
    • In Synapse you could switch transport. Ex incoming is JMS and outgoing is HTTP (does Camel have similar support?).
      James Strachen answered : “you can use Camel to do protocol switching from any protocol to any protocol with whatever EIP patterns in between (e.g. Message Translator etc).”
    • Axis2 has support for XMPP, so if you really want to you could leverage that in Synapse.

Enterprise Integration Patterns

  • Camel has support/good documentation for Enterprise Integration Patterns (based on Gregor Hopes book).
  • All though Synapse doesn’t directly say so, you can easily do the same. In fact it does have some built in support similar to Camel for some patterns while other patterns can be done with a little bit of work. I may in the future compile an article on how to do so with Synapse.

Embedability

  • Camel has a programmable API as described above and I quite like it. It would be nice if Synapse can do something similar.
  • Camel can be used inside ServiceMix, ActiveMQ ..etc. I have managed to embed Synapse inside an AMQP broker albeit with some code changes.
  • It would be nice if you could embed the mediation engine in Synapse in other projects in a trivial way and also provide some documentation on it.
  • One nice thing about Synapse is that it can be deployed as a module inside Axis2 or as war file inside Tomcat. Couldn’t find any documentation on easy Camel integration with Apache CFX
    James Strachen answered : “its trivial to deploy Camel inside any Spring or WAR application or as an OSGi bundle, working great with Spring Dynamic Modules”

WS-* QoS Support

  • Synapse has Built in support for WS-* QoS features (adding/removing security, reliability ..etc) when running on top of Axis2.
  • Does Camel have a similar strategy with it’s Apache CXF support? ( I couldn’t find any information in the Camel site about this)
    James Strachen answered : yes Camel has a similar WS-* strategy; using CXF to support the SOAP/WS-* protocols on any endpoint

Throttling/Load balancing/Policy based access and failover support for endpoints

  • Synapse has good support for applying throttling , failover support and load balancing to endpoints.
  • Synapse also can apply policies to enforce restrictions for better manage your endpoints.
  • Not sure if Camel has any support for this area.
    James Strachen answered : “yes Camel has support for load balancing, throttling, resequencing etc. See http://activemq.apache.org/camel/enterprise-integration-patterns.html”

Clustering support

  • Synapse allows mediator state to be replicated across the cluster.This is based on the Axis2 clustering support.
  • This is nice when you want to implement stateful mediators, like a session mediator.
  • Again haven’t come across any documentation in Camel on this area.
    James Strachen answered : “for stateful replication, we rely on ActiveMQ’s Message Groups feature or using EJB3″

Payload Conversion

  • Synapse can covert from one message format to another via built in support for POX, SOAP and JMS.
  • Camel provides a Type Converter interface (and some default implementations) to convert message payloads from one type to another when routing.
  • Similarly in Synapse, for other payload types you could write a custom mediator to do the job.
  • Also using the transport switching mechanism you can do some trivial things like converting a Qpid/AMQP message to an ActiveMQ message using the JMS transport. Sort of like a message bridge.

Summary
Both projects seems interesting and has some overlapping features, but different direction/focus and thought process behind them. IMHO it is nice to have choices in open source. Each community can learn from each other and strive to provide a better experience to the end user.