Open ivan1986 opened 10 years ago
you can pass it using the connectWithHeaders:completionHandler:
method:
[self.client connectWithHeaders:@{@"virtualhost": @"/"}
completionHandler:^(STOMPFrame *connectedFrame, NSError *error) {
...
}];
self.client = [[STOMPClient alloc] initWithHost:@"localhost" port:61613];
This return error -
[self.client connectWithHeaders:@{@"virtualhost": @"/",kHeaderLogin: @"guest", kHeaderPasscode: @"guest",kHeaderAcceptVersion:@"1.2", kHeaderHeartBeat: @"5000,10000",kHeaderHost:@"localhost"} completionHandler:^(STOMPFrame connectedFrame, NSError error) { ... }];
but if
[self.client connectWithHeaders:@{kHeaderLogin: @"guest", kHeaderPasscode: @"guest",kHeaderAcceptVersion:@"1.2", kHeaderHeartBeat: @"5000,10000",kHeaderHost:@"/"} completionHandler:^(STOMPFrame connectedFrame, NSError error) { ... }];
All is well
what am I doing wrong?
What is the error? What is RabbitMQ expecting to receive?
Have you read https://www.rabbitmq.com/stomp.html?
If a host header is specified it must be one of the virtual hosts known to the RabbitMQ server, otherwise the connection is rejected.
From what I understand, you don't need a virtualhost
header at all.
https://github.com/mobile-web-messaging/StompKit/blob/master/StompKit/StompKit.m#L348 Set virtual host same as host, but by default virtualhost is / need add other option for virtualhost