x

Service Broker Message Not Sending When Networ Cable unplugged

Hi,

I am trying to send message to the same instance in my local machine. It is working perfectly when the network is connected. But if i unplug the network cable, or disconnect the connection, the message not sending and hence the conversation handle is not retrieving. I wonder when i am using my local machine's database instance and logged in as "sa" user, why the Send Conversation is not working. Please put some light on this issue as i didnt see any useful posts anywhere.

Please find my code i am using..

BEGIN DIALOG @SBDialog
FROM SERVICE CreatePackageResponseService
TO SERVICE 'CreatePackageTargetService'
ON CONTRACT CreatePackageContract
WITH ENCRYPTION = OFF  

-- Send messages on Dialog  
SET @Message = newid();
SEND ON CONVERSATION @SBDialog 
MESSAGE TYPE CreatePackageCreateMessage (@Message)
more ▼

asked Jul 13 '12 at 05:06 PM in Default

paps gravatar image

paps
20 4 4 4

if you get some sort of error message then please provide that information in your question too
Jul 15 '12 at 02:06 PM Fatherjack ♦♦
Remus Rusanu wrote the service broker code and has a good blog..start with this post http://rusanu.com/2006/04/06/fire-and-forget-good-for-the-military-but-not-for-service-broker-conversations/
Jul 15 '12 at 05:56 PM Scot Hauder
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
Have you specified 'LOCAL' as the network address when defining your route? If you have provided an actual address, the message is being routed through your NIC.
more ▼

answered Dec 20 '12 at 08:26 PM

JakeE gravatar image

JakeE
0

(comments are locked)
10|1200 characters needed characters left

Hi Jakee,

Thanks for the reply..As you can see i have raised my doubt around 4 months back. I have rectified the issue by applying below solution. Please find below my analysis result and solution, which may help some techies who is fighting to find a solution for same issue.

Reason: Even though the database server is in the local machine, the owner of the DB is a network user as we use windows authentication for logging in to the management studio (Eg: Domain\Username) . So, the queues , messages and services created are owned by this user. So when the network cable is unplugged, Initiator Service is not able to resolve the windows identity of its owner. This was the root cause for the issue.

Solution:

The solution to overcome this issue is to provide ownership of the Initiator Service to a SQL User. In our case, we are not supposed to use more independent SQL users and logins in the system due to security reasons, we have given the ownership to a domain user who uses the login credentials of [NT AUTHORITY\NETWORK SERVICE] which is a local user to the machine. So, whichever user try to send messages, the service will use the identity of the owner user and will run seamlessly.

Sample Code Snippet

Create USER User1 For Login [NT AUTHORITY\NETWORK SERVICE]

ALTER AUTHORIZATION ON SERVICE::InitiatorService TO [User1]

NB: Pls correct me if i am wrong in any of my analysis.

Thanks and Regards, Baiju Raj.

more ▼

answered Dec 21 '12 at 06:29 AM

paps gravatar image

paps
20 4 4 4

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x23
x13

asked: Jul 13 '12 at 05:06 PM

Seen: 891 times

Last Updated: Dec 23 '12 at 02:56 AM