I need to develop a Windows Server Service Bus topic subscriber (yes, Windows Server and not Azure), and in order to abstract away from the reading, start worker thread, ..., cycle and to take advantage of AppFabric management capabilities, i had the following idea:
And the questions are:
Thanks in advance.
To help future related problems here is the required configuration
Extensions required both in publisher and subscriber configuration:
<extensions>
<behaviorExtensions>
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</behaviorExtensions>
<bindingExtensions>
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
Note: The Microsoft.ServiceBus assembly is required both in the publisher as well in the subscriber. The package is available in Nuget.
Subscriber side configuration:
<bindings>
<netMessagingBinding>
<binding name="messagingBinding" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:03:00" sendTimeout="00:03:00" sessionIdleTimeout="00:01:00" prefetchCount="-1">
<transportSettings batchFlushInterval="00:00:01" />
</binding>
</netMessagingBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="securityBehavior">
<messageInterceptorBehavior/>
<transportClientEndpointBehavior>
<tokenProvider>
<windowsAuthentication>
<stsUris>
<stsUri value="https://[SERVER]:9355/[NAMESPACE]" />
</stsUris>
</windowsAuthentication>
</tokenProvider>
</transportClientEndpointBehavior>
</behavior>
<endpoint listenUri="sb://[SERVER]/[NAMESPACE]/[TOPIC]/Subscriptions/[SUBSCRIPTIONNAME]"
address="sb://[SERVER]/[NAMESPACE]/[TOPIC]"
behaviorConfiguration="securityBehavior" binding="netMessagingBinding"
bindingConfiguration="messagingBinding" name="InsuranceService"
contract="[WCF_CONTRACT_NAME]" />
Publisher configuration:
<bindings>
<netMessagingBinding>
<binding name="InsuranceService" closeTimeout="00:03:00" openTimeout="00:03:00"
receiveTimeout="00:03:00" sendTimeout="00:03:00" prefetchCount="-1"
sessionIdleTimeout="00:01:00">
<transportSettings batchFlushInterval="00:00:01" />
</binding>
</netMessagingBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="securityBehavior">
<messageInterceptorBehavior/>
<transportClientEndpointBehavior>
<tokenProvider>
<windowsAuthentication>
<stsUris>
<stsUri value="https://[SERVER]:9355/[NAMESPACE]" />
</stsUris>
</windowsAuthentication>
</tokenProvider>
</transportClientEndpointBehavior>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="sb://[SERVER]/[NAMESPACE]/[TOPIC]"
behaviorConfiguration="securityBehavior" binding="netMessagingBinding"
bindingConfiguration="InsuranceService" contract="PushVoucherService.ISubscriber"
name="InsuranceService" />
</client>