Get the nth attribute with key key in msg.
the key
the index
the attribute value of the nth attribute with key.
Get the nth attribute with key key in msg.