Hi Gary,
Thanks for replying.
I've tried messaging gateway (can't use http-inbound gateway - using Spring MVC to handle stuff on the web layer and do some processing before handing off to the service layer (hopefully via AMQP and SI)).
The problem I see with the gateway, is that I don't know how to route to different service methods within a service, i.e:
Web Layer:
Code:
<int:gateway id="systemGateway" service-interface "com.fubar.service.SystemGateway" default-request-channel="restToServiceGateway"/>
now, in my SystemGateway:
Code:
public interface SystemGateway {
@Payload("'status'")
Future<String> getStatus();
Future<Information> getInformation();
Future<Information> getInformation(final Computer computer);
}
Service Layer (different app running in a different JVM but listening to the "rest.to.service.queue" on RabbitMQ)
Code:
public class StatusEndpointImpl {
@ServiceActivator
public String status() {
return "w00t";
}
@ServiceActivator
public Information information() {
return new Information();
}
@ServiceActivator
public Information information(final Computer computer) {
return new Information(computer);
}
}
And the Spring Integration for the Service Layer:
Code:
<int-amqp:inbound-gateway
id="restToService"
connection-factory="rabbitConnectionFactory"
request-channel="restToServiceChannel"
reply-channel="serviceToRestChannel"
queue-names="rest.to.service.queue"
/>
How does SI know how to invoke each method in the StatusEndpointImpl depending on the message coming in from RabbitMQ via the queue (rest.to.service.queue).
This bit is unclear for me. If I have a gateway on the "rest" layer that I invoke from a controller and a JSON message is marshalled out and put on the wire to AMQP and I have a service listening on that queue, how does SI take that message and invoke the correct service activator?
Very lost! I'm sorry! :-(
bootlaces