Showing posts with label notification. Show all posts
Showing posts with label notification. Show all posts

Friday, March 23, 2012

Scheduled subscriptions don't work (but Event-driven ones do) for NS Newsletter sample

Hello,

I am using the Newsletter sample bundled with Notification Services (using SQL 2005 SP1)

When I create Scheduled subscriptions using the 'SubscriptionManagementWeb' app that ships with the sample, then copy an Events.xml file to the watch folder, I never get an alert (i.e. I set the time to now + 5 minutes, wait, never receive).

When I create an Event-driven subscription, on the other hand, and copy an Events.xml file to the watch folder, I do successfully get a notification.

I also created my own separate NS application, and it has the same problem as the sample. Event-driven subscriptions work, but Scheduled ones do not.

Any ideas?

TIA,

Alex

Hi I don't know if you have checked this in the books online but it has somethig to do with schedulled subscriptions:

Time Zone-Specific Scheduled Subscriptions

Notification Services supports scheduled subscriptions. Because a notification application can support subscribers in any time zone, it is important that Notification Services store information about the time zone for timely notification delivery.

To make multiple time zone support easier, Notification Services stores date and time information using Coordinated Universal Time (UTC) notation.

When a subscriber creates a scheduled subscription, the subscriber enters the time zone (or the time zone is obtained from other sources, such as a database or operating system setting) and the desired delivery time. When Notification Services stores the delivery time, it uses the time zone to compute the UTC time for delivery and then stores the UTC time. When the UTC time arrives, Notification Services generates notifications from any current events and then formats and distributes the notifications.

|||

Interesting. Well I am UTC - 8 hrs (same as GMT - 8 hrs except for rare circumstances). I launched the "SubscriptionManagementWeb" web application that comes with the Newsletter sample in debug mode, and saw that it was saving a subscription with:

Schedule start: "TZID=4:20070131T025500"

Schedule recurrence: "FREQ=WEEKLY;BYDAY=WE"

Even if the time zone were off, it should be triggered on a weekly basis. I've submitted test newsletters that match the scheduled subscription over a span of two weeks, never received a notification.

To test the UTC theory out, I set the schedule start to Now + 9 hours (since UTC is 8 hours ahead of my time zone). This way, I should expect to get the event in Now + 1 hour.

Result: didn't get the event, when I copied the event.xml file to the drop location. So I don't think it's time zone based.

Any other suggestions? Don't see any errors in the event log; don't see anything useful from running the Diagnostics sp's that it generated.

|||Hi Alex -

When working with scheduled subscriptions, I usually find that the problems can generally be found in one of four areas.

1) A scheduled subscription either does not exist or is incorrectly configured. You'd be surprised at how often this is the problem.

2) The scheduled subscription doesn't actually match an event that is coming in.

3) There is a problem in the matching rule so no rows are ever produced.

4) Notifications are created in the notifications table, but cannot be delivered due to a problem in the delivery protocol (incorrect permissions, etc).

You may want to look into the underlying tables and views to see if you can gain some more insight into why you're not seeing the final notification. Also change the logging level to verbose and check the Application event log.

HTH...

Joe

Wednesday, March 21, 2012

Scheduled subscriptions don't work (but Event-driven ones do) for NS Newsletter sample

Hello,

I am using the Newsletter sample bundled with Notification Services (using SQL 2005 SP1)

When I create Scheduled subscriptions using the 'SubscriptionManagementWeb' app that ships with the sample, then copy an Events.xml file to the watch folder, I never get an alert (i.e. I set the time to now + 5 minutes, wait, never receive).

When I create an Event-driven subscription, on the other hand, and copy an Events.xml file to the watch folder, I do successfully get a notification.

I also created my own separate NS application, and it has the same problem as the sample. Event-driven subscriptions work, but Scheduled ones do not.

Any ideas?

TIA,

Alex

Hi I don't know if you have checked this in the books online but it has somethig to do with schedulled subscriptions:

Time Zone-Specific Scheduled Subscriptions

Notification Services supports scheduled subscriptions. Because a notification application can support subscribers in any time zone, it is important that Notification Services store information about the time zone for timely notification delivery.

To make multiple time zone support easier, Notification Services stores date and time information using Coordinated Universal Time (UTC) notation.

When a subscriber creates a scheduled subscription, the subscriber enters the time zone (or the time zone is obtained from other sources, such as a database or operating system setting) and the desired delivery time. When Notification Services stores the delivery time, it uses the time zone to compute the UTC time for delivery and then stores the UTC time. When the UTC time arrives, Notification Services generates notifications from any current events and then formats and distributes the notifications.

|||

Interesting. Well I am UTC - 8 hrs (same as GMT - 8 hrs except for rare circumstances). I launched the "SubscriptionManagementWeb" web application that comes with the Newsletter sample in debug mode, and saw that it was saving a subscription with:

Schedule start: "TZID=4:20070131T025500"

Schedule recurrence: "FREQ=WEEKLY;BYDAY=WE"

Even if the time zone were off, it should be triggered on a weekly basis. I've submitted test newsletters that match the scheduled subscription over a span of two weeks, never received a notification.

To test the UTC theory out, I set the schedule start to Now + 9 hours (since UTC is 8 hours ahead of my time zone). This way, I should expect to get the event in Now + 1 hour.

Result: didn't get the event, when I copied the event.xml file to the drop location. So I don't think it's time zone based.

Any other suggestions? Don't see any errors in the event log; don't see anything useful from running the Diagnostics sp's that it generated.

|||Hi Alex -

When working with scheduled subscriptions, I usually find that the problems can generally be found in one of four areas.

1) A scheduled subscription either does not exist or is incorrectly configured. You'd be surprised at how often this is the problem.

2) The scheduled subscription doesn't actually match an event that is coming in.

3) There is a problem in the matching rule so no rows are ever produced.

4) Notifications are created in the notifications table, but cannot be delivered due to a problem in the delivery protocol (incorrect permissions, etc).

You may want to look into the underlying tables and views to see if you can gain some more insight into why you're not seeing the final notification. Also change the logging level to verbose and check the Application event log.

HTH...

Joe

Scheduled Notifications

Hi , I'm having one code for Scheduled Notification services, it's running without errors but there is no output

<SubscriptionClasses>
<SubscriptionClass>
<SubscriptionClassName>ScheduledSubscriptions</SubscriptionClassName>
<Schema>
<Field>
<FieldName>DeviceName</FieldName>
<FieldType>nvarchar(255)</FieldType>
</Field>
<Field>
<FieldName>SubscriberLocale</FieldName>
<FieldType>nvarchar(5)</FieldType>
</Field>
<Field>
<FieldName>Prescriptionid</FieldName>
<FieldType>int</FieldType>
</Field>
<Field>
<FieldName>status</FieldName>
<FieldType>nvarchar(50)</FieldType>
</Field>
</Schema>
<FileGroup>DEFAULT</FileGroup>
<ScheduledRules>
<ScheduledRule>
<RuleName>ScheduledSubscriptionsRule</RuleName>
<Action>

INSERT INTO SchedPrescriptionNotifications
( SubscriberId,DeviceName,SubscriberLocale,Prescriptionid,status )
SELECT S.SubscriberId, S.DeviceName,
S.SubscriberLocale, C.Prescriptionid, C.status
FROM SchedPrescriptionSubscriptions S , ScheduledEventsChron C
WHERE C.Prescriptionid= S.Prescriptionid
AND C.status = S.status


INSERT SchedSubscriptionChron
(SubscriberId, Prescriptionid, status)
SELECT S.SubscriberId, S.Prescriptionid, C.status
FROM SchedPrescriptionSubscriptions S JOIN ScheduledEventsChron C
ON S.Prescriptionid= C.Prescriptionid
</Action>
<ActionTimeout>PT30M</ActionTimeout>
</ScheduledRule>
</ScheduledRules>
</SubscriptionClass>
</SubscriptionClasses>
and

my C#.net coding is

if (nsSubscription.HasTimedRule)

{

nsSubscription.ScheduleRecurrence = "FREQ=DAILY;";

nsSubscription.ScheduleStart="20070326T072720";

}

i need to know whther the format of Schedulestart property is correct...


Hi , I'm having one code for Scheduled Notification services, it's running without errors but i don't get any output

<SubscriptionClasses>
<SubscriptionClass>
<SubscriptionClassName>ScheduledSubscriptions</SubscriptionClassName>
<Schema>
<Field>
<FieldName>DeviceName</FieldName>
<FieldType>nvarchar(255)</FieldType>
</Field>
<Field>
<FieldName>SubscriberLocale</FieldName>
<FieldType>nvarchar(5)</FieldType>
</Field>
<Field>
<FieldName>Prescriptionid</FieldName>
<FieldType>int</FieldType>
</Field>
<Field>
<FieldName>status</FieldName>
<FieldType>nvarchar(50)</FieldType>
</Field>
</Schema>
<FileGroup>DEFAULT</FileGroup>
<ScheduledRules>
<ScheduledRule>
<RuleName>ScheduledSubscriptionsRule</RuleName>
<Action>

INSERT INTO SchedPrescriptionNotifications
( SubscriberId,DeviceName,SubscriberLocale,Prescriptionid,status )
SELECT S.SubscriberId, S.DeviceName,
S.SubscriberLocale, C.Prescriptionid, C.status
FROM SchedPrescriptionSubscriptions S , ScheduledEventsChron C
WHERE C.Prescriptionid= S.Prescriptionid
AND C.status = S.status


INSERT SchedSubscriptionChron
(SubscriberId, Prescriptionid, status)
SELECT S.SubscriberId, S.Prescriptionid, C.status
FROM SchedPrescriptionSubscriptions S JOIN ScheduledEventsChron C
ON S.Prescriptionid= C.Prescriptionid
</Action>
<ActionTimeout>PT30M</ActionTimeout>
</ScheduledRule>
</ScheduledRules>
</SubscriptionClass>
</SubscriptionClasses>
and

my C#.net coding is

if (nsSubscription.HasTimedRule)

{

nsSubscription.ScheduleRecurrence = "FREQ=DAILY;";

nsSubscription.ScheduleStart="20070326T072720";

}

i need to know whther the format of ScheduleStart property is correct...


|||Hi Subathra -

Here's a link that may help. Look at the timezone component.

http://msdn2.microsoft.com/en-us/library/ms171385.aspx

I'm not sure I follow the match rule logic so I cannot comment on that part. You can do more investigation by looking into the underlying tables to see if notifications were actually produced but just not delivered.

HTH...

Joe

Tuesday, March 20, 2012

Scheduled Jobs & Failed Notifications

Periodically on jobs scheduled in the SQL Server Management, a scheduled job will execute successfully, but fail to email the notification to the operator that the job completed successfully.....anyone have any thoughts as to the cause
I welcome any input ! :)Make sure your windows application log is not full, if it is, you will not
get notified.
--
Ray Higdon MCSE, MCDBA, CCNA
--
"David Moe" <dmoe@.coorstek.com> wrote in message
news:BCDD08D7-A9D6-4717-93D0-100DBBF38C98@.microsoft.com...
> Periodically on jobs scheduled in the SQL Server Management, a scheduled
job will execute successfully, but fail to email the notification to the
operator that the job completed successfully.....anyone have any thoughts
as to the cause ?
> I welcome any input ! :)|||if you never get email notification work, that means
maybe you havn't configure the sql mail utility.
>--Original Message--
>Periodically on jobs scheduled in the SQL Server
Management, a scheduled job will execute successfully,
but fail to email the notification to the operator that
the job completed successfully.....anyone have any
thoughts as to the cause ?
>I welcome any input ! :)
>.
>|||This thread is on a server which has other working alerts, typically including the one that failed
All other alerts executed with no problems...just this one fails periodically....haven't been able to coorelate any problems with server or database(s) on said server
It simply states in both the job history and the application event log that the notification failed. (Event log is set to overwrite
This same operator is used in all of the alerts coming from this particular server
-- David Moe wrote: --
Periodically on jobs scheduled in the SQL Server Management, a scheduled job will execute successfully, but fail to email the notification to the operator that the job completed successfully.....anyone have any thoughts as to the cause
I welcome any input ! :)