title: SQL Service broker disable after database restart
body: <p>I am a newbie at SQL Service Broker so pardon my ignorance.</p>
  
  <p>We have a SQL Service broker that needs to be enabled again after the database has restarted. How can we get to be automatically enabled after the sql service restart?</p>
  
  <p>Also we are able to send messages when the broker is disabled and it throws no SQL error. We can search the queue and it has nothing (neither of the queues - see below).</p>
  
  <p>Once we enable the broker all the messages appear on the queue. Is that a normal behavior or some missconfiguration.</p>
  
  <p>See below for the configuration of the service broker.</p>
  
  <p>Thank you,</p>
  
  <p>Greg</p>
  
  <pre><code>ALTER DATABASE our_database SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
  
  
  
  CREATE MESSAGE TYPE IncomingFileMessage
  VALIDATION = NONE;
  
  
  CREATE CONTRACT IncomingMessageContract
  (IncomingFileMessage SENT BY ANY);
  
  CREATE QUEUE ReceivingQueue
  
  CREATE QUEUE IncomingMessageQueue
  
  
  CREATE SERVICE ReceivingMessageService
  ON QUEUE ReceivingQueue (IncomingMessageContract);
  
  CREATE SERVICE IncomingMessageService
  ON QUEUE IncomingMessageQueue (IncomingMessageContract);
  </code></pre>