Depending on whether you would like to set up the secure or 'normal' subscription manager execute the relevant script:
- .\scripts\SubscriptionManagerCreate.sql
- .\scripts\SecureSubscriptionManagerCreate.sql
Once that is done you need to create a subscription manager instance in your code and subscribe to the relevant events:
var subscriptionManager = SubscriptionManager.Default();
subscriptionManager.Subscribe(new[] { typeof(WorkDoneEvent).FullName });
var bus = ServiceBus
.Create()
.SubscriptionManager(subscriptionManager)
.Start();
You can also fore-go the subscription in code and use the management shell to set up the subscriptions.
The subscription manager will try to connect to the database pointed to by a connection string named '
Subscription':
<connectionStrings>
<clear/>
<add
name="Subscription"
connectionString="Data Source=.\sqlexpress; Initial Catalog=shuttle;Integrated Security=SSPI;"
providerName="System.Data.SqlClient"/>
</connectionStrings>