bimawa / amqprotocol Goto Github PK
View Code? Open in Web Editor NEWAMQProtocol wrapper on libRabbitMQ-C
AMQProtocol wrapper on libRabbitMQ-C
I am getting the following error when the Queue's bindToExchange is executed:
2013-02-28 09:24:06.782 RabbitMQTest[9819:c07] AMQPException: Failed to bind queue to exchange: No such file or directory
I have an example application that runs perfectly that uses the straight C API and appears to call the same methods with the same parameters as AMQP classes. As you can see by the code, I am using a durable queue & exchange that does not get autodeleted.
Here's my code fragment:
NSError *error;
AMQPConnection *connection = [[AMQPConnection alloc] init];
[connection connectToHost:_host.text onPort:[_port.text integerValue] error:&error];
if (error.code != 0)
{
_output.text = [NSString stringWithFormat:@"%@\n%@", _output.text, error.localizedDescription];
return;
}
[connection loginAsUser:@"guest" withPasswort:@"guest" onVHost:VIRTUAL_HOST error:&error];
AMQPChannel *channel = [connection openChannel];
if (channel)
{
AMQPExchange *exchange = [[AMQPExchange alloc] initDirectExchangeWithName:EXCHANGE_NAME onChannel:channel isPassive:NO isDurable:YES getsAutoDeleted:NO error:&error];
AMQPQueue *queue = [[AMQPQueue alloc] initWithName:QUEUE_NAME onChannel:channel isPassive:NO isExclusive:NO isDurable:YES getsAutoDeleted:NO error:&error];
[queue bindToExchange:exchange withKey:BINDING_KEY error:&error];
AMQPConnection _connection = [[AMQPConnection alloc] init];
NSError *error,_error1;
[connection connectToHost:server onPort:port error:&error];
[connection loginAsUser:login withPasswort:password onVHost:@"/" error:&error1];
if (error1) {
NSLog(@"%@", error1);
}
2014-06-30 13:14:11.438 AZApp[62979:60b] Error Domain=AMQPConnection Code=-3 "Failed to login on server." UserInfo=0x99bb0e0 {NSLocalizedDescription=Failed to login on server.}
sending:
00000000: 01 00 01 00 00 00 05 00 : 14 00 0A 00 CE .............
0000000D:
I've checked server, port, login and password. They are OK and working on android device. Why does it shows "Failed to login on server."?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.