Question

During backup I want to pause all JMS queues in HornetQ, in order to take a snapshot of the disk. In jboss-cli I am calling:

connect   
/subsystem=messaging/hornetq-server=default/jms-queue=%queueName:pause

But the queue is not pausing. How can I pause all JMS jobs?

UPD

Steps to reproduce:

root@debian:/opt/jboss/bin# ./jboss-cli.sh 
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default/jms-queue=AIIndex:pause         
{
    "outcome" => "success",
    "result" => undefined
}
[standalone@localhost:9999 /] 

But When I call

[standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default/jms-queue=AIIndex:count-messages
{
"outcome" => "success",
 "result" => 128L
}

So whenever I call /subsystem=messaging/hornetq-server=default/jms-queue=AIIndex:count-messages it shows different values.

Was it helpful?

Solution

I can reproduce it: pause just disables message reception (a receiver won't get any messages, and there is no error message). But it's still possible to send messages. I haven't found any other operation either, neither on the queue nor on the subsystem level. So I can only confirm that it does not work as "expected".


HornetQ uses a journal internally. A quote:

The HornetQ journal is append only with a configurable file size, which improves performance by enabling single write operations. It consists of a set of files on disk, which are initially pre-created to a fixed size and filled with padding. As server operations (add message, delete message, update message, etc.) are performed, records of the operations are appended to the journal until the journal file is full, at which point the next journal file is used.

As for journal flush/sync another quote:

journal-sync-transactional

If true, HornetQ ensures all transaction data is flushed to disk on transaction boundaries (commit, prepare, and rollback). The default is true.

journal-sync-non-transactional

If true, HornetQ ensures non-transactional message data (sends and acknowledgments) are flushed to disk. The default is true.

That doesn't look too bad, but I have not found a confirmation that it's OK to backup the .../data/messaging*/ directories. Possibly there is not solution to get a consistent backup from the "outside".


So the only reliable way that I am aware of is to use an active/passive setup: A quote:

HornetQ allows pairs of servers to be linked together as live - backup pairs. In this release there is a single backup server for each live server. A backup server is owned by only one live server. Backup servers are not operational until fail-over occurs.

This approach works from "within JBoss" to have a backup (which is not a file system backup though).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top