0

I need to know following details about Azure SB-Relay:

  • Is relay exists?
  • No of listeners
  • Other details

I tried:

var nsmgr = NamespaceManager.CreateFromConnectionString("....");
bool b = nsmgr.RelayExists("SubjectedRelayName");

However, b is always false even though Relays exists in the list.

Can you please help?

Thanks in advance.

Thomas
  • 1,445
  • 14
  • 30
  • What version of Service Bus SDK are you using? I couldn't find RelayExists method. All I could find was RelayExistsAsync. – Gaurav Mantri Apr 10 '17 at 09:04
  • Hello Gaurav, version no is v4.0.30319 and it has also "RelayExists" (Sync version). – KoeKayttaja Apr 10 '17 at 09:06
  • Thanks. I just tried this and I was able to run it properly. What is the name you're giving for relay name? It should be path of the relay relative to the service namespace base address. – Gaurav Mantri Apr 10 '17 at 09:13
  • Hi. Interesting. Here is what I use for "RelayExists()" mehod parameter. For example, the name of my relay in the Azure portal is "testrelay/service.svc" and I tried both: RelayExists("https://myrelaysns.servicebus.windows.net/testrelay/service.svc") = returns "false" always and RelayExists("testrelay/service.svc") = always crashes with "Accepted" httpstatus code. – KoeKayttaja Apr 10 '17 at 10:44
  • This is what I used: `var manager = NamespaceManager.CreateFromConnectionString("my connection string"); var b = manager.RelayExists("temp"); Console.WriteLine(b);`. I get `True` back. – Gaurav Mantri Apr 10 '17 at 10:48
  • Ok. Is that "Temp" what you see in the Azure portal-->ServiceBus-->Relay as relay name? – KoeKayttaja Apr 10 '17 at 10:50
  • That's correct. – Gaurav Mantri Apr 10 '17 at 10:52
  • For me, if I use only relay name in the parameter, I get exception. but if, I use whole path, I get false always. I really do not know what is causing this. Is there any other way to get relay details? REST-API? – KoeKayttaja Apr 10 '17 at 11:48

0 Answers0