WCF 结合MSMQ,使服务更稳定
来源:互联网 发布:淘宝违规处理怎么处理 编辑:程序博客网 时间:2024/05/16 07:59
转载自:http://blog.csdn.net/hoken2020856/article/details/5622860
WCF(Windows Communication Foundation) - 消息队列(MSMQ - MicroSoft Message Queue):
netMsmqBinding的binding属性配置如下:
·ExactlyOnce - 确保消息只被投递一次。只能应用于事务型队列,默认值 ture
·Durable - 消息是否需要持久化。默认值 enabled,如果设置为disable,当MSMQ服务重启后,先前保存在MSMQ中的消息将会丢失
·TimeToLive - 消息过期并且从原有的队列移动到死信队列的时间。默认值 1.00:00:00 (1天)
·ReceiveRetryCount - 配置队列管理器在一定重试间隔中,尝试重新投递消息的次数,也就是将消息传输到重试队列前尝试发送该消息的最大次数(每隔RetryCycleDelay的时间重试ReceiveRetryCount次)。缺省值 5
·MaxRetryCycles - 配置队列管理器重新投递消息的重试间隔数(执行RetryCycleDelay的次数),也就是重试最大周期数。缺省值 2
·RetryCycleDelay - 表示两次重试之间的间隔时间,也就是重试周期之间的延迟。缺省值 00:30:00
·ReceiveErrorHandling - 指定如何处理错误的消息。Fault、Drop、Reject或Move(具体说明查MSDN)
·DeadLetterQueue - 指定所使用的死信队列的类型。None、System、或Custom(具体说明查MSDN)
·CustomDeadLetterQueue - 本地自定义死信队列的URI
示例
1、服务
IMSMQ.cs
MSMQ.cs
2、宿主
MSMQ.cs
App.config
3、客户端
MSMQ.cs
App.config
运行结果:
客户端调用时,如果没有启动服务端,那么消息会进入到消息队列中。等到服务端启动后,会执行消息队列中的所有消息。
MSMQ 防火墙 端口 配置
The table below describes the ports used by Message Queuing:
MSMQ 4.0
MSMQ 3.0
MSMQ 2.0
MSMQ 1.0TCP 389Reserved port used by independent clients and Message Queuing servers to make MQIS requests directly to Active Directory using LDAP.MSMQ 5.0
MSMQ 4.0
MSMQ 3.0TCP 1801Message Queuing (including HTTP messaging) message traffic and internal session management traffic between Queue Managers.MSMQ 5.0
MSMQ 4.0
MSMQ 3.0
MSMQ 2.0
MSMQ 1.0UDP 1801Reserved port used by the Message Queuing independent client to multicast a server discovery broadcast.MSMQ 5.0
MSMQ 4.0
MSMQ 3.0
MSMQ 2.0
MSMQ 1.0TCP 2101*Message Queuing listens on this port on the Domain Controller for RPC-based MQIS and Active Directory lookups.MSMQ 5.0
MSMQ 4.0
MSMQ 3.0
MSMQ 2.0
MSMQ 1.0TCP 2103*
TCP 2105*On these two ports, Message Queuing independent clients and servers listen for RPC-based remote reads of their public queues and private queues.
The dependent client also uses these two ports to communicate with its server for send and for receive. MSMQ 5.0
MSMQ 4.0
MSMQ 3.0
MSMQ 2.0
MSMQ 1.0UDP 3527Reserved port used for the internal "ping" mechanism for Message Queuing.
Note On Message Queuing 4.0 and later, UDP port 3527 is no longer used by default. For more information on this change, visit the following links:
Security Enhancements that Affect the Default Behavior of Message Queuing
MSMQ’s internal ping mechanism over port 3527MSMQ 3.0
MSMQ 2.0
MSMQ 1.0
* These port numbers may be incremented by 11 if the initial choice of RPC port is being used when Message Queuing initializes. A connecting QM queries port 135 to discover the 2xxx ports.
The table below lists the MSMQ version by operating system:
Windows 7MSMQ 5.0Windows Server 2008
Windows VistaMSMQ 4.0Windows Server 2003 R2
Windows Server 2003
Windows XP ProfessionalMSMQ 3.0Windows Server 2000
Windows Professional 2000MSMQ 2.0Windows NT 4.0MSMQ 1.0
- WCF 结合MSMQ,使服务更稳定
- WCF-NetMsmq(其实是WCF-WCF的通信,MSMQ在此只起到在连接不稳定时让通信更稳定的效果)
- WCF--MSMQ
- WCF分布式开发常见错误(17):无法启动MSMQ服务
- WCF服务离线操作与消息队列MSMQ
- (6)WCF服务离线操作与消息队列MSMQ
- 断言使代码更稳定
- 断言使代码更稳定
- 断言使代码更稳定
- WCF分布式开发步步为赢(13):WCF服务离线操作与消息队列MSMQ
- wcf的 msmq
- 基于MSMQ使用WCF
- 基于MSMQ使用WCF
- MSMQ In WCF
- [WCF MSMQ] 1. 基本应用
- 学习整理 WCF MSMQ StreamInsight
- 无法启动MSMQ服务
- MSMQ消息队列与WCF MSMQ的认识与使用
- #HDU 1506 dp求最大子矩阵
- PHP的执行原理/执行流程
- android轮播图Banner的使用及详解
- win10安装centos7双系统 总结
- data augmentation
- WCF 结合MSMQ,使服务更稳定
- Android高性能文件类MemoryFile (2011-01-15 14:50:57)
- 35. Search Insert Position
- 获取元素的高度
- 如何在Commander One中显示隐藏文件?
- TestLink couldn’t write config_db.inc.php
- 小白学分布式程序开发7-二阶段提交
- 项目应用:nexus安装
- TransformDirection