[rabbitmq-discuss] Testing Plugin / Internals Question
Simon MacMullen
simon at rabbitmq.com
Thu Apr 17 13:01:56 BST 2014
On 16/04/2014 18:46, Gavin M. Roy wrote:
> I’m working on a plugin that will let me trigger some internal behaviors
> in RabbitMQ from pika or any other RabbitMQ client for acceptance
> testing purposes. In doing so, I’ve been trying to trace back how to
> get the connection pid() from the channel that is passed as the sender
> in the #delivery record passed into rabbit_exchange_type:route/2.
>
> When I’m issuing rabbit_channel:info(pid()) for the sender, it seems to
> hang and I was hoping that was where I could get the connection pid.
It's not completely clear to me what you are doing, but if this is an
exchange type then bear in mind those callbacks are called by the
channel - and having the channel call into itself will deadlock.
> Does anyone have any suggestions as to where I can get that info?
> Ultimately for this particular piece of functionality, I’m looking to
> trigger rabbit_reader:conserve_resources/3 to force a Connection.Blocked
> frame to be sent. Any alternative ways to trigger that from either the
> exchange or an interceptor would be helpful as well.
If you really want to do that, you could spin up a separate process that
calls into the channel to get its connection pid and then call
conserve_resources().
Personally I'd just trigger the condition broker-wide with "rabbitmqctl
set_vm_memory_high_watermark 0.000001" or similar.
Cheers, Simon
More information about the rabbitmq-discuss
mailing list