locked
SendNotificationToTarget not working? RRS feed

  • Question

  • I tried the new SendNotificationToTarget (in a SelectiveSubscribe method) from the July CTP but the notifications aren't received by the notificationhandler.

     

    Code Snippet
        base.SendNotificationToTarget<Replace>(sub.Subscriber, _submgrPort, _state);

     

     

    If I change the line to SendNotification(without the subscriber), it will work, so the notificationhandler is set up right I guess.

     

    No errors in the console output, all subscriptions appear to be correct.

     

    Anything I need to do extra to make this work? I looked at the SendNotificationInternal class, but couldn't find anything wrong.

     

    Erik

    Tuesday, August 19, 2008 2:21 PM

Answers

  • Erik

    ServiceTutorial4 uses the exact same code snipit you have above and it works fine for me. I just compiled it and checked the ConsoleOutput service. If you run ServiceTutorial5 you will note that the Replace handler of ServiceTutorial5 responds to ServiceTutorial4's replace message by logging a "Tick Count" message. The code using SendNotificationToTarget is in ServiceTutorial4's subscription handler.

    Bryan

    BTW: I am running VS2008 SP1
    Tuesday, August 19, 2008 7:32 PM

All replies

  • Erik

    ServiceTutorial4 uses the exact same code snipit you have above and it works fine for me. I just compiled it and checked the ConsoleOutput service. If you run ServiceTutorial5 you will note that the Replace handler of ServiceTutorial5 responds to ServiceTutorial4's replace message by logging a "Tick Count" message. The code using SendNotificationToTarget is in ServiceTutorial4's subscription handler.

    Bryan

    BTW: I am running VS2008 SP1
    Tuesday, August 19, 2008 7:32 PM
  • Thanks, I tried that and it works. However in my code it doesn't, I use a SelectiveSubscribe with a custom subscription, so the problem must be there somewhere.

     

    Maybe I'll remove the selectivesubscribe and try the LINQ queries.

     

    Erik

     

    Update:

    Found the problem, for the SelectiveSubscribe, there is a notify array in the subscribe, this same array needs to be passed to the SendNotificationToTarget

     

    Code Snippet
    string[] notify = { "240" };
    base.SendNotificationToTarget<Replace>(subscribeRequest.Body.Subscriber, _submgrPort, _state, notify);

     

     

                     

    Wednesday, August 20, 2008 8:34 AM