0

I was checking for some alternatives for Quartz-scheduler.

Though this is not a complete replacement, I was trying out RabbitMQ Delayed Messages Plugin (suits for my use-case).

I was able to get the scheduling work but I was not to view the messages which are delayed(which are stored in Mnesia).

Is there a way to check the messages and/or number of messages in Mnesia?

Edit : I inferred that the messages are stored in Mnesia from the comment from here.

Karthik
  • 4,950
  • 6
  • 35
  • 65

2 Answers2

0

There is no way to check the messages that RabbitMQ is persisting in it's mnesia database.

RabbitMQ is not a generalized datastore. It is a purpose-built message broker and queueing system. The datastore it has in it is there to facilitate the persistence of messages, not to be queried and used as if it were a database on it's own.

Derick Bailey
  • 72,004
  • 22
  • 206
  • 219
  • Generally yes, but this plug-in seems to use MNESIA to store messages. – Gabriele Santomaggio Sep 14 '15 at 12:30
  • as does all of RabbitMQ when storing messages on disk. that doesn't mean you get access to it. if you really wanted to, you probably could by using an mnesia library. i would highly recommend not doing that. if you need a database, use a database meant for your system. – Derick Bailey Sep 14 '15 at 17:34
  • using a simple erlang client it is possible to check the messages not delivered yet. Only for this plug-in. – Gabriele Santomaggio Sep 14 '15 at 19:35
  • 1
    @DerickBailey default RabbitMQ does not store messages on Mnesia at all. This plugin does. We have an issue that should allow users to inspect the delayed messages, or at least see how many there are: https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/issues/3 – old_sound Sep 28 '15 at 10:34
0

To view the data inside MNESIA you could :

  1. Write a simple Erlang program as this, as result you have:
  (rabbit@gabrieles-MBP)5>
    load:traverse_table_and_show('rabbit_delayed_messagerabbit@gabrieles-MBP').
    {delay_entry,
     {delay_key,1442258857832,
             {exchange,
               {resource,<<"/">>,exchange,<<"my-exchange">>},
                'x-delayed-message',true,false,false,
                [{<<"x-delayed-type">>,longstr,<<"direct">>}],
                undefined,undefined,             {[],[]}}},
         {delivery,false,false,<0.2008.0>,
            {basic_message,
                {resource,<<"/">>,exchange,<<"my-exchange">>},
                 [<<>>],
                {content,60,
                     {'P_basic',undefined,undefined,
                         [{<<"x-delay">>,signedint,100000}],
                         undefined,undefined,undefined,undefined,undefined,
                        undefined,undefined,undefined,undefined,undefined,
                       undefined},
    ..

OR in this way:

  1. execute an Erlang shell session using: erl -set-cookie ABCDEFGHI -sname monitorNode@gabrielesMBP

    you have to use the same cookie that rabbitmq are using.

    Typically $(HOME).erlang.cookie

    1. execute this command:observer:start(). and you should have this:

enter image description here

Once you are connected to rabbitmq node open Table Viewer and from the menu Mnesia table as:

enter image description here

Here you can see your data:

enter image description here

Community
  • 1
  • 1
Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52