Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

For Working offline - Which one to use - local database caching or reliable messaging?

Avatar

Level 2

Hi,

I am working on a mobile application with lcds where there is a feature to be implemented. The user can use the application in airplane mode and be able to automatically send requests to server when he comes online. After some research,  I found that I have to use a feature in the documentation called ocasionally conencted clients, which uses local database with dataservice.savecache() and offline adapter. I also found another feature called reliable messaging which takes care of sending the pending requests when the user comes online, but not sure if this feature supports offline mode for longer periods. The documentation mentioned that reliable messaging is only good for transient network disconnects, meaning disconenction for shorter time.

Can anybody please confirm which is the right feature that best suits this requirement?

Thanks,

Swathi.

6 Replies

Avatar

Former Community Member

Hi

Can you clarify whether you are using Messaging or Data Management? Reliable Messaging is a messaging feature while the Data Service is used for Data Management.

Regards,

Ashish Vashisht

Avatar

Level 2

Hi Ashish,

I am using Data management service. I tried out a sample for Data service with reliable messaging configured which works. But I think it is not perfect for user to work in offline mode for long time. I want to know the perfect feature for user to work/send requests with the mobile application in airplane mode and then be able to send the requests when online. I think the topic 'Ocasionally connected clients" in the documentation best suits this requirement. But please let me know if that is accurate or not for this functionality.

Thanks,

Swathi.

Avatar

Former Community Member

Hi

Based on your use case, the Occasionally Connected Clients feature should work for you. Specifically, you may want to have a look at this guide: http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WS4ba8596dc6a25eff-56f1c8f4126dcd...

Regards,

Ashish Vashisht

Avatar

Level 2

Hi Ashish,

Thank you so much for the resource. One more question, The code in the resource link,  has calls to Dataservice.disconnect() and Dataservice.connect() on the buttons. If my user need not bother to click on those buttons for connections and just set his phone to airplane mode and start working, I am using SocketMonitor class to monitor for network connection and then perform the Dataservice.connect(). In that case, I have problems when network is connected, the data service seems connected automatically some times and not connected other times resulting in errors. I am using autoConenct = true. How can I handle this? Do I have to call disconnect when socket is not available and then call conenct when it is available, things like that? Or Is there any other way to implement this without using SocketMonitor class?

Thanks,

Swathi.

Avatar

Former Community Member

Hi

When autoConnect is set to true, Data Services will automatically try to connect to the server when required. This will be periodically reattempted based on the autoConnectInterval property on the Data Store. If you want to control the connection manually, you should set autoConnect to false.

Regards,

Ashish Vashisht

Avatar

Level 2

Well, Thank you for the information.

Thanks,

Swathi.