## 3 UML Profile for Messaging Patterns
### Stereotypes for ZeroMQ Framework Patterns  
ZeroMQ defines specialized versions of two EIP patterns: the Publish-Subscribe Channel and Request-Reply. The built-in core ZeroMQ Request-Reply patterns are:  
* \(<<\)LazyPirate\(>>\)--polls the socket and receives from it only when it is sure a reply has arrived. If no reply has arrived within a timeout period, the pattern resends a request. The transaction is abandoned if there is no reply after several requests;
* \(<<\)SimplePirate\(>>\)--extends the Lazy Pirate pattern with a queue proxy that allows for transparent communication with multiple servers;
* \(<<\)ParanoidPirate\(>>\)--allows for robust reliable queuing that allows sending and receiving messages at any time but requires its own envelope management;
* \(<<\)Majordomo\(>>\)--adds a service name to requests that the client sends and asks servers to register for specific services. Adding service names turns the Paranoid Pirate pattern from the queue into a service-oriented broker;
* \(<<\)Titanic\(>>\)--stores messages in the message broker to ensure they never get lost;
* \(<<\)BinaryStar\(>>\)--puts two servers in a primary-secondary high-availability pair: At any given time, the active server accepts connections from client applications. The passive server is idle, but the servers monitor each other. If the active server stops working, the passive one takes over as active;
* \(<<\)Freelance\(>>\)--creates a pool of name servers so if one stops working, clients can connect to another. In this architecture, a large set of clients connect to a few servers in a pool directly. The clients connect to the pool, which is the opposite of a broker-based approach such as Majordomo, where clients connect to the broker. Figure 5 shows, in the UML Profile diagram, the ZeroMQ stereotypes inheritance tree for specializations of the Request-Reply pattern. The \(<<\)Titanic\(>>\)--stereotype stands for the most specialized version of the Request-Reply pattern, whereas the \(<<\)Freelance\(>>\) stereotype refers to its most flexible variant. Table 6 shows a few ZeroMQ stereotypes with proposed icons for the Request-Reply pattern specializations. The original icon for the Request-Reply pattern has been modified and a black-red-white color schema has been adopted for icons proposed for stereotypes related to ZeroMQ patterns. Figure 5: ZeroMQ stereotypes for patterns that inherit from the EIP Request–Reply pattern. The built-in core ZeroMQ Publish-Subscribe Channel patterns are:  
\(<<\)SuicidalSnail\(>>\)--allows for the detection of slow subscribers. Devoted to subscribers having service-level agreements to guarantee specific maximum latency;  
\(<<\)BlackBox\(>>\)--allows for detection and dealing with high-speed subscribers. The pattern breaks subscriber design into a multithreaded one so that sending and reading messages are in separate sets of threads;  
\(<<\)Espresso\(>>\)--allows for monitoring a publish-subscribe network and works by creating a listener thread that reads a socket and prints anything it gets;  
\(<<\)Clone\(>>\)--builds a shared key-value store. The pattern allows for updating a shared state across a set of clients. To achieve that, the pattern uses key-value pairs, which represent atomic units of change in the shared state. Each of these four patterns presented is a direct specialization of the Publish-Subscribe Channel pattern. Similarly here, the original icon for the Publish-Subscribe Channel pattern has been modified and a black-red-white color schema has been adopted for icons proposed for stereotypes related to ZeroMQ patterns. Table 7 shows ZeroMQ stereotypes with proposed icons for the Publish-Subscribe Channel pattern specializations.