Project

General

Profile

Message Archiving component should return custom message fields

Vinoth Rajendran
Added about 4 years ago

I am using Tigase 7.0 SNAPSHOT build at 2015-01-12.

my init.properties files is,

--comp-class-1 = tigase.muc.MUCComponent
--comp-class-6 = tigase.muc.MUCComponent
--comp-class-5 = tigase.muc.MUCComponent
--virt-hosts = 192.168.1.94
--user-db-uri = jdbc:mysql://localhost/tigasedb?user=root&password=root
--user-db = mysql
--admins = admin@192.168.1.94
--comp-name-4 = message-archive
--comp-name-3 = proxy
config-type = --gen-config-all
--comp-name-2 = pubsub
--comp-name-6 = conference
--comp-name-5 = channel
--comp-name-1 = muc
--cluster-mode = true
--sm-plugins = +message-archive-xep-0136

conference/default_room_config/conference#roomconfig_persistentroom=true
muc/default_room_config/muc#roomconfig_persistentroom=true
channel/default_room_config/channel#roomconfig_persistentroom=true

--debug = server, archive
--comp-class-4 = tigase.archive.MessageArchiveComponent
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-class-2 = tigase.pubsub.PubSubComponent
--tigase.cache=true

muc/room-log-directory[S]=./logs/
message-archive/archive-repo-uri=jdbc:mysql://localhost/tigasedb?user=root&password=root
#message-archive/auto=true
sess-man/plugins-conf/message-archive-xep-0136/required-store-method=message
sess-man/plugins-conf/message-archive-xep-0136/component-jid=message-archive@192.168.1.94

Private chat Message stored database in both body and stanza format. But message body only can receive at chat items.

Some one reported it as issue by 10 months ago. https://projects.tigase.org/issues/1777

I donot know how to retrieve full message stanza .


Replies (5)

Added by Wojciech Kapcia TigaseTeam about 4 years ago

With your setting, upon retrieval you should receive full stanza. Can you please share example stanza exchange with the server to illustrate your problem?

Added by Anonymous about 4 years ago

Thanks for the update.

This Stanza I sent :

<body xmlns="http://jabber.org/protocol/httpbind" rid="1807704278" sid="885d2613-cd23-4184-9c38-7bec0bf07355">
    <iq xmlns="jabber:client" type="get" id="2610:retrieve">
        <retrieve xmlns="urn:xmpp:archive" with="54bf301b81c9bd7302cd8ad3@192.168.1.94" start="2015-01-21T04:51:06+0000">
            <set xmlns="http://jabber.org/protocol/rsm">
                <max>4</max>
                <before />
            </set>
        </retrieve>
    </iq>
</body>

This is I have Received :

<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" xmlns:xmpp="urn:xmpp:xbosh" from="192.168.1.94" host="vinoth-system-product-name" ack="3248212981" secure="true" xmpp:version="1.0">
    <iq xmlns="jabber:client" id="4679:retrieve" to="54bf2ff081c9bd7302cd8ad2@192.168.1.94/721798302-tigase-57" type="result">
        <chat xmlns="urn:xmpp:archive" with="54bf301b81c9bd7302cd8ad3@192.168.1.94" start="2015-01-21T04:51:06+0000">
            <to secs="18033">
                <body>101</body>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <to secs="18034">
                <body>102</body>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <to secs="18036">
                <body>103</body>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <to secs="18037">
                <body>104</body>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <set xmlns="http://jabber.org/protocol/rsm">
                <first index="103">103</first>
                <last>112</last>
                <count>113</count>
            </set>
        </chat>
    </iq>
</body>

Response does not contain a full stanza.

On Wed, Jan 21, 2015 at 5:02 PM, support@tigase.org wrote:

Added by Wojciech Kapcia TigaseTeam about 4 years ago

Anonymous wrote:

Thanks for the update.

This Stanza I sent :

[...]

This is I have Received :

[...]

Response does not contain a full stanza.

When I was asking about example stanza exchange I implied original message and message retrieved from archive. Right now we still don't know what's missing - please share examples.

Added by Vinoth Rajendran about 4 years ago

I have sent the following stanza to tigase for retrieving private chat messages :

<body xmlns="http://jabber.org/protocol/httpbind" rid="1807704278" sid="885d2613-cd23-4184-9c38-7bec0bf07355">
    <iq xmlns="jabber:client" type="get" id="2610:retrieve">
        <retrieve xmlns="urn:xmpp:archive" with="54bf301b81c9bd7302cd8ad3@192.168.1.94" start="2015-01-21T04:51:06+0000">
            <set xmlns="http://jabber.org/protocol/rsm">
                <max>3</max>
                <before />
            </set>
        </retrieve>
    </iq>
</body>

Following stanza is what I have received from tigase :

<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" xmlns:xmpp="urn:xmpp:xbosh" from="192.168.1.94" host="vinoth-system-product-name" ack="3248212981" secure="true" xmpp:version="1.0">
    <iq xmlns="jabber:client" id="4679:retrieve" to="54bf2ff081c9bd7302cd8ad2@192.168.1.94/721798302-tigase-57" type="result">
        <chat xmlns="urn:xmpp:archive" with="54bf301b81c9bd7302cd8ad3@192.168.1.94" start="2015-01-21T04:51:06+0000">
            <to secs="18033">
                <body>101</body>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <to secs="18034">
                <body>102</body>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <to secs="18036">
                <body>103</body>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <set xmlns="http://jabber.org/protocol/rsm">
                <first index="103">0</first>
                <last>2</last>
                <count>3</count>
            </set>
        </chat>
    </iq>
</body>

In the above stanza Private chat messages are 101, 102, 103.(See 'body' tag of xml tag 'to')

These messages itself (say 101, 102, 103) are stored in table tig_ma_msgs at the field 'body' where as the full message stanzas are stored at field msg of same table tig_ma_msgs.

As mentioned above the stanza store in field 'msg' of table tig_ma_msgs follows :

<message to="54bf301b81c9bd7302cd8ad3@192.168.1.94" id="1421815865865" from="54bf2ff081c9bd7302cd8ad2@192.168.1.94/f6e70d13-96f2-469b-8b50-e0120810307d" xmlns="jabber:client" type="chat" time="1421815866504">
    <body>101</body>
</message>

Expected Response from tigase should be as follows :

<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" xmlns:xmpp="urn:xmpp:xbosh" from="192.168.1.94" host="vinoth-system-product-name" ack="3248212981" secure="true" xmpp:version="1.0">
    <iq xmlns="jabber:client" id="4679:retrieve" to="54bf2ff081c9bd7302cd8ad2@192.168.1.94/721798302-tigase-57" type="result">
        <chat xmlns="urn:xmpp:archive" with="54bf301b81c9bd7302cd8ad3@192.168.1.94" start="2015-01-21T04:51:06+0000">
            <to secs="18033">
                <message to="54bf301b81c9bd7302cd8ad3@192.168.1.94" id="1421815865865" from="54bf2ff081c9bd7302cd8ad2@192.168.1.94/f6e70d13-96f2-469b-8b50-e0120810307d" xmlns="jabber:client" type="chat" time="1421815866504">
    <body>101</body>
</message>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <to secs="18034">
                <message to="54bf301b81c9bd7302cd8ad3@192.168.1.94" id="1421815865865" from="54bf2ff081c9bd7302cd8ad2@192.168.1.94/f6e70d13-96f2-469b-8b50-e0120810307d" xmlns="jabber:client" type="chat" time="1421815866504">
    <body>102</body>
</message>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <to secs="18036">
<message to="54bf301b81c9bd7302cd8ad3@192.168.1.94" id="1421815865865" from="54bf2ff081c9bd7302cd8ad2@192.168.1.94/f6e70d13-96f2-469b-8b50-e0120810307d" xmlns="jabber:client" type="chat" time="1421815866504">
    <body>103</body>
</message>
                <active xmlns="http://jabber.org/protocol/chatstates" />
            </to>
            <set xmlns="http://jabber.org/protocol/rsm">
                <first index="0">0</first>
                <last>2</last>
                <count>3</count>
            </set>
        </chat>
    </iq>
</body>

Here if you see the expected result and the actual result from tigase, what I need is to get the stored stanza('msg') field along with the usual response.

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

Tigase Message Archiving conforms to XEP-0136 which suggests in examples to send as part inner element of or element. From this point of view, if is inner element of or then in response to request messages when whole message is saved we copy all inner elements of to or element and in fact we send all custom message fields, but not attributes set on element.

So right now there is no possibility to retrieve items of collections in format you expect.

    (1-5/5)