[rabbitmq-discuss] Appear ''SharedQueue closed" Error when i send RabbitMQ Message in MonoProject(iOS)
uniguyit
zhujun.corp at gmail.com
Sat Jan 19 12:38:34 GMT 2013
I have correctly send message in MonoTouch Project using RabbitMQ.NET Client
DLL.
and use this to get receive messages(all parameters is correct):
IModel channel=null;
string ServerIP="192.168.68.4";
string queueName="172.16.1.1";
//int port=15672;
ConnectionFactory cf=new ConnectionFactory();
cf.HostName=ServerIP;
//
cf.Protocol=RabbitMQ.Client.Protocols.DefaultProtocol;
IConnection conn=cf.CreateConnection();
Console.WriteLine ("factory.CreateConnection()");
channel = conn.CreateModel ();
Console.WriteLine ("RECEIVE :
_RMQConnection.CreateModel()");
channel.QueueDeclare(queueName, true,
false,false,null);
_receiveMessageConsumer = new
QueueingBasicConsumer(channel);
channel.BasicConsume(queueName, true,
_receiveMessageConsumer);
Console.WriteLine("channel.BasicConsume(_QueueName, true,
_receiveMessageConsumer)....");
while (_DoneFlag==false) {
object result = null;
_receiveMessageConsumer.Queue.Dequeue(400, out result);
BasicDeliverEventArgs messageInEnvelope =
null;
if (result!=null)
{
messageInEnvelope =
(BasicDeliverEventArgs)result;
}
if (messageInEnvelope == null) {
Console.WriteLine("messageInEnvelope == null)");
continue;
}
byte[] bytes =
messageInEnvelope.Body;
string
str=System.Text.Encoding.UTF8.GetString(bytes);
Console.WriteLine("接受到的消息:" + str);
//RMQMessage msg =
JsonConvert.DeserializeObject<RMQMessage>(System.Text.Encoding.UTF8.GetString(bytes));
//System.Threading.Thread.Sleep(30);
}
---> When i send message to RabbitMQ Server(by manual or programmiaclly) ,
it occurs ''SharedQueue closed" Error (System.IO.EndOfStreamException )....
help :)
Those are all exception information:
System.IO.EndOfStreamException: SharedQueue closed
at RabbitMQ.Util.SharedQueue.EnsureIsOpen () [0x00000] in <filename
unknown>:0
at RabbitMQ.Util.SharedQueue.Dequeue (Int32 millisecondsTimeout,
System.Object& result) [0x00000] in <filename unknown>:0
at RabbitMQ_MonoTouchTest.MainViewController.StartReceiveTest1 ()
[0x00082] in
/Users/yj/Desktop/RMQ2/RabbitMQ/RabbitMQ_MonoTouchTest/MainViewController.cs:163
at RabbitMQ_MonoTouchTest.MainViewController.ViewDidLoad () [0x00006] in
/Users/yj/Desktop/RMQ2/RabbitMQ/RabbitMQ_MonoTouchTest/MainViewController.cs:63
at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String
principalClassName, System.String delegateClassName) [0x0004c] in
/Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
at RabbitMQ_MonoTouchTest.Application.Main (System.String[] args)
[0x00000] in
/Users/yj/Desktop/RMQ2/RabbitMQ/RabbitMQ_MonoTouchTest/Main.cs:27
--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/Appear-SharedQueue-closed-Error-when-i-send-RabbitMQ-Message-in-MonoProject-iOS-tp24584.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss
mailing list