« Return to Thread: Automated queue creation within a swiftlet

Automated queue creation within a swiftlet

by Chad12 :: Rate this Message:

Reply to Author | View in Thread

I am trying to automate the one-time creation of a new persistent queue from within my Extension Swiftlet (SwiftMQ 7.5.1). Following the example in docs/router/swiftletapi/kernel/queue/index.html I am using the code:
QueueManager manager = (QueueManager)SwiftletManager.getInstance().getSwiftlet("sys$queuemanager");
if (!manager.isQueueDefined(queueName)) {
    try {
        manager.createQueue(queueName, (ActiveLogin)null);
	manager.getQueueForInternalUse(queueName).setPersistenceMode(AbstractQueue.PERSISTENT);
	log.info("Could not find queue ["+queueName+"], now created.");
    } catch (Exception e) {
        log.warn("Unexpected exception, ignoring...", e);
    }
}
And then re-saving configuration with SwiftletManager.getInstance().saveConfiguration(); as previously suggested to me. However when I create the queue in this way, the new queue does not appear to be saved to the configuration file. Strangely, a corresponding JNDI alias is saved, even though the queue itself isn't saved. Am I missing something here or doing something wrong?

 « Return to Thread: Automated queue creation within a swiftlet