Problems With Sending Event Notifications To Remote Service
May 10, 2006
Hi!
Just set up my first Service Broker test. Wanted to send an Event Notification from one instance to another. Finally, the message arrives but profiler shows that the message is still being continously resent (and rejected as being duplicate). What am I doing wrong?
With best regards,
Artus
--
/* Local Event Source.sql */
USE master
GO
CREATE DATABASE NotificationDB
GO
ALTER DATABASE NotificationDB SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
GO
CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP
(
LISTENER_PORT = 5554
)
FOR SERVICE_BROKER
(
AUTHENTICATION = WINDOWS,
ENCRYPTION = DISABLED
)
GO
USE NotificationDB
GO
CREATE EVENT NOTIFICATION TestEN
ON DATABASE
FOR CREATE_TABLE
TO SERVICE 'ExpressService', 'AFEDD339-AD3D-4865-AF3C-299B0A0784C6'
GO
CREATE ROUTE ExpressRoute
WITH SERVICE_NAME = 'ExpressService' ,
BROKER_INSTANCE = 'AFEDD339-AD3D-4865-AF3C-299B0A0784C6',
ADDRESS = 'TCP://localhost:5555'
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Pa$$w0rd';
GO
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;
GO
USE master
GO
SELECT service_broker_guid FROM sys.databases WHERE database_id = DB_ID()
GO
/* Remote Service.sql */
USE master
GO
CREATE DATABASE Test
GO
ALTER DATABASE Test SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
GO
CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP
(
LISTENER_PORT = 5555
)
FOR SERVICE_BROKER
(
AUTHENTICATION = WINDOWS,
ENCRYPTION = DISABLED
)
GO
USE Test
GO
CREATE QUEUE ExpressQueue
WITH STATUS = ON
GO
CREATE SERVICE ExpressService
ON QUEUE ExpressQueue
(
[http://schemas.microsoft.com/SQL/Notifications/PostEventNotification]
);
GO
GRANT SEND ON SERVICE::ExpressService
TO [public]
GO
CREATE ROUTE ExpressServiceRoute
WITH SERVICE_NAME = 'ExpressService',
BROKER_INSTANCE = 'AFEDD339-AD3D-4865-AF3C-299B0A0784C6',
ADDRESS = 'LOCAL'
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Pa$$w0rd';
GO
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;
GO
SELECT service_broker_guid FROM sys.databases WHERE database_id = DB_ID()
GO
SELECT * FROM sys.endpoints
GO
View 3 Replies
ADVERTISEMENT
Feb 16, 2008
Hello, I receive this error "The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications." I attach the database in Management Studio to query and enable the broker using the scrip below but to no avail. ALTER DATABASE DataName SET ENABLE_BROKER ‘''<<------successfulandSELECT is_broker_enabled FROM sys.databases WHERE name = 'Database name' ‘'''<<-------value is 1 Global.asax ... Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) System.Data.SqlClient.SqlDependency.Start(ConfigurationManager.ConnectionStrings("dataConnectionString1").ConnectionString) End Sub...Web.config ... <connectionStrings> <add name="dataConnectionString1" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|jbp_data.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> <add name="ASPNETDBConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>... Hope you could help. cheers,imperialx
View 1 Replies
View Related
Sep 4, 2001
HI,
Does any one know how I could send all the alerts, email notifications from the SQL Server to my Sprint PCS Phone. Is there any software for that. I know that it can be done by MSN mobile. Just checking whether it can be directly sent to my phone rather than going to hotmail which is then forwared to my cell phone. Let me know.
Thanks,
Cinday
View 1 Replies
View Related
Apr 19, 2006
Hi.
I'm developing an app that uses Service Broker queues to allow a customer to create "events" that fire using a timer or a query notification. When these events fire, a message is sent to a Service Broker queue for processing. Because there is much managed code involved in processing these messages, I decided to use the External Activator application and an Event Notification to process these messages. My question is "what is the difference between using the External Activator application to launch another application (which simply RECEIVEs a message from the target queue and processes it) and creating a windows service that simply monitors the target queue (with a WAITFOR = -1 clause) and processes it?"
I guess I'm not sure how using the QUEUE_ACTIVATION Event Notification is really helping me.
Thanks,
Chris
View 4 Replies
View Related
Sep 19, 2007
This is on sql server 2005: I created an agent job and I want to be able to notify people by email when it completes and when it fails. I first wanted to test the notification for when it completes. I created an operator and entered the E-mail name. In the job properties, I selected this operator in the Notifications page.
The job runs an ETL process. When I run the job, after it completes,
the email is not sent. This seems straight-forward. The email address is valid, I tested the email address and it does get sent when I do it from Outlook 2007.
Anyone have this problem?
View 7 Replies
View Related
Sep 30, 2005
hi. can't seem to find the event notifications in the service broker folder of Management Studio.. I can get the information from sys.event_notifications, but it seems odd that event notifications are not in the UI. Hopefully I'm looking in the wrong place?
View 1 Replies
View Related
Nov 28, 2014
I created a Blocking Event Notification following this article ->[URL=
How do I throttle the alerts so that I only receive one alert per hour instead of 1000?
View 0 Replies
View Related
Feb 20, 2008
I'm looking for a sanity check. Service broker and Event Notifications are new to me, so it is possible I'm either abusing or incorrectly using the technology. I'm experimenting with using Event Notifications and Server Broker to log error messages. The process works pretty well as long as I don't do something stupid such as stressing the process by calling raiserror in a loop of a 100000 - twice. It processed for a while, but eventual either SQL Server terminates (sev 25) or I had to force the SQL service to stop by killing it's process via task manager. I could not connect to SQL Server or stop the service normally.
I have several general questions. I think they are good questions. Any thoughts or suggestions would be appreciated.
1) I'm looking into generating deadlock and blocking email alerts. It appears that Event Notification is the way to go since there are very few events and I can respond to the event with an email. Is there a better method to automate blocking and deadlock email alerts that include event details?
2) If I wanted to retain some history of errors for the developers, should Event Notifications be avoided if a high number of errors can be generated by a badly formed T-SQL? Avoid TRC_ERRORS_AND_WARNINGS and USER_ERROR_MESSAGE? (I could tell the developers not to be stupid, but why would that stop them if it does not stop me?)
3) Is there a way to efficiently filter a Event Notification from entering the queue before the Receive statement is called? I get some events that I throw away after receiving them. For example, perhaps I want all events from all non-system databases without having to add a notification for each single non-system database. Or I want all errors with severity 11-17 only?
4) Is there a trick to filter out events from the procedure activated by the event. I tried using raiserror to debug a procedure without thinking. The result was that the queue never was empty because the processing produced more events to process. As a result, I don't use raiserror and use a try-catch to avoid raising errors in the procedure activated.
5) I can receive one message at a time using local variables or receive a batch of messages using a local table. Is a small batch the best way even if there is memory pressure?
6) In the activated procedure I continue processing in a loop until there are no more messages. This seems to be the most efficient. Is this always the case? Should I exit the procedure after a set number (large) of messages have been received? The procedure would activate again to continue processing?
7) Is there any point to using the MAX_QUEUE_READERS setting when processing event notifications? Should it be 1?
8) I currently get the next conversation group id and process its messages within a transaction. Is this a bad idea with event notifications? Should I just call Receive and get the next batch? I don't really care if I lose some messages if things are going badly. Should I avoid wrapping the receive in a transaction?
9) I could run a trace that starts with SQL Server; however, I think my only choice is to log to a file. Is there a way to trace to a table using SQLTrace without running profiler? I would like to automate the process and have the data in a table so that it can be easily queried and parsed for each database/team.
10) Is there a way to fix my process and handle 100000 messages a minute? Is there a way to skip messages when it gets to busy? Can the query generating the messages get throttled - perhaps along with the query designer - before the server gets into trouble? Query the memory used by a queue and drop/create the queue with a delay if there is an issue?
I'm using a single CPU test machine with only 1 GB and 2 GB pagefile and a single disk. OS: Windows 2003 R2 SP2. SQL: 9.0.3054 and on 9.0.3228 (update package 6 just came out today). I could add memory, but I think that would just permit me to queue more message before running into trouble.
I'll add code shortly - length limit.
View 18 Replies
View Related
Nov 1, 2015
We have (running SQL 2012 Std) and have enabled trace flag 1204 and 1222 for capturing deadlock through extended events. I have enabled deadlock notification through email .But it only send deadlock event occurred notification from the sql server error log . I was wondering if its possible to email the deadlock details they get generated in extended events via DB mail.
View 1 Replies
View Related
Oct 23, 2006
I have an activated SP that is issuing PRINT statements.
These are raised as ErrorLog and EventLog events when using SQLProfiler
However if you attach an event notification for ERRORLOG and EVENTLOG, nothing appears in the queue. Any other ERRORLOG or EVENTLOG event caught by profiler is caught by the event notification as expected.
View 2 Replies
View Related
Jan 21, 2008
Hello, I have a table in SQL Server that is used to track appointments. Is
there some way to take this data and send an email to user with the
appointment, when the user clicks on the email it would create the event in
the user or public calendar.
Thanks
View 3 Replies
View Related
Apr 19, 2007
Hi,
I need a help from you all on Sending Email on some specific event from SQL SERVER 2005. Any Idea how Do I proceed?
Any help will be appreciated.....
Thanks,
Rahul Jha
View 2 Replies
View Related
Sep 11, 2006
Hey , I encountered a problem using SqlDependency and notification services.
I€™ve created a database with tools from c# Express 2005 and attached it to the sql server express 2005. And it turned out that €˜dependency_OnChange€™ in my application is triggered each time I execute the command.ExecuteReader(); and it shouldn€™t, because the command is just the select statement of columns and rows for which I wait to be modified.
SqlDependency dependency = new SqlDependency(command);
dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
command.ExecuteReader();//when the program gets here dependency_OnChange is called
So I Used the example from here :
http://msdn2.microsoft.com/en-us/library/a52dhwx7.aspx
and with AdventureWorks it behaves as it should , but when I change the connection string and select statement in the example to work with MyDatabase, the problem appears again.
So there is something wrong with MyDatabase ?
The select statement I used was €œselect Name, Pass from Users where Name like €˜L%€™€?;
So theoretically this should work but it does not and I end up in an infinite loop with
dependency_OnChange called cyclically €¦
I€™d be grateful for any advice !
View 1 Replies
View Related
Apr 13, 2006
Hi everybody
Error [364] The Messenger service has not been started - NetSend notifications wi
I am having this error from agent. Does anybody have any idea what this error means or is it sevear or not?
Thank you
asa.:)
View 3 Replies
View Related
Sep 15, 1998
I have a query I`d like to run using the isql command utility. The query works correctly and the output can be sent to a local file with no problem. When I try to designate a network location as an output file (e.g. abcdefgfile.txt), though, I get an error message "No such file or directory."
Is it possible to send SQL output to a remote location?
TIA!
View 1 Replies
View Related
Jul 5, 2007
I was wondering if there are any potential issues/drawbacks of a service sending a message to itself. Basically I have a situation where I only require one queue to hold messages. So say for instance I had a service named S1 associated with a queue named Q1 then I can do this:
Code Snippet
Begin conversation dialog @dialog_handle
from S1
to 'S1'
on contract MyContract
with encryption = off;
Send on conversation @dialog_handle
message type MyMessage
This works as expected. Any thoughts?
View 2 Replies
View Related
Jan 29, 2008
I've got a situation where I want to put request message on a queue. Because starting a conversation is the only way to put messages on a queue I have to start a conversation with myself. So my Begin Dialog Statement looks something like this:
DECLARE @conversation_handle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @conversation_handle
FROM SERVICE [ServiceName1]
TO SERVICE 'ServiceName1'
ON CONTRACT [ContractName1]
WITH ENCRYPTION = OFF;
SELECT @conversation_handle AS ConversationHandle
I haven't noticed any problems with doing this but I wanted to know if there was anything wrong with it. Does someone know what problems this might cause?
View 4 Replies
View Related
Feb 25, 1999
HI, I got this message " The application log is full " at the desktop window of NT server... I went to the event viewer and there was 5 lines only, I did not get the idea, what seems to be the problem
Please advice
regards
Ali
View 1 Replies
View Related
Jan 19, 2007
Hi,
I have implemented a WMI Event Watcher in my SSIS package which polls a directory at 5 second intervals for the presence of files.
I have noticed that at times this file watcher service doesn't seem to function. Yet if I stop and start the package it usually works again.
Everything is running locally, including the polled folder.
Has anyone experienced similiar issues, or may know the cause/fix of this problem?
Thanks.
View 3 Replies
View Related
Aug 9, 2007
Hi,
Is there anyway to response when RS generated report? I need to do extra works such as encryption once report generated, before deliver to customer.
Thank you
View 2 Replies
View Related
May 1, 2015
I have a remote server where I dont have RDP access.
I opened Powershell and wrote the below query to read some of the message, but getting error:-
Clear-Host
$Machine = "XXXXX"
#Get-Eventlog -Logname System -ComputerName $Machine -newest 1000 | Where-Object {$_.EventID -lt '100'} |
Error Message:
[XXXXX] Connecting to remote server XXXXX failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet.
+ CategoryInfo : OpenError: (XXXXX:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken
How to read the data (app/system eventviewerlog) using xp_cmdshell from SQL Server Mgmt studio itself?
View 2 Replies
View Related
May 1, 2007
Hello,
I have been trying to drill down to the cause for this event log message:
"The configuration of the AdminConnectionTCP protocol in the SQL instance
SQLEXPRESS is not valid."
It is reported from the SQLBrowser service as a warning when the service
starts. I have tried starting SQLBrowser.exe with -c flag, but the output reveals no
errors. I have seen this error on three computers. Two are running SQL 2000, 2005
and Express. One was only running Express, but still this message.
I then looked into the log for the SQL Express server itself. It shows this
message on startup:
"Dedicated administrator connection support was not started because it is
not available on this edition of SQL Server. This is an informational message
only. No user action is required."
Now, it appears to me that these two messages may relate to the same
"error" (or rather behaviour by design). So, can anyone confirm that the
warning in the event log from the SQL Browser service occurs becuase of that
the SQL Express edition doesn't allow any "AdminConnection", but the SQL
Browser service isn't aware of that SQL Express edition shouldn't support that, and
reports it as a warning (implying that we can't do much about this warning)?
Thanks for any input on this issue!
View 5 Replies
View Related
Feb 8, 2007
Hello,
I am getting this error with a web service trying to fill a strongly-typed dataset stored in another project that the web service has connection to. I keep getting this error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I set it to allow TCP/IP only, TCP/IP and Named Pipes, and Named Pipes only remote connections allowed. But it still doesn't work. I don't understand what the problem may be. I stopped and started the database engine service every time (this is a SQL Express database attached to the server, by the way).
Any insight would be helpful, Thanks.
View 2 Replies
View Related
Mar 17, 2008
Hello,
I have troublesome problem with service broker. I move a lot of databases
from one server to another servers (by backup and restore) but always have problem with
databases where service broker is enabled. Bellow is my scenario:
1. backup database db1 (srv1)
2. restore db1 (srv2, srv3, srv4.....)
3. drop manually Services and Queues, only green filed
(http://img122.imageshack.us/img122/549/clipqk5.jpg) (srv2, srv3, srv4.....)
4. alter database db1 set enable_broker (srv2, srv3, srv4.....)
After that SQL Server log on each server is full bellow errors, nobody so
far can help me
Could you help, please
############
SRV2
03/03/2008 18:54:41,spid21s,Unknown,The query notification dialog on
conversation handle '{E6BF547B-0AE6-DC11-A4BD-00E08127B819}.' closed due to
the following error: '<?xml version="1.0"?><Error
xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service
'SqlQueryNotificationService-53c1dc9b-7d22-4310-a5b6-18ac97ae4bf3'
because it does not exist.</Description></Error>'.
03/03/2008 18:54:41,spid27s,Unknown,The query notification dialog on
conversation handle '{AA68F7D8-F7E5-DC11-A4BD-00E08127B819}.' closed due to
the following error: '<?xml version="1.0"?><Error
xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service
SERV3
03/02/2008 00:32:25,spid21s,Unknown,The query notification dialog on
conversation handle '{2BC70B27-F1E3-DC11-AB50-0017085CAA29}.' closed due to
the following error: '<?xml version="1.0"?><Error
xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service
'SqlQueryNotificationService-abc6a7ce-53f1-411e-85a7-50c09e2699e1'
because it does not exist.</Description></Error>'.
03/02/2008 00:29:20,spid22s,Unknown,The query notification dialog on
conversation handle '{DF112861-F9E3-DC11-AB50-0017085CAA29}.' closed due to
the following error: '<?xml version="1.0"?><Error
xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service
SRV4
03/02/2008 16:15:07,spid25s,Unknown,The query notification dialog on
conversation handle '{4179E578-7DE4-DC11-9A69-00145E1B71FC}.' closed due to
the following error: '<?xml version="1.0"?><Error
xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service
'SqlQueryNotificationService-01e16746-e114-4e8c-b587-91e93768a9a8'
because it does not exist.</Description></Error>'.
03/02/2008 16:15:07,spid20s,Unknown,The query notification dialog on
conversation handle '{5079E578-7DE4-DC11-9A69-00145E1B71FC}.' closed due to
the following error: '<?xml version="1.0"?><Error
xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service
############
View 8 Replies
View Related
May 30, 2006
Is anyone executing SSIS packages using a web service similar to the example in http://msdn2.microsoft.com/en-us/ms403355(SQL.90).aspx
From what I've read, there is a new HTTP server embeded in SQL Server (so we don't have to have IIS) that this could be done from??
View 2 Replies
View Related
Jun 14, 2007
I have SQL Server 2005 express installed on my machine, and I was wondering if there is any way to have an asp.net 2.0 web service hosted by a different company be able to send sql commands to the sql server on my machine.
View 3 Replies
View Related
Feb 14, 2006
I was trying to send a message on a different instance in the network using service broker. I have created the endpoint and route both the side. I could see that the messages are in the transmission_queue in the sender side with no error in the status.
What could be the reason.
I am doing the following:
CREATE ROUTE inst02
WITH
SERVICE_NAME = 'SERVICE2',
ADDRESS = 'tcp://10.14.43.149:2341'
in the send script i am using this:
BEGIN DIALOG CONVERSATION @dialog_handle
FROM SERVICE [SERVICE1]
TO SERVICE 'SERVICE2'
ON CONTRACT [MainContract] WITH ENCRYPTION = OFF ;
in the sending side if i change the endpoint's authentication as windows kerberos , then i get thefollowing error in the transmission queue:
"Connection handshake failed. An OS call failed: (8009030e) 0x8009030e(No credentials are available in the security package). State 66."
I also have given access to the remote user on this endpoint(on the recever side) using this :
GRANT CONNECT ON ENDPOINT::Endpoint_test to paras
I am executing the sending side send script using the same user wich has access to the remote endpoint.
Can some one resolve this issue.
Thanks
View 9 Replies
View Related
Mar 22, 2007
Hi
I have recently upgraded several of our SQL2005 servers to SP2a :) version 9.0.3050
and find that I can no longer script the Service Broker objects from a remote connection. The error I am getting is:
Script failed for MessageType 'MyMessageType' (Microsoft.SqlServer.Smo)
Additional Information
Either the object or one of its properties is not supported on the target server version
(Microsoft.SqlServer.Smo)
Now I know that this worked pre SP2 using exactly the same setup. Has anyone else experienced this or know how to fix it?
View 1 Replies
View Related
Jun 2, 2015
Recently we migrated our environment to 2012.
We are planning to implement Xevents in all the servers in place of Trace files and everything is working fine.
Is it possible to configure Extended event to trigger a mail whenever any event (example dead lock) occurs.
I have gone through so many websites but i never find.
View 13 Replies
View Related
Oct 22, 2015
I need to be able to restart an application service after the SQL Cluster fails over. how to accomplish this as a SQL job?
View 1 Replies
View Related
Aug 9, 2015
AlwaysOn open service 'remote registry failed' while validate the cluster.
View 4 Replies
View Related
Mar 2, 2007
If I have an asp page with a button, what are the means or methods to trigger the event to process a report, save into a report and store in a file server or any directory? All these is done backend without the need to display to the browser.
Using RS Web services or Delivery extension programming things like that?
Regards
Alu
View 3 Replies
View Related
Mar 1, 2006
Hi,
I am replicating a couple of SQL2K databases via transactional rep and remote 2K distributor to 1 SQL2K5 database.
I want the distributor to email me when/if any of the agents fail etc. In order to set this up, I think that I need the SQL Server service to use a domain account (from error messages that I have been getting). It is currently using a local system account (it was a test box in a previous life).
I have tried this briefly, and found that it lost the publisher details in the replication monitor. Can anyone tell me what the implications for changing the SQL server service user and password are? Am I going to have to tear down and rebuild replication? The SQL Server Agent is fine - I am trying to get the two services in sync.
View 4 Replies
View Related