[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The persistant Message



Hi Jonathan,

client 'A' should publish his messages to the xmlBlaster persitent. You have to set the 'isDurable'-Flag
in the qos of the MessageUnit. See follow example:

---- cut -----
PublishQosWrapper qos = new PublishQosWrapper(true); // = <qos><isDurable /></qos>
String xmlKey = "<key oid='client_a_id'>\n" +
                    "<person pid='10' gid='200'>" +
                      "<name age='32' sex='f'>John</name>"+
                   "</person>" +
                 "</key>";
String content = "Content for client b,c,and the rest of the world";
MessageUnit mu = new MessageUnit(xmlKey, content.getBytes(), qos);
....
String returnedOid = senderConnection.publish(mu);
.... continue ....
-----------------
Now the message is persitent in the xmlBlaster. At the moment the messages are stored in a filedb.
See in the reference-handbook 'engine.persitence.mudb. A MessageUnit-database coming soon.

You can turn on the persitence in the xmlBlaster.properties. Set the FileDrive and the persitence
path, which are the messages stored. If you shutdown the xmlBlaster and then startup, a lazy recovery
load the persistence messages in the xmlBlaster.

---- xmlBlaster.properties -----
Persistence.Driver=org.xmlBlaster.engine.persistence.filestore.FileDriver
Persistence.Path=${user.home}/tmp/persistence
Persistence.LazyRecovery=true

Now client b,c.. can connect to the xmlBlaster two days later. Client b,c subscribe these
message, which is published from client 'a' for 2 days ago.

Regards,
Manuel




Jonathan Lee wrote:

Hello All:
The xmlBlaster is very interesting, but I'd like to ask one question:
I have a server which will run xmlBlaster server. I also have several
clients.
One of the clients is mainly used to publish different kinds of message.
But I can not sure other clients will always conenct to the network.

For example, client a,b,c,d.
Client a published a message. Client b seems interested to this message, but
it do not connect to the network. Is there any method that when Client b
connect to the network (say, 2 days later), it can get all the messages
during these 2 days?

Thanks.

Jonathan.

-- 

 --------------------------------------------------------------------
| Manuel Kron,                    |                                  |
| Dipl.-Ing. Softwaretechnik (FH) |   eMail:   manuel.kron at gmx.net   |
| Gartenstr. 11                   |   fon  :   07531 / 282 770       |
| D-78462 Konstanz, Germany       |   mobil:   0174  / 44 21 491     |
 --------------------------------------------------------------------
| XML Open Source Development         http://www.xmlBlaster.org      | 
|    The only XML based MOM (Message-Oriented Middleware)            |
 --------------------------------------------------------------------