[rabbitmq-discuss] Exchange details are not set while creating with Put Method in c#
lijo at citrusinformatics.com
Tue Nov 26 10:12:17 GMT 2013
Yes i do read the response.
The response says with StatusDescription Created.
Also i can see from management console that which exchanges are present and
not. So there is no chance of someone came and create any.
Regarding the coding, i may or may not be a non-c# expert, but this is the
basic format of creating a HttpWebRequest in c#.
I tried without specifying any of the type of exchange, it is still creating
the same fanout type.
Senior Software Engineer
Citrus Informatics (India) Pvt Ltd.
From: Simon MacMullen
Sent: Tuesday, November 26, 2013 3:15 PM
To: Discussions about RabbitMQ
Cc: Lijo Sebastian
Subject: Re: [rabbitmq-discuss] Exchange details are not set while creating
with Put Method in c#
If you don't specify the exchange type (somehow) then the default is
direct, not fanout. And your code looks right as a non-C# expert. So I
suspect that someone previously declared a fanout exchange with the same
name. The server should be responding with 400 Bad Request and an error
message - are you checking the response?
On 26/11/2013 06:48, Lijo Sebastian wrote:
> I am trying to create an exchange of type *Topic*.
> Using PUT method to rabbitmq server, i was able to create one,
> but the type is always *fanout*.
> Below is the code i used.
> Please tell what i am wrong here?
> var httpWebRequest =
> httpWebRequest.ContentType = "application/json";
> httpWebRequest.Method = "PUT";
> var data= new Dictionary<string, string>();
> data.Add("type", "topic");
> data.Add("auto_delete", false.ToString().ToLower());
> data.Add("durable", true.ToString().ToLower());
> using (var streamWriter = new
> string json = JsonConvert.SerializeObject(data);
> var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
> using (var streamReader = new
> var result = streamReader.ReadToEnd();
> Lijo Sebastian
> Senior Software Engineer
> Citrus Informatics (India) Pvt Ltd.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss