Certain messages sent to the chat rooms not dumped in the ofMessageArchive table even after enabling monitoring service plugin

Hello,
Hope you are doing well.

I have been using Openfire for creating chat support application. For which I have use cases like sending messages to the chatroom like “Next available agent will assist you shortly” or “Agent1 has joined the chat room” etc. We call these messages system messages. I have enabled the monitoring plugin. But i notice that even after enabling the message archiving for one-one chats, group chats and group stanzas, the messages that I sent for the above mentioned system message use case, are not getting archived or getting dumped into the ofMessageArchive table. Other messages sent using clients like converse are dumped correctly.
To give more context, I am using the RestAPI plugin and have exposed an API for our use case. This API is invoked from one of our other services and will then use mucRoom.sendPublicMessage() to send this system message. The send role which is accepted by this method is set as the room’s role itself. Long story short, we send these system messages from the backend itself using the MucRoom . sendPublicMessage().
When a user joins a chat room, all history messages of that room including the above mentioned system messages have to be displayed to him. But because of this issue, system messages are not shown to a user when he joins the chat room.

Please advice

Thanks a lot in advance.

From a cursory read of the code, the Monitoring plugin will not store messages that are not of type ‘chat’ or ‘normal’. Is that the case for your message?

As an aside: are you recreating our FastPath plugin? It sounds like you’re creating something similar. :slight_smile:

Thanks a lot for the quick response, Guus.
The message that I am sending here has the type ‘groupchat’. And we have another use case where when we send such a message with type as ‘groupchat’ and it is working fine in that case. That message is successfully dumped into the ofMessageArchive table. The only difference that i find in both these use cases is that in the case where it is not working the sender role used is chatroom’s role. But in the case it is working fine, we have used the sender role as one of the occupants role. Could this be the reason why this is not working? I couldnt find these details in the monitoring plugin source code.

Also you are right Guus. we are creating an application similar to FastPath Plugin. We already had a service which identifies the available agents and have many other functionalities for the available agent. Now we are integrating this service with the Openfire.