Get the first attribute with key key in msg.
the key
the attribute value of the first attribute with key.
Get the first attribute with key key in msg.