本文整理汇总了C#中EndpointConfiguration.AuditProcessedMessagesTo方法的典型用法代码示例。如果您正苦于以下问题:C# EndpointConfiguration.AuditProcessedMessagesTo方法的具体用法?C# EndpointConfiguration.AuditProcessedMessagesTo怎么用?C# EndpointConfiguration.AuditProcessedMessagesTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EndpointConfiguration
的用法示例。
在下文中一共展示了EndpointConfiguration.AuditProcessedMessagesTo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AsyncMain
static async Task AsyncMain()
{
Console.Title = "Samples.SqlNHibernate.Receiver";
Configuration hibernateConfig = new Configuration();
hibernateConfig.DataBaseIntegration(x =>
{
x.ConnectionStringName = "NServiceBus/Persistence";
x.Dialect<MsSql2012Dialect>();
});
#region NHibernate
hibernateConfig.SetProperty("default_schema", "receiver");
#endregion
ModelMapper mapper = new ModelMapper();
mapper.AddMapping<OrderMap>();
hibernateConfig.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());
new SchemaExport(hibernateConfig).Execute(false, true, false);
#region ReceiverConfiguration
EndpointConfiguration endpointConfiguration = new EndpointConfiguration("Samples.SqlNHibernate.Receiver");
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.AuditProcessedMessagesTo("audit");
endpointConfiguration.EnableInstallers();
endpointConfiguration.UseTransport<SqlServerTransport>()
.DefaultSchema("receiver")
.UseSpecificSchema(e =>
{
if (e == "error" || e == "audit")
{
return "dbo";
}
if (e == "Samples.SqlNHibernate.Sender")
{
return "sender";
}
return null;
});
endpointConfiguration.UsePersistence<NHibernatePersistence>()
.UseConfiguration(hibernateConfig);
#endregion
IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
try
{
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
finally
{
await endpoint.Stop();
}
}
示例2: Usage
Usage(EndpointConfiguration endpointConfiguration)
{
#region AuditWithCode
endpointConfiguration.AuditProcessedMessagesTo("targetAuditQueue");
#endregion
}
示例3: Usage
public Usage()
{
#region AuditWithCode
EndpointConfiguration configuration = new EndpointConfiguration();
configuration.AuditProcessedMessagesTo("targetAuditQueue");
#endregion
}
示例4: AsyncMain
static async Task AsyncMain()
{
Console.Title = "Samples.SQLNHibernateOutbox.Receiver";
#region NHibernate
var hibernateConfig = new Configuration();
hibernateConfig.DataBaseIntegration(x =>
{
x.ConnectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True";
x.Dialect<MsSql2012Dialect>();
});
var mapper = new ModelMapper();
mapper.AddMapping<OrderMap>();
hibernateConfig.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());
#endregion
new SchemaExport(hibernateConfig).Execute(false, true, false);
var endpointConfiguration = new EndpointConfiguration("Samples.SQLNHibernateOutbox.Receiver");
endpointConfiguration.UseSerialization<JsonSerializer>();
#region ReceiverConfiguration
var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
transport.ConnectionString(@"Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True");
var persistence = endpointConfiguration.UsePersistence<NHibernatePersistence>();
persistence.UseConfiguration(hibernateConfig);
endpointConfiguration.EnableOutbox();
#endregion
#region RetriesConfiguration
endpointConfiguration.DisableFeature<FirstLevelRetries>();
endpointConfiguration.DisableFeature<SecondLevelRetries>();
#endregion
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.AuditProcessedMessagesTo("audit");
var endpointInstance = await Endpoint.Start(endpointConfiguration)
.ConfigureAwait(false);
try
{
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
finally
{
await endpointInstance.Stop()
.ConfigureAwait(false);
}
}
示例5: AsyncMain
static async Task AsyncMain()
{
Console.Title = "Samples.SQLNHibernateOutbox.Sender";
const string letters = "ABCDEFGHIJKLMNOPQRSTUVXYZ";
Random random = new Random();
EndpointConfiguration endpointConfiguration = new EndpointConfiguration("Samples.SQLNHibernateOutbox.Sender");
endpointConfiguration.UseSerialization<JsonSerializer>();
#region SenderConfiguration
endpointConfiguration
.UseTransport<SqlServerTransport>()
.ConnectionString(@"Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True");
endpointConfiguration
.UsePersistence<NHibernatePersistence>()
.ConnectionString(@"Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True");
endpointConfiguration.EnableOutbox();
#endregion
endpointConfiguration.DisableFeature<FirstLevelRetries>();
endpointConfiguration.DisableFeature<SecondLevelRetries>();
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.AuditProcessedMessagesTo("audit");
IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
try
{
Console.WriteLine("Press enter to publish a message");
Console.WriteLine("Press any key to exit");
while (true)
{
ConsoleKeyInfo key = Console.ReadKey();
Console.WriteLine();
if (key.Key != ConsoleKey.Enter)
{
return;
}
string orderId = new string(Enumerable.Range(0, 4).Select(x => letters[random.Next(letters.Length)]).ToArray());
await endpoint.Publish(new OrderSubmitted
{
OrderId = orderId,
Value = random.Next(100)
});
}
}
finally
{
await endpoint.Stop();
}
}
示例6: Main
static void Main()
{
EndpointConfiguration endpointConfiguration = new EndpointConfiguration();
endpointConfiguration.EndpointName("Samples.CustomChecks.Monitor3rdParty");
endpointConfiguration.AuditProcessedMessagesTo("audit");
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.UseSerialization<JsonSerializer>();
endpointConfiguration.EnableInstallers();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
示例7: AsyncMain
static async Task AsyncMain()
{
Configuration hibernateConfig = new Configuration();
hibernateConfig.DataBaseIntegration(x =>
{
x.ConnectionStringName = "NServiceBus/Persistence";
x.Dialect<MsSql2012Dialect>();
});
#region NHibernate
hibernateConfig.SetProperty("default_schema", "receiver");
#endregion
ModelMapper mapper = new ModelMapper();
mapper.AddMapping<OrderMap>();
hibernateConfig.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());
new SchemaExport(hibernateConfig).Execute(false, true, false);
#region ReceiverConfiguration
EndpointConfiguration endpointConfiguration = new EndpointConfiguration();
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.AuditProcessedMessagesTo("audit");
endpointConfiguration.EnableInstallers();
endpointConfiguration.UseTransport<SqlServerTransport>()
.DefaultSchema("receiver")
.UseSpecificSchema(e =>
{
switch (e)
{
case "error":
return "dbo";
case "audit":
return "dbo";
default:
string schema = e.Split(new[]
{
'.'
}, StringSplitOptions.RemoveEmptyEntries)[0].ToLowerInvariant();
return schema;
}
});
endpointConfiguration.UsePersistence<NHibernatePersistence>()
.UseConfiguration(hibernateConfig)
.RegisterManagedSessionInTheContainer();
#endregion
IEndpointInstance endpoint = await Endpoint.Start(endpointConfiguration);
try
{
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
finally
{
await endpoint.Stop();
}
}