The normalized message router(NMR) is the part of the JBI environment that is responsible for mediating messages between JBI components. The JBI components never send messages directly between each other. Instead, they pass messages to the NMR. The NMR is responsible for delivering the messages to the correct JBI endpoints. This allows the JBI components, and the functionality they expose, to be location independent. It also frees the application developer from worrying about the connection details between the different parts of an application.
The NMR uses a WSDL-based messaging model to mediate the message exchanges between JBI components. Using a WSDL-based model provides the needed level of abstraction to ensure that the JBI components are fully decoupled. The WSDL-based model defines operations as a message exchange between a service provider and a service consumer. The message exchanges are defined from the point of view of the service provider and fit one of four message exchange patterns:
In this pattern a consumer sends a request message to a provider. The provider responds to the request with a response message. The provider may also respond with a fault message indicating that an error occured during processing.
In this pattern a consumer sends a request message to a provider. The provider may send a response message back to the consumer, but the consumer does not require a response. The provider may also respond with a fault message. In addition, the consumer can send a fault message to the provider.
In this pattern a consumer sends a message to a provider, but the provider does not send a response. The provider does not even send fault messages back to the consumer.
In this pattern a consumer sends a message to a provider. The provider may send a fault message back to the consumer to signal an error condition, but otherwise does not respond to the consumer.
In order to fully decouple the entities involved in message exchanges JBI uses normalized messages. A normalized message is a genericized format used to represent all of message data passed through the NMR. It consists of three parts:
The meta-data holds information about the message. This information can include transaction contexts, security information, or other QoS information. The meta-data can also hold transport headers.
The payload of a message is an XML document that conforms to the XML Schema definition in the WSDL document defining the message exchange. The XML document holds the substance of the message.
Attachments hold any binary data associated with the message. For example, an attachment could be an image file sent as an attachment to SOAP message.
SubjectThe security Subject holds security information, such as authentication credentials, associated with the message. For more
information of the security Sublect, see
Sun's API documentation.
JBI binding components are responsible for normalizing all of the messages placed onto the NMR. Binding components normalize messages received from external sources before passing them to the NMR, The binding component will also denormalize the message so that it is in the appropriate format for the external source.