# Remote Gateway System Name given a TagProvider

**URL:** <https://forum.inductiveautomation.com/t/remote-gateway-system-name-given-a-tagprovider/97438>\
**Category:** 3rd Party Modules\
**Created:** [October 18, 2024, 7:33am UTC](https://forum.inductiveautomation.com/t/remote-gateway-system-name-given-a-tagprovider/97438 "2024-10-18T07:33:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [October 18, 2024, 7:33am UTC](https://forum.inductiveautomation.com/t/remote-gateway-system-name-given-a-tagprovider/97438/1 "2024-10-18T07:33:19Z")

</div>

Is it possible to discern the Gateway Name for a Remote Tag Provider given a `TagProvider` Java object?

I need to know this so that I can properly differentiate entries in the `sqlth_drv` table of a shared historian DB.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 18, 2024, 11:00am UTC](https://forum.inductiveautomation.com/t/remote-gateway-system-name-given-a-tagprovider/97438/2 "2024-10-18T11:00:54Z")

</div>

See this topic:

> [@Remote Tag Provider History Queries](https://forum.inductiveautomation.com/t/remote-tag-provider-history-queries/93632):
>
> I'm working on a couple tasks related to historians and history queries, and have encountered some behaviors of remote tag providers (RTPs) that have me stymied: There's no public way to retrieve the gateway name that a RTP is pointing at, nor any public way to retrieve the far end's real tag provider name. (Reflection has exposed com.inductiveautomation.ignition.gateway.tags.distributed.client.RemoteTagProvider and com.inductiveautomation.metro.api.ServerId to me, and a number of private fie…

Note that the Exchange project linked at the bottom has sample code.

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [October 21, 2024, 12:21am UTC](https://forum.inductiveautomation.com/t/remote-gateway-system-name-given-a-tagprovider/97438/3 "2024-10-21T00:21:37Z")

</div>

Thank you. The TL;DR for those following along is that I'm following @pturmel's lead and using reflection to retrieve `gateway.remoteServerId.address` from the RemoteTagProvider object. (For now, at least.)
