Configuring endpoint to work with ServiceControl via SQLServer Transport

199 views
Skip to first unread message

Sabrina

unread,
Apr 6, 2017, 4:04:08 AM4/6/17
to Particular Software
Helpful information to include
Product name: NServiceBus / ServiceControl
Version: NServiceBus v6.1 / ServiceControl v1.39
Stacktrace: 
Errors I'm getting trying to start the endpoint: 
  2017-04-06 02:53:11.314 WARN  ServiceControl.Features.Heartbeats Unable to regis
ter endpoint startup with ServiceControl. Going to reattempt registration after
00:01:00.
NServiceBus.Unicast.Queuing.QueueNotFoundException: Failed to send message to ad
dress: [Particular.ServiceControlSQL] ---> System.Messaging.MessageQueueExceptio
n: The queue does not exist or you do not have sufficient permissions to perform
 the operation.
   at System.Messaging.MessageQueue.MQCacheableInfo.get_WriteHandle()
   at System.Messaging.MessageQueue.StaleSafeSendMessage(MQPROPS properties, Int
Ptr transaction)
   at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransac
tion internalTransaction, MessageQueueTransactionType transactionType)
   at System.Messaging.MessageQueue.Send(Object obj, String label, MessageQueueT
ransaction transaction, MessageQueueTransactionType transactionType)
   at System.Messaging.MessageQueue.Send(Object obj, String label, MessageQueueT
ransactionType transactionType)
   at NServiceBus.MsmqMessageDispatcher.ExecuteTransportOperation(TransportTrans
action transaction, UnicastTransportOperation transportOperation)
   --- End of inner exception stack trace ---
   at NServiceBus.MsmqMessageDispatcher.ExecuteTransportOperation(TransportTrans
action transaction, UnicastTransportOperation transportOperation)
   at NServiceBus.MsmqMessageDispatcher.Dispatch(TransportOperations outgoingMes
sages, TransportTransaction transaction, ContextBag context)
   at ServiceControl.Plugin.ServiceControlBackend.Send(Byte[] body, String messa
geType, TimeSpan timeToBeReceived) in C:\BuildAgent\work\a58b2f713ea0114f\src\Se
rviceControl.Plugin.Nsb6.Heartbeat\ServiceControlBackend.cs:line 56
   at ServiceControl.Plugin.ServiceControlBackend.Send(RegisterEndpointStartup m
essageToSend, TimeSpan timeToBeReceived) in C:\BuildAgent\work\a58b2f713ea0114f\
src\ServiceControl.Plugin.Nsb6.Heartbeat\ServiceControlBackend.cs:line 98
   at ServiceControl.Features.Heartbeats.HeartbeatStartup.<SendEndpointStartupMe
ssage>d__6.MoveNext() in C:\BuildAgent\work\a58b2f713ea0114f\src\ServiceControl.
Plugin.Nsb6.Heartbeat\Heartbeats.cs:line 116
2017-04-06 02:53:11.347 WARN  NServiceBus.MessagePump MSMQ receive operation fai
led
System.Messaging.MessageQueueException (0x80004005): Access to Message Queuing s
ystem is denied.
   at System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle()
   at System.Messaging.MessageEnumerator.get_Handle()
   at System.Messaging.MessageEnumerator.MoveNext(TimeSpan timeout)
   at NServiceBus.MessagePump.<InnerProcessMessages>d__6.MoveNext()
2017-04-06 02:53:11.398 WARN  NServiceBus.RepeatedFailuresOverTimeCircuitBreaker
 The circuit breaker for MsmqPeek is now in the armed state
Description:
My endpoint app.config:
  <connectionStrings>
    <add name="NServiceBus/Transport/ServiceControl" connectionString="Data Source=<server>;Initial Catalog=<database>;uid=<uid>;pwd=<pid>" />
  </connectionStrings>
  <appSettings>
    <add key="ServiceControl/Queue" value="Particular.ServiceControlSQL" />
  </appSettings>
  

I had this working with MSMQ transport but want to switch to SQL Server Transport. It seems like the endpoint can't find the Service Control endpoint to send heartbeats to. But I'm not able to find any other information on how to tell it where to go??

Service Control starts up, runs fine, all the tables are getting created in the database as expected (copied below). I found one answer talking about updating the endpoint app.config so I did that and nothing there either...
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE
GSBus dbo Particular.ServiceControlSQL BASE TABLE
GSBus dbo Particular.ServiceControlSQL.Errors BASE TABLE
GSBus dbo Particular.ServiceControlSQL.GSNSBDEV01 BASE TABLE
GSBus dbo Particular.ServiceControlSQL.staging BASE TABLE

Please help and many thanks!

Marcin Hoppe

unread,
Apr 6, 2017, 4:09:20 AM4/6/17
to particula...@googlegroups.com
Hi,

Did you have a chance to take a look at this documentation page here:


It describes how to configure both the SQL Server transport and ServiceControl. Please let me know if this helps.

Best regards,
Marcin


--
You received this message because you are subscribed to the Google Groups "Particular Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftware+unsub...@googlegroups.com.
To post to this group, send email to particularsoftware@googlegroups.com.
Visit this group at https://groups.google.com/group/particularsoftware.
To view this discussion on the web visit https://groups.google.com/d/msgid/particularsoftware/09374795-26d3-4a14-8501-6bddb198b91b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcin Hoppe | Software Engineer | Particular Software

Sabrina

unread,
Apr 6, 2017, 11:25:54 AM4/6/17
to Particular Software
I'm not sure how that helps me? I'm not using multiple instances of sql server yet...

Mike Minutillo

unread,
Apr 7, 2017, 1:43:50 AM4/7/17
to Particular Software
Hi Sabrina, 

Looking through the exception stack trace, it looks like the endpoint is still using MSMQ to try and send heartbeats to ServiceControl. It is failing because it cannot find an MSMQ queue named Particular.ServiceControlSQL.

The heartbeats plugin should be using exactly the same transport as the endpoint. If you disable heartbeats, does the endpoint work correctly with SQL?

Regards,
Mike Minutillo

Sabrina

unread,
Apr 7, 2017, 12:42:42 PM4/7/17
to Particular Software
I was able to figure it out. I had forgotten to setup the SQL Transport on my endpoint, but also I had to go into the Windows Service properties and give it a username/password with more access to the database I'm using. The latter may be good to note in the documentation. I hadn't thought of it until I got to digging around the Properties, this is my first foray into writing my own Windows Service.

Thanks!
Reply all
Reply to author
Forward
0 new messages