XEP-198 stream Management not working in Openfire 4.0.1 - openfire

I am new in openfire, i have setup openfire 4.0.1. Everything is working fine. But Stream Management is not working while it has been resolved.
https://igniterealtime.org/issues/browse/OF-446
But when user sending chat message no acknowledge getting back to sender.
I downloaded source code from here http://www.igniterealtime.org/downloads/source.jsp
I have enable streammanagement in smack client while making connection.
xMPPTCPConnection.setUseStreamManagement(true);
xMPPTCPConnection.setUseStreamManagementResumption(true);
Please suggest me if anything need to do with in openfire to enable stream management or anything i am doing wrong.
Thanks in advance.

You need to check the Incoming/Outgoing traffic and check what packet is sent by Smack for enabling stream management and if it gets acknowledgement from server about stream management enabled.
Please provide the packets here too.

Related

Why Mobilefirst 7.1 cannot auto recover / reconnect after network got lost / disconnected

IBM MobileFirst 7.1 is not auto recovering after a network failure / lost of connection even though all services/connections are back to normal.
We have a clustered / farm setup with 2 web and app servers (Tomcat). Both app servers are able to serve incoming transactions. We have this incident where-in there is a network failure/lost connection and during that time, all transactions are pointing to 1 app server. Although all connections went back to normal, this 1 app server still unable to connect to the configuration DB. What we did is turn-off this failure server and try the app which is now pointing to the other app server and the app works. We tried to restart the failure app server, test the app and is now accepting transactions. The question is, why it does not auto recover and Tomcat service needs to be restarted? Is MobileFirst 7.1 designed/built in such behavior (not auto recover)?
The expectation is, it should auto recover.
Please help and advise what can be checked/adjusted.
Thanks in advance.
Best regards,
Jonathan
The default DB configuration (datasource configuration) provided with MFP is not designed to auto recover when there is a DB connectivity issue. You
should be able to configure the MFP for auto-reconnect by providing correct data source configuration. See an article on how this is done for different app servers : https://www.techpaste.com/2016/04/jndi-autoreconnect-java-application-servers/

Does actioncable support resuming from an offline client?

I have a javascript SPA application that needs to support a user being offline for brief periods of time. I'm considering using actioncable for broadcasting changes the client may not be aware of.
If a websocket connection is lost for a brief amount of time, and then reconnected: will the client receive messages which were broadcast while they were offline?
Yes. Action cable will trigger a reconnect when the client gains access to the Internet.
You can test this your self by logging connections on your server and your client, then taking the client offline and reconnecting.
Hope this helps.
From the guide:
Broadcastings are purely an online queue and time dependent. If a consumer is not streaming (subscribed to a given channel), they'll not get the broadcast should they connect later.
So no, the client will not receive messages sent when they were offline.

how to checks if RabbitMQ server is alive using the REST API

I am totally new to spring framework. I am trying to create a project where I can have the connectivity to the rabbitMq and I even before I publish the message, I want to check if the queues are alive or not. Is this possible to ping the queue to see if it is alive or not?
RabbitMQ have the management API. You can use it to check the status of queue,exchange,binding.
If you are working on PHP. Then here is the libarary which can be used.

GCM Messages not being received sometime

Friend, I am working with a chat application. In my chat application I am using GCM for push notification. GCM is working fine with my application. But not all time I am not able to get GCM message. Sometime I receive GCM message and sometime don't. Why so? I searched for GCM message failure but did not find the right one.
Anyone, can please help me?
When you post a message to the Google GCM server (at https://android.googleapis.com/gcm/send), you need to pass three values: registration_id, collapse_key, and data.message. The collapse_key is likely your issue here.
Make sure that you pass a unique collapse_key for each message that needs to be reliably delivered. If you use the same collapse_key for each message, then GCM might drop multiple messages that are sent at around the same time.
You can find more information here: http://developer.android.com/google/gcm/adv.html.
Since you don't give much information about your situation and don't share code snippet it is hard to analyze the problem.But, as it is described in the documentation, GCM makes no guarantees about delivery or the order of messages.
If you are using your mobile internet through any firewall like "Cyberoam" or something like that then it restricts ports for the GCM push notification .Try to implement it using Direct internet connection without any firewall. This Solved Probelem for me. I hope it will help you too.
GCM requires port number 5228, 5229, and 5230 to be open. GCM typically uses 5228, but it sometimes uses 5229 and 5230 that might be restricted by the firewall.

Real-time chat with push notification

I am working on a private messasing functionality for my site,
is there a way to get push notifications from the server, that the user has received a new message?
the only technique I know is to constantly poll the server via ajax to see if there are new messages, and reload the messenger window if needed.
thanks for any feedback!
UPD: so far the following directions have been identified:
1) Comet
2) BOSH - Bidirectional-streams Over Synchronous HTTP
3) XMPP - this is what google talk is based on
You might want to look into XMPP and BOSH. Very comet like and ejabberd combined with nginx can maintain 1000's of connections on a very small box.
Take a look at one of my projects www.vooices.us to see what we have done with XMPP and BOSH.
http://www.ejabberd.im/
http://github.com/ssoper/jquery-bosh/tree/master JQueryBosh - to enable quick and easy access to XMPP over HTTP
It is relativly easy to set up and install.
Paul.
There isn't any way for the server to push information to the client, but you could always use Comet. Yes, you'd be polling the server, but not constantly. You'd keep each connection open for about 30 seconds (that's the interval I've always seen used) and then open a new connection when needed.
EDIT: Adobe Flash allows persistent connections to the server, so you could use that. See this article for details.
Sounds like the Comet probably links to some useful stuff (Look into Google's GTalk):
http://alex.dojotoolkit.org/2006/02/what-else-is-burried-down-in-the-depths-of-googles-amazing-javascript/
There are a lot of good libraries that help you to do this
XMPP - BOSH is a good combination which I use on my websites
XMPP servers
Ejabberd, Openfire I use ejabberd
You can use Strophe along with Ejabberd to capture notifications in javascript. If you want to send notifications from code
There are libraries like JAXL and XMPPHP that let you do this, but this is in PHP.