none
Request/response messaging pattern RRS feed

  • Question

  • All ,

    I have a doubt on the Request response pattern... Assume the following is my scenarion

    1. I have a service running on Windows Azure. This  service can be called by users to execute a command.
    2. I have a client applications that is running on my intranet. This client application will execute the command . The computer in which the client application is running is connected to internet , but does not have a static IP i.e machine cannot be accessed directly via the internet
    3. I am planning to use Azure Service Bus through which my service on Windows Azure can communicate with the client application to execute.... 

    In this scenario, can i use Request/response messaging i.e can the service post a message and expect a response from the client  

    OR

    Should i use command queue for each client , the Service will push the command to be executed on a queue , the client will poll the queue and execute a command

    Any help is appreciated

    Wednesday, April 30, 2014 5:04 PM

Answers

  • Hi Sabarish,

    from you description it is not clear whether you will have a single or multiple instances of your client application.

    Service Bus offers two solutions for your scenario.

    If you want to invoke the client application synchonously, use a Service Bus Relay. Each of your client applications would create a realy. The relay works with servers that use dynamically assigned IP addresses as long as the address remains the same while the client applicaiton is running. (Note that some ISPs change your IP address every 24h if you sign up for a non-business account.)

    If you want to invoke your client application asynchronously, use Service Bus queues. A single queue implements a one-way communication pattern. Each client applicaiton maintains a single request queue that the service send its request messages to. Alternatively, you can use a single response topic that has one subscription for each client. A client application needs to poll its request queue, or you can use the NetMessagingBinding, which does the polling for you in the background.

    To get the client application's response back to the service, you need a single response queue for the service. Each client would send its response messages to that response queue. The service would need to poll the response queue.

    Hope that helps, Ruppert

    Wednesday, April 30, 2014 7:29 PM
    Moderator

All replies

  • Hi Sabarish,

    from you description it is not clear whether you will have a single or multiple instances of your client application.

    Service Bus offers two solutions for your scenario.

    If you want to invoke the client application synchonously, use a Service Bus Relay. Each of your client applications would create a realy. The relay works with servers that use dynamically assigned IP addresses as long as the address remains the same while the client applicaiton is running. (Note that some ISPs change your IP address every 24h if you sign up for a non-business account.)

    If you want to invoke your client application asynchronously, use Service Bus queues. A single queue implements a one-way communication pattern. Each client applicaiton maintains a single request queue that the service send its request messages to. Alternatively, you can use a single response topic that has one subscription for each client. A client application needs to poll its request queue, or you can use the NetMessagingBinding, which does the polling for you in the background.

    To get the client application's response back to the service, you need a single response queue for the service. Each client would send its response messages to that response queue. The service would need to poll the response queue.

    Hope that helps, Ruppert

    Wednesday, April 30, 2014 7:29 PM
    Moderator
  • Thanks a lot  for clarifying my confusion
    Thursday, May 1, 2014 7:07 AM