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.

Reliable messaging - viewing the pending queue

Avatar

Level 2

Hi,

I have applied reliable messaging concept with data service and rtmp channel. When I send a request during network disconnection, reliable messaging takes care to send the request once the network is resumed.  I want to know, if I can be able to view the pending messages in the queue after network resumes, so that I can do some operation like fill() after the pending messages are sent to the server. Menaing, I want to get notification when the pending messages are sent to the server after network resumes and do some operation after that. I also want to know how many requests are pending after the network resumes. Are there any events to capture this information?

Hoping to solve this problem with the forum's help.

Thanks,

betheflexcoder

8 Replies

Avatar

Level 3

Reliable message does its own queuing and resending under the covers. You should not need to do a fill operation after a transient disconnect; reliable messaging takes care of resending messages if needed.

Avatar

Level 1

Hi Mike,

Is there a way we can know the size and the status (sent, about to send... ) of the pending queue? We need this information to coordinate other tasks that we have in the client.

Thanks,

Jiayi

Avatar

Level 3

I do not believe you can do that with reliable messaging. You may be able to use a custom queue processor in combination with reliable messaging though. Have you looked into that yet in the doc?

Avatar

Employee

A custom queue processor would give you access to the messages that have been queued for the client on the server. This is at a layer or level above the reliable messaging queue. Reliable messaging is supposed to be transparent to the user so we don't allow messages or queues to be manipulated once they've been flushed to this layer or level.

I don't think there really is the concept of a message queue on the client butI don't think it would be too hard to implement something like this yourself. You'd just need to keep track of messages that had been sent for which you hadn't received replies yet. Those would be your pending messages. When you received a reply back to a message that was sent, you'd remove it from the list.

-Alex

Avatar

Level 2

Thanks Mike. I will look into how I can combine reliable messaging with custom queue processor.

Avatar

Level 2

Alex,

I am using reliable messaging with data services and it does a good job to reconnect and send pending requests on a transient network disconnect. I also understand that the custom queue processor gives access to messages queued from server to client. Are you sure that the reliable messaging queue is at a layer below the flex client outbound queue? I need to do some operation when the pending messages are sent to the server when the network resumes and do some operation after that. I can track messages which did not recieve response from, but my problem is to do some operation when there are no messages in the queue too. Do you know how to do it?

I believe the reliable messaging uses the existing default queue to keep track of messages and it should use the custom queue if defined. Any thoughts?

Avatar

Level 2

Hi Mike,

After looking into the custom queue processor in the documentation, I understand that it gives control over the queue from server to each client. But do we have any means for the Flex client application to know the size of the pending requests? I can capture the response for the pending request after the network is connected and do some other operation in the response handler. But still, I need to know if the queue is empty and there is a case where it does not go to the result handler. Can we know when the client application starts sending the pending requests?

Thanks,

betheflexcoder

Avatar

Level 1

Hi Alex,

Does the client can have a peek of the reliable messaging size? The size info will be very crucial for the client to coordinate other tasks that have to proceed AFTER reliable messaging finishes.

Thanks,

Jiayi