Project

General

Profile

Issue with AMP when enabling message carbon

thilo jith
Added about 4 years ago

To implement message delivery options(single and double ticks) as like Whatsapp,I used to support XEP-0079 and XEP-0184 I achieved XEP-0184 without any issue. When I tried to get implement XEP-0079, I have faced the followings,

1.Message was not delivered to all the resources of recipient. Delivered to only one resource even I have enabled message-carbon.

2.Got an error message when the recipient in offline.

FYI, I am using tigase-message-archiving-1.0.1.jar for archiving messages

Tigase version 5.2.3

Request:

<message xmlns="jabber:client" from="550bc7a38acd14171215f3cb@192.168.1.94/opsbus_1427201770886" to="550bc7b08acd14171215f3ce@192.168.1.94" type="chat" id="1427201906165" isofflinemsg="false">
        <body>Test mesage</body>
        <custom msgid="534870c5-fe61-4359-b3b4-2d6ea16edbd6" />
        <active xmlns="http://jabber.org/protocol/chatstates" />
        <request xmlns="urn:xmpp:receipts" />
        <amp xmlns="http://jabber.org/protocol/amp" per-hop="true">
            <rule condition="deliver" action="notify" value="stored" />
            <rule condition="deliver" action="notify" value="direct" />
        </amp>
    </message>

Response to sender:

<message xmlns="jabber:client" id="1427201906165" from="192.168.1.94" to="550bc7a38acd14171215f3cb@192.168.1.94/opsbus_1427201770886" isofflinemsg="false" type="chat">
        <body>Test mesage</body>
        <custom msgid="534870c5-fe61-4359-b3b4-2d6ea16edbd6" />
        <active xmlns="http://jabber.org/protocol/chatstates" />
        <request xmlns="urn:xmpp:receipts" />
        <amp xmlns="http://jabber.org/protocol/amp" status="notify" from="550bc7a38acd14171215f3cb@192.168.1.94/opsbus_1427201770886" to="550bc7b08acd14171215f3ce@192.168.1.94">
            <rule condition="deliver" action="notify" value="direct" />
        </amp>
    </message>

At receiver end:

<message xmlns="jabber:client" from="550bc7a38acd14171215f3cb@192.168.1.94/opsbus_1427201770886" to="550bc7b08acd14171215f3ce@192.168.1.94" id="1427202045173" isofflinemsg="false" type="chat">
        <body>test message</body>
        <custom msgid="6fa40c07-a6bf-4d91-d7ac-a9b2d0d15d05" />
        <active xmlns="http://jabber.org/protocol/chatstates" />
        <request xmlns="urn:xmpp:receipts" />
        <amp xmlns="http://jabber.org/protocol/amp" per-hop="true">
            <rule condition="deliver" action="notify" value="stored" />
            <rule condition="deliver" action="notify" value="direct" />
        </amp>
    </message>

Please look at the response, it doesn't have resource id attached with "to".

Property file

--comp-class-6 = tigase.muc.MUCComponent
--comp-class-5 = tigase.muc.MUCComponent
--virt-hosts = 192.168.1.94
--user-db-uri = jdbc:mysql://localhost/tigasedb1?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-def
--comp-name-2 = pubsub
--comp-name-6 = conference
--comp-name-5 = channel
--cluster-mode = false
#--sm-plugins=+message-archive-xep-0136,-amp,-msgoffline,-message,+message-all
--sm-plugins=+message-archive-xep-0136,amp,-msgoffline,-message
--debug = server
--comp-class-4 = tigase.archive.MessageArchiveComponent
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-class-2 = tigase.pubsub.PubSubComponent
# To save group chat message. 
conference/default_room_config/conference#roomconfig_persistentroom=true
channel/default_room_config/channel#roomconfig_persistentroom=true
--debug=server, xmpp.impl
# To Enabling typing notification
conference/muc-allow-chat-states[B]=true
conference/message-filter-enabled[B]=false
message-archive/archive-repo-uri=jdbc:mysql://localhost/tigasedb1?user=root&password=root
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
--amp-repo-uri=jdbc:mysql://localhost/tigasedb1?user=root&password=root
sess-man/plugins-conf/amp/amp-jid=amp@192.168.1.94
--amp-security-level=NONE

Error when the recipient in offline

  MsgRepository.storeMessage()       WARNING:  Problem adding new entry to DB: 
java.sql.SQLException: Field 'msg_type' doesn't have a default value
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922)
    at tigase.server.amp.MsgRepository.storeMessage(MsgRepository.java:488)
    at tigase.server.amp.action.Store.execute(Store.java:129)
    at tigase.server.amp.AmpComponent.processPacket(AmpComponent.java:294)
    at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)

Replies (2)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 4 years ago

Thank you for letting us know about the problem, I created a bug report for you: #2877

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

I fixed issue with AMP working with Message Carbons and explained it in comment for #2877.

As for issue with storing message sent to offline user to offline storage this is issue with database schema upgrade - msg_type field is missing in offline storage table. There was an issue with database schema upgrade in older versions but it was fixed in newer version and should work fine.

    (1-2/2)