我有一个将消息提交到远程RMQ
服务器上的交换的 Objective C 提供程序。我有一个消费者正在监听绑定到该交换的队列。我正在使用扇出。当从 Xcode 运行应用程序一切正常时,消息被发送,消费者接收它。
但是,当从 iPhone 设备运行应用程序时,消息不会显示在管道的末端。
这是我的发送方法:
- (void) send {
RMQConnection *conn = [[RMQConnection alloc] initWithUri:@"amqp://<user>:<pass>@<ip>:5672"
delegate:[RMQConnectionDelegateLogger new]];
//RMQConnection *conn = [[RMQConnection alloc] initWithDelegate:[RMQConnectionDelegateLogger new]];
[conn start];
id<RMQChannel> ch = [conn createChannel];
RMQExchange *x = [ch fanout:@"logs"];
NSString *mobilemsg = @"{\"test\" : \"test\" }";
[x publish:[mobilemsg dataUsingEncoding:NSUTF8StringEncoding]];
NSLog(@"Sent %@", mobilemsg);
[conn close];
}