mirror of https://github.com/apache/activemq.git
Adding a droppable flag to each message
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@465649 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aab5d8b1fe
commit
39ef23801f
|
@ -83,6 +83,7 @@ abstract public class Message extends BaseCommand implements MarshallAware, Mess
|
|||
private transient ByteSequence cachedWireFormatData;
|
||||
|
||||
private BrokerId [] brokerPath;
|
||||
protected boolean droppable = false;
|
||||
|
||||
abstract public Message copy();
|
||||
|
||||
|
@ -632,4 +633,14 @@ abstract public class Message extends BaseCommand implements MarshallAware, Mess
|
|||
public void onMessageRolledBack() {
|
||||
incrementRedeliveryCounter();
|
||||
}
|
||||
|
||||
/**
|
||||
* @openwire:property version=2 cache=true
|
||||
*/
|
||||
public boolean isDroppable() {
|
||||
return droppable;
|
||||
}
|
||||
public void setDroppable(boolean droppable) {
|
||||
this.droppable = droppable;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
|
|||
info.setArrival(tightUnmarshalLong(wireFormat, dataIn, bs));
|
||||
info.setUserID(tightUnmarshalString(dataIn, bs));
|
||||
info.setRecievedByDFBridge(bs.readBoolean());
|
||||
info.setDroppable(bs.readBoolean());
|
||||
|
||||
info.afterUnmarshall(wireFormat);
|
||||
|
||||
|
@ -128,6 +129,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
|
|||
rc+=tightMarshalLong1(wireFormat, info.getArrival(), bs);
|
||||
rc += tightMarshalString1(info.getUserID(), bs);
|
||||
bs.writeBoolean(info.isRecievedByDFBridge());
|
||||
bs.writeBoolean(info.isDroppable());
|
||||
|
||||
return rc + 9;
|
||||
}
|
||||
|
@ -168,6 +170,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
|
|||
tightMarshalLong2(wireFormat, info.getArrival(), dataOut, bs);
|
||||
tightMarshalString2(info.getUserID(), dataOut, bs);
|
||||
bs.readBoolean();
|
||||
bs.readBoolean();
|
||||
|
||||
info.afterMarshall(wireFormat);
|
||||
|
||||
|
@ -223,6 +226,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
|
|||
info.setArrival(looseUnmarshalLong(wireFormat, dataIn));
|
||||
info.setUserID(looseUnmarshalString(dataIn));
|
||||
info.setRecievedByDFBridge(dataIn.readBoolean());
|
||||
info.setDroppable(dataIn.readBoolean());
|
||||
|
||||
info.afterUnmarshall(wireFormat);
|
||||
|
||||
|
@ -264,6 +268,7 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
|
|||
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
|
||||
looseMarshalString(info.getUserID(), dataOut);
|
||||
dataOut.writeBoolean(info.isRecievedByDFBridge());
|
||||
dataOut.writeBoolean(info.isDroppable());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,5 +80,6 @@ public abstract class MessageTestSupport extends BaseCommandTestSupport {
|
|||
info.setArrival(3);
|
||||
info.setUserID("UserID:16");
|
||||
info.setRecievedByDFBridge(true);
|
||||
info.setDroppable(false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue