title: Setting the OperationTimeOut property for a Service bus worker role
body: <p>I am creating a worker role using the service bus worker role template.</p>
  
  <p>It is taking more than a minute for me to process each message.</p>
  
  <p>Because of this, i am seeing that the same message is received by the worker role multiple times, roughly one message every minute.</p>
  
  <p>I figured that this is because this value defaults to 60 seconds.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.messagingfactorysettings.operationtimeout.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.messagingfactorysettings.operationtimeout.aspx</a></p>
  
  <p>But I am not sure how to increase this value, because i am not seeing the messageFactorySettings class anywhere.</p>
  
  <p>Where do I set this property?</p>
  
  <p>here is the code I am using</p>
  
  <pre><code>public class WorkerRole : RoleEntryPoint
      {
  
          // QueueClient is thread-safe. Recommended that you cache 
          // rather than recreating it on every request
          QueueClient Client;
          ManualResetEvent CompletedEvent = new ManualResetEvent(false);
  
          public override void Run()
          {
  
              Client.OnMessage((receivedMessage) =&gt;
                  {
                      ProcessMessage(recievedMessage);
                  });
  
              CompletedEvent.WaitOne();
          }
  
          public override bool OnStart()
          {
              ServicePointManager.DefaultConnectionLimit = 12;
  
              string connectionString = ConfigurationUtility.GetConnectionString("Microsoft.ServiceBus.ConnectionString");
              string queneName = ConfigurationUtility.GetConnectionString("QueueName");
  
              // Create the queue if it does not exist already
              var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
              if (!namespaceManager.QueueExists(queneName))
              {
                  namespaceManager.CreateQueue(queneName);
  
              }
  
              Client = QueueClient.CreateFromConnectionString(connectionString, queneName);
              return base.OnStart();
          }
  
          public override void OnStop()
          {
              // Close the connection to Service Bus Queue
              Client.Close();
              CompletedEvent.Set();
              base.OnStop();
          }
      }
  </code></pre>