MSMQ3.0用WCFデッドレターサービスを作成する方法
-
24-09-2019 - |
質問
私はトランザクションシステム不能キューからデッドレターを読んでサービスを作成しようとしています。
このようなサービスの設定になります。
<service name="NotificationDeadLetterQueueService">
<endpoint
address="net.msmq://localhost/system$;DeadXact"
binding="netMsmqBinding"
contract="INotificationService"
/>
</service>
私のサービスインタフェースます:
[ServiceContract]
public interface INotificationService
{
[OperationContract(IsOneWay=true)]
[NetDataContractSerializerFormatAttribute]
void HandleNotification(Notification notification);
}
私のサービスの実装でます:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
public class NotificationDeadLetterQueueService : INotificationService
{
#region INotificationService Members
[OperationBehavior(TransactionScopeRequired = true)]
public void HandleNotification(Notification notification)
{
throw new NotImplementedException();
}
#endregion
}
とスタート、このようなホストます:
ServiceHost serviceHost = new ServiceHost(typeof(NotificationDeadLetterQueueService));
serviceHost.Open();
のようなこれまでのところ、すべてのルックスは多くの書籍やチュートリアルで説明したが、私はトランザクション配信不能キュー内のデッドレターを生成する際にサービスが起動されません。私のサービスで間違ったとは何ですか?
の助けをありがとう Enyra
解決
私はかなりトリックで問題を見つけました。デッドレターキューサービスもなしにセキュリティモードを定義するバインディングを必要とするように、MSMQクライアントエンドポイントは、との結合構成を使用します。
所属していません StackOverflow