powered by Jive Software

How Openfire enable stream management

Version: 4.2.1

I sent this to server,request for stream management
image

According to xep-0198, server should response a enabled or failed elem.
But I got no response.
I have checked openfire.xml and it’s actived.

    <stream>
        <management>
            <!-- Whether stream management is offered to clients by server. -->
            <active>true</active>
            <!-- Number of stanzas sent to client before a stream management
                 acknowledgement request is made. -->
            <requestFrequency>5</requestFrequency>
        </management>
    </stream>

I can’t speak english well,hope u understand.
Please help,thank you so much!!!

what version of openfire are you using? Do you have a system property called stream.management.active ?

Version: 4.2.1
yes and it’s true.


what else can i check?
thanks for replying!

Looks about right to me. Are you sure stream management is not enabled? Can you enable debug logging, see if anything interesting is logged there? Perhaps you can try to ‘resume’ a stream, which, if stream management is enabled, should trigger errors. That way, we can tell if SM is enabled or not.

@guus
Thanks for answering!

I sent this.
<body rid='4126193214' xmlns='http://jabber.org/protocol/httpbind' sid='1eu3alpuem'><resume xmlns='urn:xmpp:sm:3' h='123' previd='22222'/></body>
And here is the log printed after I sent ‘resume’ elem.

Seems no error?

And When I sent enable request,log printed like this.

<body rid='4215264985' xmlns='http://jabber.org/protocol/httpbind' sid='79d4lptmqg'><enable xmlns='urn:xmpp:sm:3' resume='false'/></body>

2018.02.23 10:41:43 org.jivesoftware.openfire.http.HttpBindServlet - Data is available to be read from [0:0:0:0:0:0:0:1] 
2018.02.23 10:41:43 org.jivesoftware.openfire.http.HttpBindServlet - All data has been read from [0:0:0:0:0:0:0:1]

I am not sure SM is enabled or not.

But my client (strophe.js) got no elem which has ‘enabled’ tag.And i can’t see reponse like ‘enabled’ or ‘failed’ in chrome’s network tool.

How can I check?
Or can you tell me which part of source code handle request for enabling SM? Then I can make a break point to see is it called.

I tried StreamManager.java line 124
enable( element.getNamespace().getStringValue(), resume );
And it hasn’t been called.

Thanks for helping again!

I’m unsure if Strophe.JS supports Stream Management. Have you tried this plugin for Strophe.JS? https://github.com/strophe/strophejs-plugin-stream-management

yes,i am using this plugin.
And it seems work,but got no response.

can you tell me which part of source code handle request for enabling SM? Then I can make a break point to see is it called.

Thanks!

Thank you so much!

I made a change at HttpSession.java line 635.
Then it works fine.

Hi @guus, @speedy, @q409074615,

I am using https://github.com/strophe/strophejs-plugin-stream-management to get sent message acknowledgement. But not getting callback of message acknowledgement.

I am using openfire server 4.3.1 and stream.management.active property is enable.
I am using strophe.js client library.

Here is the step i am following:-

  1. Enabling stream management option by calling enable() method of stream plugin of strophe after getting openfire connection with success status.
    connection.streamManagement.enable();
    Request:-


    Response:-

  2. Applying settings for message acknowledgement.
    connection.streamManagement.sendCountOnEveryIncomingStanza = true;
    connection.streamManagement.requestResponseInterval = 0;
    connection.streamManagement.addAcknowledgedStanzaListener(this.onMessageAck);

  3. After sending few messages, i request for message acknowledgement using
    connection.streamManagement.requestAcknowledgement();
    Request:-


    Response:-

    But did’t get any acknowledgement callbacks.

Please help me on this, what am i doing wrong ?
Is there anything that i am missing ?

There have been a few issues with stream management is past builds. are you able to upgrade your instance of OF to the most current version?

Hi,
I have update openfire server code with HttpSession.java class as @q409074615 mention and it works now.
But one issue i face is, acknowledgement receive every time when stenza is sent. cases like if i send message on deleted chat room, it sends me acknowledgement.