private void addRouteContextToMessage(final ServerMessage message){
  byte[] ids=message.getBytesProperty(idsHeaderName);
  if (ids == null) {
    ids=new byte[8];
  }
 else {
    byte[] newIds=new byte[ids.length + 8];
    System.arraycopy(ids,0,newIds,8,ids.length);
    ids=newIds;
  }
  ByteBuffer buff=ByteBuffer.wrap(ids);
  buff.putLong(remoteQueueID);
  message.putBytesProperty(idsHeaderName,ids);
  if (logger.isTraceEnabled()) {
    logger.trace("Adding remoteQueue ID = " + remoteQueueID + " into message="+ message+ " store-forward-queue="+ storeAndForwardQueue);
  }
}

private void addRouteContextToMessage ( final ServerMessage message ) { byte [ ] ids = message . getBytesProperty ( idsHeaderName ) ; if ( ids == null ) { ids = new byte [ 8 ] ; } else { byte [ ] newIds = new byte [ ids . length + 8 ] ; System . arraycopy ( ids , 0 , newIds , 8 , ids . length ) ; ids = newIds ; } ByteBuffer buff = ByteBuffer . wrap ( ids ) ; buff . putLong ( remoteQueueID ) ; message . putBytesProperty ( idsHeaderName , ids ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Adding remoteQueue ID = " + remoteQueueID + " into message=" + message + " store-forward-queue=" + storeAndForwardQueue ) ; } }
this will add routing information to the message . this will be later processed during the delivery between the nodes . because of that this has to be persisted as a property on the message .
