1 Reply Latest reply on Sep 10, 2002 11:47 AM by adrian.brock

    Serialization bug in SpyMessage ?

    schrouf

      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;
      }
      ...
      }