public void CreateQueue(Uri queueUri)
 {
     ExecuteCommand("[SBQ].[CreateQueueIfDoesNotExist]", cmd =>
     {
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@address", queueUri.ToServiceName());
         cmd.ExecuteNonQuery();
     });
 }
 public void RegisterToSend(Uri destination, MessageEnvelope payload)
 {
     byte[] data = payload.Serialize();
     Actions.ExecuteCommand("[SBQ].[RegisterToSend]", cmd =>
     {
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@localServiceName", QueueUri.ToServiceName());
         cmd.Parameters.AddWithValue("@address", destination.ToServiceName());
         cmd.Parameters.AddWithValue("@route", string.Format("{0}://{1}", destination.Scheme, destination.Authority));
         cmd.Parameters.AddWithValue("@sizeOfData", payload.Data.Length);
         cmd.Parameters.AddWithValue("@deferProcessingUntilTime",
                                     (object)payload.DeferProcessingUntilUtcTime ?? DBNull.Value);
         cmd.Parameters.AddWithValue("@sentAt", DateTime.UtcNow);
         cmd.Parameters.AddWithValue("@data", data);
         cmd.ExecuteNonQuery();
     });
 }
 public void CanCorrectlyParseUriIntoServiceName()
 {
     var uri = new Uri("tcp://something.fake.com:2204/corey/devqueue");
     Assert.AreEqual(uri.ToServiceName(), "something.fake.com:2204/corey/devqueue");
 }
예제 #4
0
 /// <summary>
 /// Adds a route to a remote message queue.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="endpoint">The endpoint.</param>
 /// <param name="brokerInstance">The broker instance.</param>
 public void AddRoute( string name, Uri endpoint, Guid? brokerInstance )
 {
     queueStorage.Global( actions => actions.AddRoute( name, endpoint.ToServiceName(), endpoint, brokerInstance ) );
 }