Map2
Map2 maps a message from the .\queue1 queue to both the .\queue2 queue and a text file named FileOut.txt. Map2 uses the two messages generated by Map1. These two messages are on the .\queue1 queue. These messages have the PROPID_M_CORRELATIONID message header property VT_CAB = CIDA (first message) and CIDB (second message), and the PROPID_M_LABEL message header property VT_LPSTR = LabelA (first message) and LabelB (second message).
The
setting for the MSMQQueue1 input card 1 is:
-QN .\queue1 -LABEL LabelB -CID CIDB -HDR -T -LSN 5
The Queue Name adapter command (-QN .\queue1) specifies retrieval of messages on the queue named .\queue1. The Label adapter command (-LABEL LabelB) and the Correlation ID adapter command (-CID CIDB) specify retrieval of messages with the LabelB label and the CIDB correlation ID. The Header adapter command (-HDR) specifies retrieval of the message body and message header properties. The Trace adapter command (-T) enables tracing and tracks function calls and stores the trace information in the default file named msmqtrace.log. The Listen adapter command (-LSN 5) specifies a wait period of no more than five seconds for a message to arrive if that message is not already on the queue.
On the output side of the map are two cards. The first card specifies the FileOut.txt file. The second card specifies another MSMQ queue: .\queue2. The map specifies that all operations on the .\queue queue (input card) will belong to the transaction with a map scope (OnFailure = Rollback, Scope = Map) and that operations on the .\queue2 queue will not be in any transaction (OnFailure = Commit). This means that the .\queue2 queue can be a non-transactional queue.
Notice that the input card has an option (OnSuccess = Keep) that indicates that a copy of the message will remain on the source queue (.\queue1).
The MSMQQueue1 input card 1 has an OnSuccess setting of Keep, specifying that a copy of every message will remain on the .\queue1 source queue.
Run Map2.