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:
-
Create an interface defining the methods exposed:
public interface EchoService { String echo(String message); }
-
Implement the interface:
public class EchoServiceImpl implements EchoService { public String echo(String message) { return message; } }
-
Deploy an endpoint for the service and attach it to an AMQP connection:
HessianEndpoint endpoint = new HessianEndpoint(new EchoServiceImpl()); endpoint.run(connection);
-
On the client side, create a proxy of the interface:
AMQPHessianProxyFactory factory = new AMQPHessianProxyFactory(); EchoService service = factory.create(EchoService.class, "amqp://user:[email protected]/test");
-
The service is ready to be consumed!
String echo = service.echo("Hello Hessian!");
Declare the dependency:
<dependency>
<groupId>org.apache-extras.qpid</groupId>
<artifactId>qpid-hessian</artifactId>
<version>1.1</version>
</dependency>
- Added support for SSL with amqps:// URLs
- Endpoints now support session resuming
- Serialization errors are now reported immediately to the client and no longer cause a timeout
- The queue prefix specified on the factory is no longer ignored if the service URL doesn't contain one
- AMQPHessianProxyFactory has been generified
- Initial release