29 #include "../../CommException.h"
30 #include "../../MetaData.h"
31 #include "../../EventId.h"
33 #include "../../converter/Converter.h"
37 using namespace rsc::logging;
40 using namespace rsb::transport;
41 using namespace rsb::protocol;
48 logger(rsc::logging::Logger::getLogger(
"rsb.spread.MessageHandler")),
56 RSCDEBUG(
logger,
"new Spread message " << message);
62 if (!fragment->ParseFromString(message->getDataAsString())) {
63 throw CommException(
"Failed to parse notification in pbuf format");
67 "Parsed event seqnum: " << fragment->notification().event_id().sequence_number());
69 "Binary length: " << fragment->notification().data().length());
71 "Number of split message parts: " << fragment->num_data_parts());
73 "... received message part : " << fragment->data_part());
81 "fragmented notification joined, last message " << message);
85 AnnotatedData deserialized = converter->deserialize(notification->wire_schema(),
86 notification->data());
90 fillEvent(event, *notification, deserialized.second, deserialized.first);
91 event->mutableMetaData().setReceiveTime();
99 if (fragment->num_data_parts() > 1) {
102 notification.reset(fragment->mutable_notification(),
103 rsc::misc::ParentSharedPtrDeleter
104 <rsb::protocol::FragmentedNotification>(fragment));