<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:st="" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="http://schemas.microsoft.com/sharepoint/soap/workflow/"
xmlns:ns1="http://schemas.microsoft.com/office/2006/digsig-setup"
xmlns:ns2="http://schemas.microsoft.com/office/2006/digsig"
xmlns:ns3="http://schemas.openxmlformats.org/package/2006/digital-signature"
xmlns:ns4="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ns5="http://schemas.microsoft.com/office/2004/12/omml"
xmlns:ns6="http://schemas.openxmlformats.org/package/2006/relationships"
xmlns:ns7="http://microsoft.com/sharepoint/webpartpages"
xmlns:ns8="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:ns9="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:ns10="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/"
xmlns:ns11="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService"
xmlns:ns12="urn:schemas-microsoft-com:">
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:新宋体;
        panose-1:2 1 6 9 3 1 1 1 1 1;}
@font-face
        {font-family:"\@新宋体";
        panose-1:2 1 6 9 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:Calibri;}
h1
        {margin-top:17.0pt;
        margin-right:0cm;
        margin-bottom:16.5pt;
        margin-left:0cm;
        text-indent:0cm;
        line-height:240%;
        page-break-after:avoid;
        mso-list:l0 level1 lfo4;
        font-size:22.0pt;
        font-family:Calibri;}
h3
        {margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:3.0pt;
        margin-left:0cm;
        text-indent:0cm;
        line-height:12.0pt;
        page-break-after:avoid;
        mso-list:l0 level3 lfo4;
        font-size:10.0pt;
        font-family:Arial;
        font-weight:normal;}
h5
        {margin-top:12.0pt;
        margin-right:0cm;
        margin-bottom:3.0pt;
        margin-left:0cm;
        mso-para-margin-top:12.0pt;
        mso-para-margin-right:1.0gd;
        mso-para-margin-bottom:3.0pt;
        mso-para-margin-left:0cm;
        text-indent:0cm;
        line-height:12.0pt;
        mso-list:l0 level5 lfo4;
        font-size:11.0pt;
        font-family:Calibri;
        font-weight:normal;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
        {margin-top:12.0pt;
        margin-right:0cm;
        margin-bottom:3.2pt;
        margin-left:0cm;
        text-indent:0cm;
        line-height:133%;
        page-break-after:avoid;
        mso-list:l0 level7 lfo4;
        font-size:12.0pt;
        font-family:Calibri;
        font-weight:bold;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.heading7, li.heading7, div.heading7
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:20.0pt;
        margin-bottom:.0001pt;
        mso-para-margin-top:0cm;
        mso-para-margin-right:1.0gd;
        mso-para-margin-bottom:0cm;
        mso-para-margin-left:1.0gd;
        mso-para-margin-bottom:.0001pt;
        line-height:12.0pt;
        font-size:10.0pt;
        font-family:Calibri;}
p.StyleHeading7Right1ch, li.StyleHeading7Right1ch, div.StyleHeading7Right1ch
        {margin-top:12.0pt;
        margin-right:10.0pt;
        margin-bottom:3.0pt;
        margin-left:0cm;
        mso-para-margin-top:12.0pt;
        mso-para-margin-right:1.0gd;
        mso-para-margin-bottom:3.0pt;
        mso-para-margin-left:0cm;
        text-indent:0cm;
        line-height:12.0pt;
        mso-list:l0 level7 lfo4;
        font-size:10.0pt;
        font-family:Calibri;}
p.StyleHeading3TimesNewRomanBoldNotItalic, li.StyleHeading3TimesNewRomanBoldNotItalic, div.StyleHeading3TimesNewRomanBoldNotItalic
        {margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:3.0pt;
        margin-left:0cm;
        text-indent:0cm;
        line-height:12.0pt;
        page-break-after:avoid;
        mso-list:l0 level3 lfo4;
        font-size:10.0pt;
        font-family:Arial;
        font-weight:bold;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:Calibri;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:-5;
        mso-list-template-ids:1262271446;}
@list l0:level1
        {mso-level-style-link:"Heading 1";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level2
        {mso-level-text:"%1\.%2";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level3
        {mso-level-style-link:"Heading 3";
        mso-level-text:"%1\.%2\.%3";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level4
        {mso-level-text:"%1\.%2\.%3\.%4";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level5
        {mso-level-style-link:"Heading 5";
        mso-level-text:"%1\.%2\.%3\.%4\.%5";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level6
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level7
        {mso-level-style-link:"Heading 7";
        mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level8
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level9
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        mso-level-legacy:yes;
        mso-level-legacy-indent:0cm;
        mso-level-legacy-space:7.2pt;
        margin-left:0cm;
        text-indent:0cm;}
@list l1
        {mso-list-id:657806692;
        mso-list-type:hybrid;
        mso-list-template-ids:292042052 -1413830138 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:18.0pt;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-text:"%2\)";
        mso-level-tab-stop:42.0pt;
        mso-level-number-position:left;
        margin-left:42.0pt;
        text-indent:-21.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ZH-CN link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'>Hi chris,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'> I
meet same question with you. I solute as below:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo5'><![if !supportLists]><font
size=1 color=navy face=Arial><span lang=EN-US style='font-size:9.0pt;
font-family:Arial;color:navy'><span style='mso-list:Ignore'>1.<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=1 color=navy
face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial;
color:navy'>When you declare queue, please announce it to durable.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>private</span></font> <font
color=blue><span style='color:blue'>int</span></font> DecalreQueue(<font
color=blue><span style='color:blue'>string</span></font> [] args)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>string</span></font> serverAddress =
args[0];<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>string</span></font> inputQueueName =
args[1];<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>bool</span></font> durable=<font
color=blue><span style='color:blue'>true</span></font>;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>using</span></font> (<font
color="#2b91af"><span style='color:#2B91AF'>IConnection</span></font> conn = <font
color=blue><span style='color:blue'>new</span></font> <font color="#2b91af"><span
style='color:#2B91AF'>ConnectionFactory</span></font>().CreateConnection(serverAddress))<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>using</span></font> (<font
color="#2b91af"><span style='color:#2B91AF'>IModel</span></font> ch =
conn.CreateModel())<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>string</span></font> finalName =
ch.QueueDeclare(inputQueueName, <font color=blue><span style='color:blue'>false</span></font>,<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
durable, <font color=blue><span style='color:blue'>false</span></font>, <font
color=blue><span style='color:blue'>false</span></font>,<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>false</span></font>, <font
color=blue><span style='color:blue'>null</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color="#2b91af"><span style='color:#2B91AF'>Console</span></font>.WriteLine(<font
color="#a31515"><span style='color:#A31515'>"{0}\t{1}"</span></font>,
finalName, durable);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>return</span></font> 0;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}</span></font><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo5'><![if !supportLists]><font
size=1 color=navy face=Arial><span lang=EN-US style='font-size:9.0pt;
font-family:Arial;color:navy'><span style='mso-list:Ignore'>2.<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=1 color=navy
face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial;
color:navy'>Declare exchange with durable , when send message, bind the queue
to the exchange.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>private</span></font> <font
color=blue><span style='color:blue'>int</span></font> SendString(<font
color=blue><span style='color:blue'>string</span></font> message)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>try<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>string</span></font> serverAddress = <font
color="#a31515"><span style='color:#A31515'>"192.168.1.87"</span></font>;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>string</span></font> exchange = <font
color="#a31515"><span style='color:#A31515'>"yourexchange"</span></font>;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>string</span></font> exchangeType = <font
color="#2b91af"><span style='color:#2B91AF'>ExchangeType</span></font>.Topic;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>string</span></font> routingKey = <font
color="#a31515"><span style='color:#A31515'>"key"</span></font>;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>using</span></font> (<font
color="#2b91af"><span style='color:#2B91AF'>IConnection</span></font> conn = <font
color=blue><span style='color:blue'>new</span></font> <font color="#2b91af"><span
style='color:#2B91AF'>ConnectionFactory</span></font>().CreateConnection(serverAddress))<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>using</span></font> (<font
color="#2b91af"><span style='color:#2B91AF'>IModel</span></font> ch =
conn.CreateModel())<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>if</span></font> (exchange != <font
color="#a31515"><span style='color:#A31515'>""</span></font>)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
ch.ExchangeDeclare(exchange, exchangeType,<font color=blue><span
style='color:blue'>true</span></font>,<font color=blue><span style='color:blue'>false</span></font>,<font
color=blue><span style='color:blue'>false</span></font>,<font color=blue><span
style='color:blue'>false</span></font>,<font color=blue><span style='color:
blue'>false</span></font>,<font color=blue><span style='color:blue'>null</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=green><span style='color:green'>ch.QueueBind("subscriptionqueue",
exchange, routingKey, false, null);<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
ch.BasicPublish(exchange,<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
routingKey,<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>null</span></font>,<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color="#2b91af"><span style='color:#2B91AF'>Encoding</span></font>.UTF8.GetBytes(message));<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>return</span></font> 0;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>catch</span></font> (<font
color="#2b91af"><span style='color:#2B91AF'>Exception</span></font> e)<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
{<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color="#2b91af"><span style='color:#2B91AF'>MessageBox</span></font>.Show(e.Message);<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
<font color=blue><span style='color:blue'>return</span></font> 2;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>Good luck!<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>Best Regards,<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><st1:City w:st="on"><st1:place
w:st="on"><font size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;
font-family:新宋体'>wilson</span></font></st1:place></st1:City><font size=1
color=navy face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial;
color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;font-family:
"Times New Roman"'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
rabbitmq-discuss-bounces@lists.rabbitmq.com
[mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Chris Wiegand<br>
<b><span style='font-weight:bold'>Sent:</span></b> 2009</span></font><font
size=2 face=宋体><span style='font-size:10.0pt;font-family:宋体'>年</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>7</span></font><font
size=2 face=宋体><span style='font-size:10.0pt;font-family:宋体'>月</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>15</span></font><font
size=2 face=宋体><span style='font-size:10.0pt;font-family:宋体'>日</span></font><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> <span
lang=EN-US>7:00<br>
<b><span style='font-weight:bold'>To:</span></b>
rabbitmq-discuss@lists.rabbitmq.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> [rabbitmq-discuss]
RabbitMQ 1.6 persistence?</span></span></font><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;font-family:
"Times New Roman"'><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-US style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-US style='font-size:
11.0pt'>We were trying out RabbitMQ (1.6, just downloaded it last week), and
while it’s throughput is great compared to ActiveMQ, I’m finding that if the
erlang session dies (like say if I kill it, or try to pump in 1 million
messages and it runs out of memory), and then I re-start the RabbitMQ server it
takes a rather long time to load the persistence stuff, but then just clears
out the queues, and the file (rabbit_persister.LOG) just gets truncated and the
messages were not persisted. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-US style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-US style='font-size:
11.0pt'>Am I misunderstanding how RabbitMQ implements persistence? I expected
that if the broker stops, and then gets relaunched that it would reload the
last saved state for the queues, etc.., but that doesn’t seem to be taking
place. We’re running it under Windows, under the most recent version of erlang
(also just downloaded last week), in case that would affect anything. I’ll try
this under Linux and OpenSolaris here soon, in case that makes a difference.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-US style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-US style='font-size:
11.0pt'>I’m using the .Net bindings, and setting the BasicProperties’
DeliveryMode to 2 for persistence, is there anything else I have to do to make
a queue persist? <o:p></o:p></span></font></p>
</div>
</body>
</html>