One realm with more than one outbound (master) gateway connection

Hello,

From the UI, it seems that each realm can only have one outbound (master) gateway connection.

Is it possible, through the UI or in some other way, to have one realm with more than one outbound (master) gateway connection?

Keep up the good work!
Thank you.

Best regards,
Adriano Carvalho

Hi Adriano,

I believe this is a UI limitation rather than a functional limitation. I’m not sure how the system would behave with multiple masters thought. The developer who wrote that piece of code is on vacation at the moment :slight_smile: Will ask him when he gets back.

Don

2 Likes

Hi,

I have implemented this functionality, with some changes to REST API.

Summary of changes:

  • Two fields were added to GatewayConnection: id and localUser. The database schema was also updated.
  • In GatewayClientService, the keys to the connection and client maps were changed to the id (they were the realm).
  • GatewayClientResource/Impl: changed some endpoints to include the id.
  • ui/app/manager: the connection with the id equal to the realm is the one used in the UI.

Check the following commit and the two before it. One of them is a merge with master. So, there are only two commits with changes from me.

Should I make a pull request? Please let me know how you would like to proceed.

Best regards,
Adriano Carvalho

2 Likes

Hi Adriano,

Great work, thanks for your input! :star_struck:
We will take some time this week or the next to look at your changes. Feel free to make a pull request.

Kind regards,

Don

Done. Please let me know if you have any questions.

1 Like

Hi @adrianocarvalhodtx

Thanks for taking the initiative to contribute code we would need a signed contributor agreement.

Before we consider integrating such a change we’d like to understand the exact use case for this, it wasn’t envisaged that you would need/want multiple outbound connections from an edge gateway.

Rich

Hi,

The use case we have in mind is the following.

Suppose you have one or more factories. Each factory has an instance of OpenRemote to manage the assets there, independently of other factories.

Each factory, however, has devices/assets from various suppliers. Suppliers would like to monitor the operation of their devices/assets on those factories (using OpenRemote as well).

To do that, a gateway is needed for each supplier. Moreover, such a gateway needs to be filtered, that is, not everything is shared with the supplier. Those on the factory should be able to chose what is shared (e.g., by linking assets to a service user corresponding to that supplier).

The need for a gateway “filter” is the reason why we included not only the id but also a username in the connection data structure. That is also the reason for this and this.

Hope this help. Please let me know if you have any questions.

Best regards,
Adriano Carvalho

2 Likes

Hi and thanks for the info.

This sounds like a use case better solved by giving access to the suppliers on the central manager; you can specify exactly which assets they can see by making the user restricted and linking them to the appropriate assets.

The edge gateways aren’t concerned with who will access the data but just communicating with a central cloud hosted manager instance.

All the best,

Rich

Hi,

I am not sure I understand you correctly but it seems that you would end up exposing all of the client’s data (in the realm) and this is something we cannot have.

Best regards.
Adriano Carvalho

I reread your message and what I think you are proposing is that: in the factory instance, a user is created, specifically for the supplier.

That does work but the supplier wants to integrate all their assets into a single instance. Otherwise, in order to get a list of all assets (for example), a separate request to all know factories would be needed.