Project

General

Profile

AMP + Message Archiving

Mauricio Giacomello
Added about 2 years ago

Hi guys, me here again.

Now with a question related to AMP working together with Message Archiving.

So, our current issue is that Message Archiving is storing AMP notification stanzas. We don't know if this is a expected behavior, something configurable or an issue.

Current scenario:

1 - We send a message from A to B, both in the same Tigase Server. Stanza:

<message xmlns="jabber:client" id="gXd79-72" time="1487795805691" type="chat" to="testbot2@example.com" from="testbot1@example.com/Smack">
    <body>Quis dolorum nam quia.这यहこน이Эéç</body>
    <request xmlns="urn:xmpp:receipts"/>
    <amp xmlns="http://jabber.org/protocol/amp">
        <rule value="direct" action="notify" condition="deliver"/>
        <rule value="stored" action="notify" condition="deliver"/>
        <rule value="none" action="error" condition="deliver"/>
    </amp>
</message>

2 - User A receives the AMP status notification. Stanza:

<message xmlns="jabber:client" id="gXd79-72" time="1487795805677" type="chat" to="testbot1@example.com/Smack" from="example.com">
    <body>Quis dolorum nam quia.这यहこน이Эéç</body>
    <request xmlns="urn:xmpp:receipts"/>
    <amp xmlns="http://jabber.org/protocol/amp" to="testbot2@example.com" from="testbot1@example.com/Smack" status="notify">
        <rule value="direct" action="notify" condition="deliver"/>
    </amp>
</message>

3 - User B receives me message. (same as #1)

4 - Query message archive Database and we see 3 stanzas (2 messages + AMP response) when we were expecting to see only 2 (inbound and outbound).

5 - Request message archive between A and B (from A) and we see duplicated messages, when expecting to see only 1.

Our init properties look like this:

config-type=--gen-config-def
--admins=admin@localhost
--virt-hosts=localhost,example.com
--debug=server

# Configurations for tigase user database
--user-db=sqlserver
--user-db-uri=jdbc:jtds:sqlserver://<removed_to_post>

# Configurations for chat service audit database
--audit-db=sqlserver
--audit-db-uri=jdbc:jtds:sqlserver://<removed_to_post>

# Configurations for AuthRepository
# We don't need to configure '--auth-db-uri' because we don't have an authentication database
--auth-db=com.<removed_to_post>.authentication.UserAuthRepository

# Configurations for Message Archive
message-archive/archive-repo-uri=jdbc:jtds:sqlserver://<removed_to_post>
sess-man/plugins-conf/message-archive-xep-0136/default-store-method=message
sess-man/plugins-conf/message-archive-xep-0136/required-store-method=message

# Configurations for dynamic roster
sess-man/plugins-conf/dynamic-roster-classes=tigase.xmpp.impl.roster.AnonymousRoster

# Install SASL External Mechanism
sess-man/plugins-conf/callbackhandler=com.orchestral.chatservice.authentication.JwtSaslCallbackHandler
sess-man/plugins-conf/factory=com.orchestral.chatservice.authentication.JwtSaslServerFactory
sess-man/plugins-conf/urn\:ietf\:params\:xml\:ns\:xmpp-sasl/mechanism-selector=<removed_to_post>


# The plugins which are enabled
--sm-plugins=message-archive-xep-0136

# The Components which are enabled
--comp-name-1=message-archive
--comp-class-1=tigase.archive.MessageArchiveComponent

# Configuration for BOSH
--bosh-ports=5280,5281
bosh/connections/5281/socket=ssl
bosh/connections/5281/type=accept

# Certificate Directory
--cert-directory-path=certs/
--keystore-name=<removed_to_post>
--keystore-password=<removed_to_post>
--public-key-alias=<removed_to_post>

# Setting to enable AMP between users who are not in rosters
--amp-security-level=NONE

Versions: Tigase 7.1, Message Archiving 1.2;

Thanks in advance,

Mauricio Giacomello.


Replies (2)

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

Message Archive is designed to archive any <message/> with <body/> element and in it. And it does so, it archives incoming message with AMP status notification, why it should not archive this incoming message? Only because it is AMP notifcation?

It is possible to reconfigure processor using sess-man/plugins-conf/message-archive-xep-0136/msg-archive-paths[s] however it is not possible to skip AMP notification message as there is now way to identify this kind of message using only XML path and XMLNS of element at provided path.

Added by Mauricio Giacomello about 2 years ago

Thanks of the quick response Andrzej.

We were expecting this response and we are considering modifying the class that filters the messages to fit our use case, by filtering-out messages with amp extension containing status attribute (amp notification)

+We're happy to contribute back to the project+ if you think this something you would like to have, maybe configurable?

Thanks in advance,

Mauricio Giacomello.

    (1-2/2)