Message Archiving Retrieval -- round up by date (for non Derby) ?

Matthew M
Added over 5 years ago

I am trying to retrieve message history via a request, but the server set back the data with messages "before" the "start" time I specified in the request.

Then I look into the code, I found Tigase round up the time to the "starting time of this date", then query the DB to fetch the history, which might cause the returning of messages "earlier" than the start time in the request. This happens whenever the DB is not Derby (I am using MySql) Do you know why it's done that way?

                if (derby) {
                    get_messages_st.setTimestamp(3, collection);
                    get_messages_st.setInt(4, offset);
                    get_messages_st.setInt(5, limit);
                } else {                
                        get_messages_st.setInt(3, limit);
                        get_messages_st.setInt(4, offset);
                        long milis = collection.getTime() / (24 * 60 * 60 * 1000);    <==== Round up?
                        get_messages_st.setDate(3, new java.sql.Date(milis * 24 * 60 * 60 * 1000)); <==== Round up?
                        get_messages_st.setInt(4, limit);
                        get_messages_st.setInt(5, offset);


Replies (1)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 5 years ago

This round up was added in initial implementation of component as messages are divided into collections (list collections).

In our implementation collection represent a day and in this case we used start attribute (collection variable) as collection identifier which was rounded up to a day.

We will reimlement this feature to remove round up and to allow quering messages without direct correlation to collection.