You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2009/03/13 12:15:25 UTC
svn commit: r753201 - in /activemq/activemq-blaze/trunk/src/main:
java/org/apache/activeblaze/BlazeChannelImpl.java
java/org/apache/activeblaze/BlazeMessage.java proto/blaze.proto
Author: rajdavies
Date: Fri Mar 13 11:15:25 2009
New Revision: 753201
URL: http://svn.apache.org/viewvc?rev=753201&view=rev
Log:
rationalize proto data
Modified:
activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java
activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java
activemq/activemq-blaze/trunk/src/main/proto/blaze.proto
Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java?rev=753201&r1=753200&r2=753201&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeChannelImpl.java Fri Mar 13 11:15:25 2009
@@ -250,40 +250,8 @@
dispatch(data);
}
- protected final BlazeMessage buildBlazeMessage(PacketData data) throws Exception {
- BlazeMessage result = null;
- if (this.blazeMessageProcessor != null) {
- result = this.blazeMessageProcessor.processBlazeMessage(data);
- } else {
- if (data != null) {
- DestinationData destination = data.getDestinationData();
- Buffer payload = data.getPayload();
- BlazeDataBuffer blazeData = BlazeDataBuffer.parseUnframed(payload);
- String fromId = null;
- if (data.hasProducerId()) {
- fromId = data.getProducerId().toStringUtf8();
- }
- result = createMessage(fromId);
- result.setDestination(destination);
- result.setFromId(fromId);
- if (data.hasMessageId()) {
- result.setMessageId(data.getMessageId().toStringUtf8());
- }
- if (data.hasCorrelationId()) {
- result.setCorrelationId(data.getCorrelationId().toStringUtf8());
- }
- result.setTimeStamp(blazeData.getTimestamp());
- result.setType(data.getPayloadType());
- result.setContent(blazeData);
- }
- }
- return result;
- }
-
- protected BlazeMessage createMessage(String fromId) {
- return new BlazeMessage();
- }
-
+
+
protected final void dispatch(PacketData data) throws Exception {
if (data != null) {
BlazeMessage message = null;
@@ -327,4 +295,35 @@
Packet packet = new Packet(packetData.freeze());
return packet;
}
+
+ protected final BlazeMessage buildBlazeMessage(PacketData data) throws Exception {
+ BlazeMessage result = null;
+ if (this.blazeMessageProcessor != null) {
+ result = this.blazeMessageProcessor.processBlazeMessage(data);
+ } else {
+ if (data != null) {
+ DestinationData destination = data.getDestinationData();
+ Buffer payload = data.getPayload();
+ BlazeDataBuffer blazeData = BlazeDataBuffer.parseUnframed(payload);
+ String fromId = null;
+ if (data.hasProducerId()) {
+ fromId = data.getProducerId().toStringUtf8();
+ }
+ result = new BlazeMessage();
+ result.setDestination(destination);
+ result.setFromId(fromId);
+ if (data.hasMessageId()) {
+ result.setMessageId(data.getMessageId().toStringUtf8());
+ }
+ if (data.hasCorrelationId()) {
+ result.setCorrelationId(data.getCorrelationId().toStringUtf8());
+ }
+ result.setTimeStamp(blazeData.getTimestamp());
+ result.setType(data.getPayloadType());
+ result.setContent(blazeData);
+ }
+ }
+ return result;
+ }
+
}
Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java?rev=753201&r1=753200&r2=753201&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/BlazeMessage.java Fri Mar 13 11:15:25 2009
@@ -1260,15 +1260,6 @@
if (this.replyTo != null) {
bd.setReplyToData(this.replyTo.getData());
}
- if (this.messageId != null) {
- bd.setMessageId(new UTF8Buffer(this.messageId));
- }
- if (this.correlationId != null) {
- bd.setCorrelationId(new UTF8Buffer(this.correlationId));
- }
- if (this.fromId != null) {
- bd.setFromId(new UTF8Buffer(this.fromId));
- }
if (this.messageType != null) {
bd.setMessageType(new UTF8Buffer(this.messageType));
}
@@ -1304,15 +1295,6 @@
if (data.hasReplyToData()) {
this.replyTo = new Destination(data.getReplyToData());
}
- if (data.hasFromId()) {
- this.fromId = data.getFromId().toStringUtf8();
- }
- if (data.hasMessageId()) {
- this.messageId = data.getMessageId().toStringUtf8();
- }
- if (data.hasCorrelationId()) {
- this.correlationId = data.getCorrelationId().toStringUtf8();
- }
if (data.hasMessageType()) {
this.messageType = data.getMessageType().toStringUtf8();
}
Modified: activemq/activemq-blaze/trunk/src/main/proto/blaze.proto
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/proto/blaze.proto?rev=753201&r1=753200&r2=753201&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/proto/blaze.proto (original)
+++ activemq/activemq-blaze/trunk/src/main/proto/blaze.proto Fri Mar 13 11:15:25 2009
@@ -58,14 +58,10 @@
optional int32 redeliveryCounter = 3;
optional int64 timestamp = 4;
optional int64 expiration = 5;
- optional bytes messageId = 6;
- optional bytes correlationId = 7;
- optional bytes fromId =8;
optional bytes messageType = 9;
- optional bytes payload = 10;
- optional DestinationData replyToData = 11;
- optional MapData mapData = 12;
- optional bytes payload = 13;
+ optional DestinationData replyToData = 10;
+ optional MapData mapData = 11;
+ optional bytes payload = 12;
}
message AckData {