Hessian AMQP is a component helping the deployment of Hessian services using an AMQP server as the underlying transport. The principle is almost identical to Hessian services over HTTP:
1. Create an interface defining the methods exposed:
public interface EchoService {
String echo(String message);
}
2. Implement the interface:
public class EchoServiceImpl implements EchoService {
public String echo(String message) {
return message;
}
}
3. Deploy an endpoint for the service and attach it to an AMQP connection:
HessianEndpoint endpoint = new HessianEndpoint(new EchoServiceImpl()); endpoint.run(connection);
4. On the client side, create a proxy of the interface:
AMQPHessianProxyFactory factory = new AMQPHessianProxyFactory(); EchoService service = factory.create(EchoService.class, "amqp://user:pwd@example.com/test");
5. The service is ready to be consumed!
String echo = service.echo("Hello Hessian!");
Declare the dependency in your Maven pom:
<dependency>
<groupId>org.apache-extras.qpid</groupId>
<artifactId>qpid-hessian</artifactId>
<version>1.1</version>
</dependency>
Apache Software License, Version 2.0
Emmanuel Bourg (ebourg@apache.org)
You can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/ebourg/qpid-hessian