我试图创建一个服务读取来自交易系统死信队列死信。

在服务配置看起来像这样:

<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端点使用带有结合的配置,所以死信队列服务还需要一个结合,其限定的安全模式为无。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top