<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Segoe UI'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV> </DIV>
<DIV>Hi, </DIV>
<DIV> I am trying to create an exchange of
type <STRONG>Topic</STRONG>. </DIV>
<DIV> </DIV>
<DIV> Using PUT method to rabbitmq
server, i was able to create one, but the type is always
<STRONG>fanout</STRONG>.</DIV>
<DIV> </DIV>
<DIV>Below is the code i used.</DIV>
<DIV> </DIV>
<DIV>Please tell what i am wrong here?</DIV>
<DIV> </DIV>
<DIV>Code: </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>var httpWebRequest = (HttpWebRequest)WebRequest.Create("<A
href='http://guest:guest@rabbitmqserver/endpoint/x/exchangeName");'>http://guest:guest@rabbitmqserver/endpoint/x/exchangeName");</A></DIV>
<DIV>httpWebRequest.ContentType = "application/json";</DIV>
<DIV>httpWebRequest.Method = "PUT";</DIV>
<DIV>var data= new Dictionary<string, string>();</DIV>
<DIV>data.Add("type", "topic");</DIV>
<DIV>data.Add("auto_delete", false.ToString().ToLower());</DIV>
<DIV>data.Add("durable", true.ToString().ToLower());</DIV>
<DIV> </DIV>
<DIV>using (var streamWriter = new
StreamWriter(httpWebRequest.GetRequestStream()))</DIV>
<DIV>{</DIV>
<DIV> </DIV>
<DIV> string json = JsonConvert.SerializeObject(data);</DIV>
<DIV> </DIV>
<DIV> streamWriter.Write(json);</DIV>
<DIV> streamWriter.Flush();</DIV>
<DIV> streamWriter.Close();</DIV>
<DIV> </DIV>
<DIV> var httpResponse =
(HttpWebResponse)httpWebRequest.GetResponse();</DIV>
<DIV> using (var streamReader = new
StreamReader(httpResponse.GetResponseStream()))</DIV>
<DIV> {</DIV>
<DIV> var result =
streamReader.ReadToEnd();</DIV>
<DIV> }</DIV>
<DIV>}</DIV>
<DIV
style="FONT-FAMILY: 'Segoe UI'; COLOR: #000000; FONT-SIZE: 10pt"><BR>Regards,
<BR>Lijo Sebastian<BR>Senior Software Engineer<BR>Citrus Informatics (India) Pvt
Ltd.</DIV></DIV></DIV></BODY></HTML>