Posts

ServiceMix 3.1.1 released

Apache ServiceMix 3.1.1 release is finally out! This release is a bug fix version with a few minor improvements.

Accessing databases in servicemix-drools

ServiceMix provides a Service Engine for Drools , the famous Rules Engine. People often want to retrieve data from the rules and such data is usually stored in a database. Previously there was no easy way to configure a DataSource and inject it in the rules definitions. This is a small enhancement that I've just written and that will be included in next major release. So let's say you write your database access code in a simple helper object: import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; public class DbHelper { private DataSource dataSource; private JdbcTemplate jdbcTemplate; public void setDataSource(DataSource dataSource) { this.dataSource = dataSource; this.jdbcTemplate = new JdbcTemplate(dataSource); this.jdbcTemplate.afterPropertiesSet(); } public String getSurname(String name) { String surname = (String) this.jdbcTemplate .queryForObject( "select surname from t_...

Loose coupling in JBI

Loose coupling is a feature that can be easily achieved in JBI but which is sometimes not well understood by newbies in the JBI world. In JBI, services are exposed inside the bus by JBI components when you deploy a given service onto it. These components can be Service Engines (contain business logic) or Binding Components (handling a specific protocol). The distinction is the key for loose coupling: the service itself it decoupled from the protocols used to access it. This is true for all services accessed from inside the JBI bus, be it internal to the bus or external to it. Let's take an example. You need to write a BPEL process and expose it over SOAP/HTTP, and this process will consume several other services. These services can be inside the JBI bus, accessible via SOAP/HTTP or plain JMS. The important point is that the BPEL process has no knowledge of the protocol and location of these services. How does it work ? The key is the WSDL. A WSDL can be split into two part...

Father for the fifth time

Image
Welcome to this world, Alexandre! My new son was born on May the 30th, weights 3.8 kg and his height is 52 cm.

Performances of ServiceMix WSDL-First example

I have spent some time profiling ServiceMix a bit, and particularly the WSDL-First example from the distribution. Here are the results while running a SOAP UI load tests on the example from the 3.1 distribution and the upcoming 3.1.1 distribution: Version, min, max, avg, last, cnt, tps, bytes, bps, err SMX 3.1, 9, 234, 20.64, 14, 57724, 484.43, 19106644, 159450, 0 SMX 3.1.1, 5, 204, 16.75, 14, 71065, 596.99, 23522515, 196095, 0 The most interesting number is the tps (transaction per seconds) absolute number: roughly 600 transactions per seconds sounds like a reasonable number (this small tests were running on my laptop without any particular tuning on the JVM or ServiceMix configuration) ! The other one is the tpc increase between 3.1 and 3.1.1: 595.99 / 484.43 = 1.2324 which means this sample performances for this sample has been boosted by 23 percents !

Using maven to switch runtime properties

For those who don't know all of Maven 's features, I will show how to leverage maven at built-time to easily share run-time properties between service units in ServiceMix . Let's say that you expose a few services over HTTP/SOAP using servicemix-http . If you are building several service assemblies, you will end up having several files containing: <http:endpoint service="test:MyConsumerService" endpoint="myConsumer" role="consumer" locationURI="http://0.0.0.0:8192/Service/" soap="true" soapVersion="1.1" /> You will certainly want all your services to be exposed on the same port, so it can become a bit tedious if you need to change them all, or if you need to change between different work environments (test, production, etc...). When working with several service assemblies at the same time, I would recommend to use a hierachical organiz...

ServiceMix dependencies

I have just fixed a small bug in ServiceMix (SM-865) and this makes ServiceMix a *very* lightweight ESB. The bare minimum dependencies to run the following example are: servicemix-core servicemix-jbi servicemix-services backport-util-concurrent spring xbean-spring The example I ran is very simple, and of course dependencies need to be added depending on the JBI components you use. Anyway, here is the servicemix.xml file: <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:test="urn:test"> <sm:container id="jbi" embedded="true"> <sm:activationSpecs> <sm:activationSpec service="test:echo"> <sm:component> <bean class="org.apache.servicemix.components.util.EchoComponent" /> </sm:component> </sm:activationSpec> </sm:activationSpecs> </sm:container> <sm:client id="client" con...