Communications Bus - General Java Architecture
Connectivity
Upon startup, the client sends a connection message to the global controlQueue. The RegistrationEndpoint receives the message off the queue and returns a list of services and queue names that are available on the bus. Each service will have one or more queues assigned to operations. Examples of these services are ModelService?, Notification, Authentication, and Replication. The operations are the method names associated with those services, i.e. ModelService.getSize(). Assignment of operations to queues can be managed dynamically, with the central registry maintaining this assignment using a common interface. A ServiceEndpoint? is a physical process running on a machine that manages a set of queues corresponding to a logical service. The endpoint listens for messages on those queues and sends back responses as appropriate, all using the standard JMS client API.
A request is made across the communication bus as follows:
- The particular client API implementation (i.e. ModelServiceClient) invokes the message framework.
- The framework looks up the service/operation pair in the registry to determine the queue. These values can be cached.
- The messaging framework prepares a request by inserting an entry in the request map, keyed by the correlationId.
- The client impl sends a message to that queue, filling in the appropriate message properties and payload.
- required properties are
- correlationId
- operation URI
- callbackQueue - the queue that message bound to the calling client should be published to.
- requestPayloadFormat - (rdfxml, json, xml, ...)
- responsePayload - (rdfxml, json, xml, ...)
- required properties are
- The current thread then waits on the entry in the request map.
- When a message arrives on the callbackQueue, the messaging framework on the client looks at the correlationId of the message and pulls out the entry from the request map. It parses the message properties and payload, and places them in the entry object.
- Finally, the entry object is notified, and the original calling thread is woken up, and the outer client API call returns.
Wire Format
Each request/response may be serialized using a particualr wire format (rdfxml, json, xml, ...) Initially, we will support the XML format used in the original implementation, and then support the json format as we build anzo.js
- PayloadFormats: Description of JMS,Rest, and WebService endpoints
- Webservice Reference: Description of the WebService employed by Open Anzo
Model Service API over JMS
The ModelServiceEndpoint hosts a service with operations corresponding to the abstract ModelServiceAPI. Initially, all model service operations will conducted over a single queue. However, as we move to a more scalable and refined architecture, we may spread the operations across multiple queues.
Javascript JMS protocol
* removed see CommunicationBusComet


