0

I have an Objective C provider that submits messages to an exchange on a remote RMQ server. I have a consumer listening on a queue bind to that exchange. I am using fanout. when running the application from Xcode all is working well, the message is sent an the consumer receives it.

however, when running the application from the iPhone device the message does not show up at the end of the pipe.

Here is my send method:

- (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];

}
Ravi Dhorajiya
  • 1,531
  • 3
  • 21
  • 26
  • althought it does not look like it, I use user:password combination on the URL like this: RMQConnection *conn = [[RMQConnection alloc] initWithUri:@"amqp://user:password@:5672" delegate:[RMQConnectionDelegateLogger new]]; – Eitan Doron Aug 10 '16 at 00:23
  • I have added a receive method - the app does receives messages post by other non IOS clients, looking even further it seems like the message never reaches the exchange - this is only happening on the IOS client. there is no error message. – Eitan Doron Aug 11 '16 at 18:38
  • Seems like some configuration error, but I am not yet sure what I am missing. – Eitan Doron Aug 12 '16 at 18:36

1 Answers1

0

Something to check first of all: your iPhone is on the same network as the RabbitMQ broker. Is the broker running on a machine on a local network? If so, is the phone connected to that network via wifi? Can you e.g. connect an HTTP client from the phone to an HTTP server on the same machine as the Rabbit broker?

There hasn't been any testing of this client on devices yet, so you could absolutely be hitting a bug. Please file it on our Issues page if you believe that to be the case.

I'd be interested to see what happens if you remove the [conn close]; line. It shouldn't be the case, but it's possible that the internal queueing isn't quite right and that it's closing the connection prematurely.

Andrew Bruce
  • 224
  • 1
  • 6