Add getMessages' function

getMessages' allows specification of max message retrieval and timeout settings