Fixing the 'wrong subject' bug.
Change-Id: I6a3497057406f5fffc5cc2a46db2174b20c2ff43
Showing
2 changed files
with
10 additions
and
8 deletions
... | @@ -141,7 +141,7 @@ public class ClusterMessage { | ... | @@ -141,7 +141,7 @@ public class ClusterMessage { |
141 | buffer.get(payloadBytes); | 141 | buffer.get(payloadBytes); |
142 | 142 | ||
143 | return new ClusterMessage(new NodeId(new String(senderBytes, Charsets.UTF_8)), | 143 | return new ClusterMessage(new NodeId(new String(senderBytes, Charsets.UTF_8)), |
144 | - new MessageSubject(new String(senderBytes, Charsets.UTF_8)), | 144 | + new MessageSubject(new String(subjectBytes, Charsets.UTF_8)), |
145 | payloadBytes); | 145 | payloadBytes); |
146 | } | 146 | } |
147 | 147 | ... | ... |
... | @@ -61,13 +61,13 @@ public class DistributedPacketStore | ... | @@ -61,13 +61,13 @@ public class DistributedPacketStore |
61 | private static final int MESSAGE_HANDLER_THREAD_POOL_SIZE = 4; | 61 | private static final int MESSAGE_HANDLER_THREAD_POOL_SIZE = 4; |
62 | 62 | ||
63 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 63 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
64 | - private MastershipService mastershipService; | 64 | + protected MastershipService mastershipService; |
65 | 65 | ||
66 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 66 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
67 | - private ClusterService clusterService; | 67 | + protected ClusterService clusterService; |
68 | 68 | ||
69 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 69 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
70 | - private ClusterCommunicationService communicationService; | 70 | + protected ClusterCommunicationService communicationService; |
71 | 71 | ||
72 | private static final MessageSubject PACKET_OUT_SUBJECT = | 72 | private static final MessageSubject PACKET_OUT_SUBJECT = |
73 | new MessageSubject("packet-out"); | 73 | new MessageSubject("packet-out"); |
... | @@ -90,8 +90,9 @@ public class DistributedPacketStore | ... | @@ -90,8 +90,9 @@ public class DistributedPacketStore |
90 | MESSAGE_HANDLER_THREAD_POOL_SIZE, | 90 | MESSAGE_HANDLER_THREAD_POOL_SIZE, |
91 | groupedThreads("onos/store/packet", "message-handlers")); | 91 | groupedThreads("onos/store/packet", "message-handlers")); |
92 | 92 | ||
93 | - communicationService.addSubscriber( | 93 | + communicationService.addSubscriber(PACKET_OUT_SUBJECT, |
94 | - PACKET_OUT_SUBJECT, new InternalClusterMessageHandler(), messageHandlingExecutor); | 94 | + new InternalClusterMessageHandler(), |
95 | + messageHandlingExecutor); | ||
95 | 96 | ||
96 | log.info("Started"); | 97 | log.info("Started"); |
97 | } | 98 | } |
... | @@ -118,8 +119,9 @@ public class DistributedPacketStore | ... | @@ -118,8 +119,9 @@ public class DistributedPacketStore |
118 | } | 119 | } |
119 | 120 | ||
120 | // TODO check unicast return value | 121 | // TODO check unicast return value |
121 | - communicationService.unicast(new ClusterMessage( | 122 | + communicationService.unicast(new ClusterMessage(myId, PACKET_OUT_SUBJECT, |
122 | - myId, PACKET_OUT_SUBJECT, SERIALIZER.encode(packet)), master); | 123 | + SERIALIZER.encode(packet)), |
124 | + master); | ||
123 | // error log: log.warn("Failed to send packet-out to {}", master); | 125 | // error log: log.warn("Failed to send packet-out to {}", master); |
124 | } | 126 | } |
125 | 127 | ... | ... |
-
Please register or login to post a comment