## 3 UML Profile for Messaging Patterns
### Stereotypes for Enterprise Integration Patterns  
Messaging makes applications loosely coupled by communicating asynchronously. It makes communication more reliable because the two applications do not have to be running at the same time. The messaging system is responsible for transferring data from one application to another, so the applications can focus on what data they need to share but not worry so much about how to share them. Standard actions within such communication have been enclosed in Enterprise Integration Patterns and can be divided into the following categories: messaging systems, messaging channels, message construction, message routing, message transformation, messaging endpoints, and system management. According to the Enterprise Integration Patterns website, there are 61 patterns [24]. For each of them, the corresponding stereotype is declared. For the majority of them, the icon is also attached to the stereotype in the profile. Some of the patterns do not have declared icons at all, e.g., Format Indicator, Scatter-Gather, or Canonical Data Model. The defined stereotypes for selected Enterprise Integration Patterns are presented below. A brief description of the purpose of each of the shown patterns is provided. For messaging systems patterns the following stereotypes have been declared:  
* \(<<\)MessageChannel\(>>\)--the source application adds the information to a particular message channel and the target application retrieves the information from that channel;
* \(<<\)Message\(>>\)--data must be converted into one or more messages and then sent through messaging channels;
* \(<<\)PipesAndFilters\(>>\)--divides a larger processing task into a sequence of processing steps (Filters) that are connected by channels (Pipes);
* \(<<\)MessageRouter\(>>\)--receives a Message from the Message Channel and sends it to one of the alternative channels due to conditions fulfillment;
* \(<<\)MessageTranslator\(>>\)--translates one data format into another;
* \(<<\)MessageEndpoint\(>>\)--a client of the messaging system that can be used to send or receive messages. Table 2 shows stereotypes and icons for the patterns in the messaging system category. The stereotypes for selected patterns from particular categories are presented below:  
* \(<<\)PublishSubscribeChannel\(>>\)--one input channel splits into multiple output channels. When an event occurs, a copy of the message is delivered to each of the subscribers' channels;
* \(<<\)ChannelAdapter\(>>\)--operates as a messaging client to the messaging system and invokes functions via an application programming interface; \begin{table}
\begin{tabular}{c c c} \hline \hline
**Name** & **Stereotype** & **Base Type** & **Icon** \\ \hline Message Channel & \(<<\)MessageChannel\(>>\) & UML Action & \\ Message & \(<<\)Message\(>>\) & UML Action & \\ Pipes and Filters & \(<<\)PipesAndFilters\(>>\) & UML Action & + \\ Message Router & \(<<\)MessageRouter\(>>\) & UML Action & \\ Message Translator & \(<<\)MessageTranslator\(>>\) & UML Action & \\ MessageEndpoint & \(<<\)MessageEndpoint\(>>\) & UML Action & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Stereotypes with icons for the patterns in the messaging system category. * \(<<\)RequestReply\(>>\)--sends a pair of messages, one to the target application and the second back to the source application, in separate channels;
* \(<<\)Saga\(>>\)--provides a way to define a series of related actions in a route that should be either completed successfully or not executed;
* \(<<\)DurableSubscriber\(>>\)--makes the messaging system save published messages while the subscriber is disconnected;
* \(<<\)EnvelopeWrapper\(>>\)--wraps application data inside an envelope that is compliant with the messaging infrastructure. The message should be unwrapped when it arrives at the destination;
* \(<<\)ContentEnricher\(>>\)--accesses an external data source so as to augment a message with missing information. Figure 3 presents the UML profile diagram with stereotypes for messaging systems.