private static LocalTransportSettings ValidateLocalTransport(CreateMsmqTransportSettings settings) { var result = new LocalTransportSettings { Transactional = settings.Address.IsTransactional, }; MsmqEndpointManagement.Manage(settings.Address, q => { if (!q.Exists) { if (!settings.CreateIfMissing) throw new TransportException(settings.Address.Uri, "The transport does not exist and automatic creation is not enabled"); q.Create(settings.Transactional || settings.Address.IsTransactional); } if (settings.RequireTransactional) { if (!q.IsTransactional && (settings.Transactional || settings.Address.IsTransactional)) throw new TransportException(settings.Address.Uri, "The transport is non-transactional but a transactional transport was requested"); } result.Transactional = q.IsTransactional; }); return result; }
public static LocalTransportSettings UseLocalTransport(this IEndpointFluent endpointSettings) { var settings = new LocalTransportSettings(); endpointSettings.TransportSettings = settings; return(settings); }