☁️ .NET Standard client library for Azure Service Bus
Перейти к файлу
Neeraj Makam e693fa6ce3
[WIP] Transaction support (#421)
Introduces transaction support.
Operations can now be executed inside a TransactionScope providing atomicity.
Supported operations for transactions:
`SendAsync`, `CompleteAsync`, `DeferAsync`, `DeadLetterAsync`, `AbandonAsync`

Transaction cannot work across connections. Hence, to be able to Send and Receive in a single transaction, `ServiceBusConnection` object has been exposed. Each of the client entities now accepts an already created connection.

Sample usage:
```csharp
var connection = new ServiceBusConnection(ConnectionString);
var sender = new MessageSender(connection, QueueName);
var receiver = new MessageReceiver(connection, QueueName);
var receivedMessage = await receiver.ReceiveAsync();

using (var ts = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
	await receiver.CompleteAsync(receivedMessage.SystemProperties.LockToken);
	await sender.SendAsync(message).ConfigureAwait(false);
	ts.Complete();
        // Or, ts.Dispose();
}

await sender.CloseAsync();
await receiver.CloseAsync();
await connection.CloseAsync();
```
2018-03-29 19:38:05 -07:00
.github Make PRs general description less noisy (#242) 2017-08-01 15:15:53 -07:00
build [WIP] Transaction support (#421) 2018-03-29 19:38:05 -07:00
src/Microsoft.Azure.ServiceBus [WIP] Transaction support (#421) 2018-03-29 19:38:05 -07:00
test/Microsoft.Azure.ServiceBus.UnitTests [WIP] Transaction support (#421) 2018-03-29 19:38:05 -07:00
.editorconfig Migrate to Visual Studio 2017 (#127) 2017-04-20 17:59:37 -07:00
.gitattributes Topic Subscriptions/ Sessions/ Request Response features (#36) 2016-12-14 15:40:00 -08:00
.gitignore API approver (#168) 2017-05-31 15:04:58 -07:00
CODEOWNERS Create CODEOWNERS (#215) 2017-07-10 15:18:48 -07:00
Directory.Build.props Adding additional documentation + typos (#313) 2017-09-13 10:47:11 -07:00
LICENSE API approver (#168) 2017-05-31 15:04:58 -07:00
Microsoft.Azure.ServiceBus.sln Removing samples (#144) 2017-04-27 08:43:29 -07:00
README.md Newlogo (#401) 2018-01-10 18:46:07 -08:00
appveyor.yml Appveyor Change (#171) 2017-06-02 14:55:05 -07:00
service-bus.png Newlogo (#401) 2018-01-10 18:46:07 -08:00
thirdpartynotice.txt API approver (#168) 2017-05-31 15:04:58 -07:00

README.md

Microsoft Azure Service Bus

Microsoft Azure Service Bus Client for .NET

Build/Package Status
master Build status codecov
dev Build status codecov
Microsoft.Azure.ServiceBus NuGet Version and Downloads count

This is the next generation Service Bus .NET client library that focuses on queues & topics. If you are looking for Event Hubs and Relay clients, follow the below links:

Azure Service Bus is an asynchronous messaging cloud platform that enables you to send messages between decoupled systems. Microsoft offers this feature as a service, which means that you do not need to host any of your own hardware in order to use it.

Refer to the online documentation to learn more about Service Bus.

This library is built using .NET Standard 1.3. For more information on what platforms are supported see .NET Platforms Support.

How to provide feedback

See our Contribution Guidelines.

How to get support

See our Support Guidelines

FAQ

Where can I find examples that use this library?

https://github.com/Azure/azure-service-bus/tree/master/samples

How do I run the unit tests?

In order to run the unit tests, you will need to do the following:

  1. Deploy the Azure Resource Manager template located at /build/azuredeploy.json by clicking the following button:

    Running the above template will provision a standard Service Bus namespace along with the required entities to successfully run the unit tests.

  2. Add an Environment Variable named azure-service-bus-dotnet/connectionstring and set the value as the connection string of the newly created namespace. Please note that if you are using Visual Studio, you must restart Visual Studio in order to use new Environment Variables.

Once you have completed the above, you can run dotnet test from the /test/Microsoft.Azure.ServiceBus.UnitTests directory.

Can I manage Service Bus entities with this library?

The standard way to manage Azure resources is by using Azure Resource Manager. In order to use functionality that previously existed in the .NET Framework Service Bus client library, you will need to use the Microsoft.Azure.Management.ServiceBus library. This will enable use cases that dynamically create/read/update/delete resources. The following links will provide more information on the new library and how to use it.