And, finally, after looking into sorces, I found a way to read the message from a file [code adapted from org.jboss.mq.pm.file.MessageLog.restoreMessageFromFile(TreeMap store, File file) in JBoss-3.2.2]:

    public static void readMessage(String fileName){
        try {

ObjectInputStream in = new ObjectInputStream(new FileInputStream(fileName));
long msgId = in.readLong();
SpyMessage message = SpyMessage.readMessage(in);
in.close();
System.out.println("msgId="+msgId);
System.out.println("message="+message.getLongProperty("sq"));


            SpyObjectMessage omessage = (SpyObjectMessage)message;
            System.out.println("content="+omessage.getObject());

                } catch (IOException ioe) {
                        ioe.printStackTrace();
                } catch (JMSException jmse) {
            jmse.printStackTrace();
                }
    }

Regards,
Horia

P.S. The file message was produced with JBoss-2.4.9, so it seems the code is portable from JBoss-2.4.9 through JBoss-3.2.2.

Horia Muntean wrote:

Hi,

The testing scenario is the same for both versions (JBoss 2.4.9 and JBoss 3.2.1). The diference is that JBoss 2.4.9 is configured with File PM and JBoss 3.2.1 is configured with JDBC PM (hsqldb).

On machine A I have the server started and a client (in a different VM) that simply sends messages to a persistent queue. Every message is "marked" with a sequence.

On machine B I have a queue consumer that reads the messages from the persistent queue.

While the sender client continues to send messages to the queue, I simply unplug the network cable from machine B (where the reader client resides). After the receiver throws an error (obviously) I restart it (after I plug back the netwotk cable). The client reconnects with no problem and continues to consume messages. All this time, the sender client continues to send messages to the queue.

As far as I tested, with JBoss 3.2.1, there is NO message loss, but sometimes one message is delivered out of order after the receiver reconnects(and the reproductibity rate is low).

But with JBoss-2.4.9, after the receiver client reconnects, it does not receive a message (I have a gap in the sequence). If I stop the sender and wait until the receiver consumes all the messages, I can still see a file in the folder dedicated to the queue (since here we have file PM in place). Even if I restart JBoss, the "phantom" message is not available to the receiver, as JBoss reports the queue depth to be 0 (zero). After restart the file is at it's place. This is why I need a way to read the content of this file and take appropiate recovery business actions.

If requred, I can send you the code.

Regards,
Horia

P.S. Both clients connect using default protocol (I think OIL).
All JVMs are SUN's 1.4.2, both machines are WinXP.

Adrian Brock wrote:

On Tue, 2003-10-14 at 11:06, Horia Muntean wrote:

Hi

I am using JBoss-2.4.9 with file PM set up for JBossMQ. This release has a bug (solved partially in 3.2.x series) in the JBossMQ code: if a queue client (in another VM) connected to the server over OIL goes down (due to a network crash for example) and then is brought up again, it will lose a message. The message is still in the persistent directory but never gets consumed.



In what way will it lose a message? All unacknowledged messages
are nacked back into the destination if the client fails -
this assumes the server can detect the client failure.
3.2.2 final will include a ReadTimeout attribute for OIL to help with this, it has been present on UIL2 for a while.


Somebody at the Amsterdam bootcamp gave me the idea to expose the
ClientConsumers as MBeans so you can explicity disconnect clients
or their individual subscriptions.
This won't make it into 3.2.2 final :-(


I wold like to know if I can read this message (stored in a file) with another application in order to take appropiate business actions in case of delivery failure.



I would like to know under what circumstances you can detect the
client has disappeared when jbossmq does not. Then it can be fixed.

Regards,
Adrian



Regards, horia



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user




-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



------------------------------------------------------- This SF.net email is sponsored by OSDN developer relations Here's your chance to show off your extensive product knowledge We want to know what you know. Tell us and you have a chance to win $100 http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to