RobotWebServices subscriptions

Maxim Riabichev
Maxim Riabichev Sweden admin
edited March 31 in Developer Tools
Hello everyone,

In this post, I'd like to share some information regarding which approach one should take when working with subscriptions to resources made available via RobotWebServices.

Let's assume a scenario in which you are interested in receiving RMQ messages sent by a robot, so you're looking for a way to get access to this data via the DIPC queue resource "/rw/dipc{queue-name}".

You set up a subscription to this resource, but then you find out that the response you get omits some data which would otherwise be available via a GET request.

What gives?

The subscription mechanism on the resource "/rw/dipc{queue-name}" is provided by RWS to get an event when there is a message in that queue. The subscription event is not meant to fetch all information. To get all information, the user has to make a GET request.

Subscriptions are only supposed to provide notification so that the user can perform GET operation only after that and not all the time. This will assure to avoid unnecessary traffic and load on the system.

All the available information for the resource "/rw/dipc{queue-name}" is intentionally not included in the subscription event because that will make overhead and traffic in the WebSocket connection.

For a better understanding of a similar use-case of subscription, one can take a look at "/rw/rapid/taskselection;taskpanelchange" subscription.

For this particular subscription, RWS does not provide any information except change-count in the event. After getting the event, the user is supposed to make a GET request for reading the entire information.

There are many examples like this. One more is subscription on "/rw/system/energy".


The recommendation is therefore to set up a subscription for the relevant resource, and then when triggered, perform a GET request to fetch all necessary information.


In case anyone ends up in this situation, I hope it is now more clear on how to proceed.


Thanks for your attention and good luck with your projects!

Maxim Riabichev
PC Software Support Engineer
Post edited by Maxim Riabichev on