Project

General

Profile

Getting the msg field of tig_ma_msgs through an XMPP query.

Alen Ilkov
Added about 3 years ago

I am using tigase and so far have found its features and performance very impressive - hence first post:

Without getting too much into details, my version is 'version: 7.0.1-b3810', message archiving enabled, messages are getting logged to a table called 'tigasedb:tig_ma_msgs' with the following structure:

mysql> desc tig_ma_msgs;
+-----------+---------------------+------+-----+-------------------+-----------------------------+
| Field     | Type                | Null | Key | Default           | Extra                       |
+-----------+---------------------+------+-----+-------------------+-----------------------------+
| msg_id    | bigint(20) unsigned | NO   | PRI | NULL              | auto_increment              |
| owner_id  | bigint(20) unsigned | YES  | MUL | NULL              |                             |
| buddy_id  | bigint(20) unsigned | YES  | MUL | NULL              |                             |
| ts        | timestamp           | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| direction | smallint(6)         | YES  |     | NULL              |                             |
| type      | varchar(10)         | YES  |     | NULL              |                             |
| body      | text                | YES  |     | NULL              |                             |
| msg       | text                | YES  |     | NULL              |                             |
+-----------+---------------------+------+-----+-------------------+-----------------------------+
8 rows in set (0.00 sec)

I absolutely need the message IDs for several operations I am implementing, it is right there in the 'msg' field and I seem to have no way to retrieve it through the XMPP interaction. Is there a way?

Thank you,

Alen


Replies (5)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 3 years ago

Currently msg_id field and it's value is internal and not accessible using XMPP interaction so there is no possibility to retrieve it using XMPP interaction. To do so you would need to modify Tigase Message Archiving component in some way to retrieve this value and i.e. send it as some attribute of element responsible for delivery of archived message to XMPP client.

Added by Alen Ilkov about 3 years ago

Hi Andrzej,

I did not mean the msg_id field. It is auto-incremented and apart from the DB, it is meaningless to me. What I need is the message ID that's in the full message stanza stored in 'msg' field. In other words, I need the 'msg' field.

It seems to be there for a reason but I can't find settings to get to it.

Thanks,

Alen

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 3 years ago

So you need id attribute of stored message, right?

Unfortunately this value is also not returned as we keep it in database but it is not copied in JDBCMessageRepository when we create from@/@to elements - only children of message elements are copied, while it's attributes are omitted.

To retrieve it you would need to customize Tigase Message Archiving implementation.

Added by Alen Ilkov about 3 years ago

Ok thanks, that'll save me time looking further. I am implementing message delivery/read receipts (id-based) and need to store message IDs, was trying to avoid storing redundant data.

If the full stanza is stored but isn't accessible, I am assuming it is done for future considerations?

Added by Alen Ilkov about 3 years ago

I just re-read your reply, I'll look at what it takes to customize Tigase Message Archiving implementation.

    (1-5/5)