none
Service bus relay + subscription/topic hybrid?

    Question

  • I have multiple clients (on NATs) that receive individual messages, and I am trying to use the Service Bus relay for this - works great with one client. 

    Do I need to create a namespace for each new client (will be hundreds), or how can I get the client to receive only 'his' messages?

    Is subscription/topics a better option, in some hybrid combination with the relay service? Or is there a better way?

    Any idea or input is welcome.

    Thanks!

    Monday, February 25, 2013 5:47 PM

Answers

  • Hi,

    The realy service is different to the brokered service (Queues, Topics & Subscriptions) model.

    When using the realy model you can create a different sub-name for wach service.

    e.g.:

    • mynamespace.servicebus.windows.net/service1
    • mynamespace.servicebus.windows.net/service2

    you can even do:

    • mynamespace.servicebus.windows.net/orderservice/service1
    • mynamespace.servicebus.windows.net/orderservice/service1
    • mynamespace.servicebus.windows.net/invoiceservice/service1
    • mynamespace.servicebus.windows.net/invoiceervice/service1

    For security you can use the SBazTool form the samples to create ad manage the permissions for the clients and services on the service bus:

    http://code.msdn.microsoft.com/windowsazure/Authorization-SBAzTool-6fd76d93

    The same principals will work with the brokered messagng model if you want to use assynchronous messaging.

    Regards,

    Alan


    Free e-book: Windows Azure Service Bus Developer Guide.

    • Marked as answer by Anders V Monday, February 25, 2013 6:08 PM
    Monday, February 25, 2013 5:57 PM

All replies

  • Hi,

    The realy service is different to the brokered service (Queues, Topics & Subscriptions) model.

    When using the realy model you can create a different sub-name for wach service.

    e.g.:

    • mynamespace.servicebus.windows.net/service1
    • mynamespace.servicebus.windows.net/service2

    you can even do:

    • mynamespace.servicebus.windows.net/orderservice/service1
    • mynamespace.servicebus.windows.net/orderservice/service1
    • mynamespace.servicebus.windows.net/invoiceservice/service1
    • mynamespace.servicebus.windows.net/invoiceervice/service1

    For security you can use the SBazTool form the samples to create ad manage the permissions for the clients and services on the service bus:

    http://code.msdn.microsoft.com/windowsazure/Authorization-SBAzTool-6fd76d93

    The same principals will work with the brokered messagng model if you want to use assynchronous messaging.

    Regards,

    Alan


    Free e-book: Windows Azure Service Bus Developer Guide.

    • Marked as answer by Anders V Monday, February 25, 2013 6:08 PM
    Monday, February 25, 2013 5:57 PM
  • Hi Alan,

    Thank you for your reply.

    Could you please clarify the following, which is the recommended practice in a case of hundreds on-premise services of the same functionality?

    E.g. 100 identical servers exposing the GetCustomers method.

    Is the best practice:

    mynamespace01.servicebus.windows.net/GetCustomers

    mynamespace02.servicebus.windows.net/GetCustomers

    ...

    mynamespace100.servicebus.windows.net/GetCustomers

    Or is the best practice:

    mynamespace.servicebus.windows.net/GetCustomers01

    mynamespace.servicebus.windows.net/GetCustomers02

    ...

    mynamespace.servicebus.windows.net/GetCustomers100

    In the first case you create more namespaces but you can have the same code running on all servers,

    In the second case you need 1 namespace but different code per server and also a more complicated security handling (e.g. if you want to disable a server you'd have to process security per service name, e.g. disabling GetCustomers20 ?).

    Thank you in advance


    Sunday, March 10, 2013 1:25 PM