The MDB already work this way, if destination does not exist, it is created (and removed when undeployed).
If nothing has changed recently, destination created through the MBean interface will be removed when server is restarted. Yes. Hiram, is this still correct?
In 3.0 you will however be able to deploy destinations through the new MLet *.sar deployment chema.
I understand that the MDB can be removed when it is not
consuming messages. That is OK. But I don't want the
queue itself to go away just because the server is
stopped and then restarted.
Assume for the sake of argument that the JBOSS server
is "empty" - there are no JMS destination in it and there
are no applications deployed into it.
If I then run my deployment client application, this
application will talk to the JMSServer mbean to create
queues and the Deployer MBean to deploy the actual
EJB application. Let's say that it consists of a
stateless session bean A and a message driven bean B
connected by a queue Q:
A --> ----> B ! ! ----> Q ---
Initially Q is empty.
Now a client calls a business method in A. In this
business method, which uses container managed
transaction support, a data item is written to the
queue Q. After the business method returns the
container will commit the operation so that the data
item really ends up in the persistent queue Q.
Then something bad happens (power failure) and the
JBOSS server is terminated.
When the JBOSS server is restarted it would be nice
if the data item was still in the queue so that B
can consume it. But if I understand the JBOSS docs
correctly, the queue Q will not even be around anymore
in Jboss 2.5.x because the queue was created
Why will Jboss 2.5.x not keep programmatically
created queues across server restarts?
The problem is that when when we had the jbossmq.xml file, we would update it to reflect addtions of queues and such. With us getting rid up the jbossmq.xml file and loading all the config info from jboss.jcml, we no longer update the config file to reflect the addition of the queue.
Long term, I think we will move to creating a *.sar style configuration for configuring queues/topics as that would allows us to add and remove queue configurations verry easily.
Thanks for your reply.
So it seems my deployer app will have to try to update
the jboss.jcml file. While I am slightly disturbed by
this I suppose that this can be done. At least it
should be fairly easy to write code that adds entries
But is this safe? Does the JBOSS server survive
if this file is changed while the server is running?
Are there ways to tell a running JBOSS server that
it should re-read the file to pick up the most
recent changes? It would be a nuisance to have to
stop and restart the entire server just because
one queue / topic entry has been added to the file.