I encountered some persistence message recovery problems when trying to use durable subscription with MDB's.
Debugging revealed a missing serialization of SpyMessage.header.durableSubscriberID attribute in read/writeExternal()!
Adding the following code fixed the problem
writeExternal(...)
{
...
...
if( header.durableSubscriberID != null )
{
out.writeBoolean( true );
writeString( out, header.durableSubscriberID.clientID );
writeString( out, header.durableSubscriberID.subscriptionName );
writeString( out, header.durableSubscriberID.selector );
}
else
{
out.writeBoolean( false );
}
...
}
readExternal(...)
{
...
...
boolean durable = in.readBoolean();
if( durable )
{
String clientID = readString( in );
String subscriptionName = readString( in );
String selector = readString( in );
header.durableSubscriberID = new DurableSubscriberID( clientID, subscriptionName, selector );
}
else
{
header.durableSubscriberID = null;
}
...
}
Report it as a bug on sourceforge.
www.sf.net/projects/jboss
It probably wants to serialize the object in case it
is sub-classed in the future.
Regards,
Adrian