MSDN > フォーラム ホーム > AppFabric > SubscribeToRouter principle question and MaxBufferLength note
質問する質問する
 

質問SubscribeToRouter principle question and MaxBufferLength note

  • 2009年6月27日 17:04Ben - ECM ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    Hi,

    If one creates two routers, and router2 subscribes to router1, when one adds a service endpoint to receive router2's messages, I see from the samples, that one has to use the method overload with both the host and the endpoint address, and that the endpoint address needs to be router1's address.

    In the simpler scenario of subscribing to a router that is not subscribing to another router, one does not need use the method overload that includes the routers address, which does seem to make sense as the RouterClient object that the method is on knowns its address.

    Is this just a limitation / 'feature' of the current ctp or is it something which needs a little clarity to explain the reasoning.

    What if one had say three routers, would one have to specify the first router or the previous router, would one know the address of anything but the previous router?

    I have noticed additionally as a bit of feedback that if one sets the MaxBufferLength to a positive integer, this sample does not forward the messages to the listening endpont.

    I know it is still CTP hope this feedback would be helpful. Other parts look good so far.

     

すべての返信

  • 2009年6月29日 7:30Yi-Lun LuoMSFT, モデレータユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    Hello, can you be more specific? I don't quite get your point. But I'm guessing you're referring to RouterClient.AddRouterServiceEndpoint, right?

    Well, first you need to understand how WCF endpoint works. When you create a ServiceHost and add an endpoint, by default, the service endpoint listens incoming messages from the address you specified in the endpoint's address property. However, you can specify a different address in the ListenUri property, so the endpoint will listen from the ListenUri. In this case, the clients will send messages to the ListenUri (the router), but the WS-Addressing To header still contains the URI specified in the address property, so the router knows where to forward the message.

    In the Service Bus Router case, in the simple scenario with only one router, the message is sent to the router, where it is processed, so there's no need for an extra address. However, if you have two routers, the message is always sent to the first router. The publish client has no knowledge of the second router. The first router needs to forward the message to the second router, where the message is processed. If you don't specify the first router's URI as the ListenUri of the second router, the second router will assume the message is sent to its own address, which is not the case. If you have 3 routers, for Router3, you can either specify the ListenUri to Router1, in which case Router1 will forward the message to Router3 directly. Or you can specify the ListenUri to Router2, in which case Router1 will forward the message to Router2, and then to Router3.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
  • 2009年7月4日 13:26Ben - ECM ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi Yi-Lun,  thanks for your explanation.  Your guess was right, I was refering to RouterClient.AddRouterServiceEndpoint. I'll have to give this a try, to see it working.

    Any ideas on why setting MaxBufferLength to a positive integer on a router that subscribes to another router would prevent the a client of the second router receiving mesages?

    Just adding in this line stops the apparent flow of messages to the client of the router.

    privateRouterPolicy.MaxBufferLength = 50;

    (March 2009 CTP)