Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full support for basic commands in amqp 0.9.1 #2

Closed
aaronstaves opened this issue Apr 8, 2011 · 2 comments
Closed

Full support for basic commands in amqp 0.9.1 #2

aaronstaves opened this issue Apr 8, 2011 · 2 comments

Comments

@aaronstaves
Copy link

Just started using the library, so just let me know if I'm out of line :). I'm using rabbitmq 2.4.1 on Ubuntu server 10.04.

It looks like you can just send basic commands using $ch->invoke, but it looks like there isn't support for all 0.9.1 basic commands (as documented here - http://www.rabbitmq.com/amqp-0-9-1-quickref.html); purge and delete being 2 examples.

Is there support for these commands or am I just missing something ? If not, any timeline as to when they might get implemented ?

@aaronstaves
Copy link
Author

Looks like this isn't a basic command but a queue command!

$purgeParams = array(
'queue' => 'amqphp'
);
$purgeCommand = $ch->queue('delete', $purgeParams);
$resp = $ch->invoke($purgeCommand);

Sorry for clogging up the issues tab :-|

@BraveSirRobin
Copy link
Owner

Hi Aaron,

The basic procedure for calling Amqp methods is a 2 step process, as outlined in the docs in the section "AMQP 0.9.1 and the Amqphp API" (i.e. here: https://github.com/BraveSirRobin/amqphp/wiki/Documentation):

$msg = $chan->$amqpClass($amqpMethod, array('p1' => 'p1 value'), "method payload");
$resp = $chan->invoke($msg);

With reference to the Amqp guide on the RabbitMQ site, $amqpClass is one of 'basic', 'channel', 'confirm', etc.. and $amqpMethod is one of the methods listed in that class. In the first line of code above you're not actually sending anything over the network, this happens in the second line.

Amqphp should have full support for all Amqp and Rabbitmq Amqp extensions, but this depends on which XML file you use to generate the bindings. As time goes by the RabbitMQ people are adding more and more new Amqp commands, so if you ever find you're missing one of these you probably need to update your bindings by downloading the latest XML file and re-running the generation script.

HTH,
--Robin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants