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" container="#jbi" />
</beans>


And here is the java code used:


import javax.jbi.messaging.InOut;
import javax.xml.namespace.QName;
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.jbi.jaxp.StringSource;
import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
import org.springframework.context.ApplicationContext;

public class Main {
public static void main(String[] args) throws Exception {
ApplicationContext context = new ClassPathXmlApplicationContext("servicemix.xml");
ServiceMixClient client = (ServiceMixClient) context.getBean("client");
InOut me = client.createInOutExchange();
me.setService(new QName("urn:test", "echo"));
me.getInMessage().setContent(new StringSource("world"));
client.sendSync(me);
System.err.println(me);
}
}


This is the results of the work that has been done for the 3.1 release. The next step is to use the standard JBI components from ServiceMix ...

Comments

Popular posts from this blog

Apache Karaf

Camel Endpoint DSL

ActiveMQ Pooling