Added JNI binding to get message storage id + added possibility to limit the number of messages to fetch