Call on received message

        :param kser.schemas.Message kmsg: Kafka message
        :return: Kafka message
        :rtype: kser.schemas.Message
966086
def _onmessage(cls, kmsg):
        
        logger.debug(
            "{}.ReceivedMessage {}[{}]".format(
                cls.__name__, kmsg.entrypoint, kmsg.uuid
            ),
            extra=dict(kmsg=kmsg.dump())
        )
        return cls.onmessage(kmsg)
1123735
def ack_message(self, message):
        
        if message.channel.is_closed:
            LOGGER.warning('Can not ack message, channel is closed')
            self.counters[self.CLOSED_ON_COMPLETE] += 1
            return
        message.channel.basic_ack(delivery_tag=message.delivery_tag)
        self.counters[self.ACKED] += 1
        self.measurement.set_tag(self.ACKED, True)
1301186
def _on_status_message(self, sequence, topic, message):
        

        self._logger.debug("Received message on (topic=%s): %s" % (topic, message))

        try:
            conn_key = self._find_connection(topic)
        except ArgumentError:
            self._logger.warn("Dropping message that does not correspond with a known connection, message=%s", message)
            return

        if messages.ConnectionResponse.matches(message):
            if self.name != message['client']:
                self._logger.debug("Connection response received for a different client, client=%s, name=%s", message['client'], self.name)
                return

            self.conns.finish_connection(conn_key, message['success'], message.get('failure_reason', None))
        else:
            self._logger.warn("Dropping message that did not correspond with a known schema, message=%s", message)
383190
def _handleMessage(self, src_socket, msg):
        '''
        
        '''
        self._logger.debug('Message received: {!r}'.format(msg))

        # Check where the message came from and determine where it's going
        if src_socket is self._socket_a:
            src_name, src_host, src_port = 'A', self._host_a, self._port_a
            dst_name, dst_host, dst_port = 'B', self._host_b, self._port_b
            dst_socket = self._socket_b
        elif src_socket is self._socket_b:
            src_name, src_host, src_port = 'B', self._host_b, self._port_b
            dst_name, dst_host, dst_port = 'A', self._host_a, self._port_a
            dst_socket = self._socket_a
        else:
            self._logger.warning(
                'Message received from unknown socket! How is '
                'this possible?! Ignoring.')
            return False

        self._logger.debug(
            'Message received from host {:} ({!s}:{!s}), routing to host {:} '
            '({!s}:{!s})'
            .format(
                src_name, src_host, src_port,
                dst_name, dst_host, dst_port))

        # If the message is empty or non-existent then the connection has
        # closed
        if not msg or msg == '':
            self._logger.info(
                'Connection to host {:} closed'.format(src_name))
            return True

        # Apply middleware to the message if middleware exists
        if self._message_middleware is not None:
            msg = self._message_middleware(
                msg,
                src_name, src_host, src_port,
                dst_name, dst_host, dst_port)

        # Finally send the message
        dst_socket.send(msg)

        return False
542029
def mass_inform(self, msg):
        
        assert (msg.mtype == Message.INFORM)
        return self._mass_send_message(msg)
619563
def messageReceived(self, message):
        
        msgId, msg = message[0], message[2:]
        self._releaseId(msgId)
        d, canceller = self._requests.pop(msgId, (None, None))

        if canceller is not None and canceller.active():
            canceller.cancel()

        if d is None:
            # reply came for timed out or cancelled request, drop it silently
            return

        d.callback(msg)
337734
def on_message(self, ws, message):
        
        try:
            data = json.loads(message)
        except Exception:
            self._set_error(message, "decode message failed")
        else:
            self._inbox.put(RTMMessage(data))
494608
def on_message(self, message_protocol_entity):
        
        logger.info("Message id %s received" % message_protocol_entity.getId())
        # answer with receipt
        self.toLower(message_protocol_entity.ack())
1192632
def received_new(self, msg):
        
        logger.info("Receiving msg, delivering to Lamson...")
        logger.debug("Relaying msg to lamson: From: %s, To: %s",
                     msg['From'], msg['To'])
        self._relay.deliver(msg)
500245
private void receiveMessage() {
		MessagingSystemInfo messagingSystemInfo = oneAgentSdk.createMessagingSystemInfo("DynatraceSample", "theQueue", MessageDestinationType.QUEUE, ChannelType.IN_PROCESS, null);
		IncomingMessageReceiveTracer incomingMessageReceiveTracer = oneAgentSdk.traceIncomingMessageReceive(messagingSystemInfo);
		incomingMessageReceiveTracer.start();
		try {
			Message msg = queueManager.receive("theQeue");
			if (msg == null) {
				return; // no message received
			}
			IncomingMessageProcessTracer incomingMessageProcessTracer = oneAgentSdk.traceIncomingMessageProcess(messagingSystemInfo);
			// store incoming tag to tracer:
			incomingMessageProcessTracer.setDynatraceStringTag(msg.getProperty(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME));
			incomingMessageProcessTracer.setVendorMessageId(msg.getVendorMessageId());
						incomingMessageProcessTracer.start();
			try {
				// do something with the message ...
				System.out.println("Message received: " + msg.toString());
			} catch (Exception e) {
				incomingMessageProcessTracer.error(e);
			} finally {
				incomingMessageProcessTracer.end();
			}
			
			
		} catch (Exception e) {
			incomingMessageReceiveTracer.error(e);
		} finally {
			incomingMessageReceiveTracer.end();
		}
	}
237401
def bulk_send(self, topic, kmsgs):
        

        try:
            self.client.do_request(
                method="POST", path="/topic/{}".format(topic), data=[
                    dict(Value=k.MARSHMALLOW_SCHEMA.dump(k)) for k in kmsgs
                ]
            )
            return Result(stdout="{} message(s) sent".format(len(kmsgs)))

        except Exception as exc:
            return Result.from_exception(exc)
564909
def _dry_message_received(self, msg):
        """"""
        for callback in self._dry_wet_callbacks:
            callback(LeakSensorState.DRY)
        self._update_subscribers(0x11)
663243
def on_message(self, *args, accept_query=False, matcher=None, **kwargs):
        

        if accept_query:
            def new_matcher(msg: Message):
                ret = True
                if matcher:
                    ret = matcher(msg)
                    if ret is None or ret is False:
                        return ret
                if msg.recipient is not self and not isinstance(msg.sender, User):
                    return False
                return ret
        else:
            kwargs.setdefault("channel", self.name)
            new_matcher = matcher
        return self.client.on_message(*args, matcher=new_matcher, **kwargs)
725320
def _sendMessage(self, msg):
        
        if not msg:
            return
        msg = self._collapseMsg(msg)
        self.sendStatus(msg)
1127743
def send(self, topic, kmsg):
        
        try:
            self.client.do_request(
                method="POST", params=dict(format="raw"),
                path="/topic/{}".format(topic),
                data=kmsg.MARSHMALLOW_SCHEMA.dump(kmsg)
            )
            result = Result(
                uuid=kmsg.uuid, stdout="Message sent: {} ({})".format(
                    kmsg.uuid, kmsg.entrypoint
                )
            )

        except Exception as exc:
            result = Result.from_exception(exc, kmsg.uuid)

        finally:
            # noinspection PyUnboundLocalVariable
            if result.retcode < 300:
                return self._onsuccess(kmsg=kmsg, result=result)
            else:
                return self._onerror(kmsg=kmsg, result=result)
598425
function Message(payload, checksum, magic, compression){
  // note: payload should be a Buffer
  var _compression = COMPRESSION_DEFAULT;

  // compression:
  // 0 = none; 1 = gzip; 2 = snappy;
  // Only exists at all if MAGIC == 1
  if (!!magic && magic == 1){
    if (_.include([0,1,2], compression)){
      _compression = compression;
    } else {
      throw "InvalidCompressionType: " + compression;
    }
  }
  this.compression = _compression;
  this.MAGIC_IDENTIFIER_DEFAULT = 1;
  if (magic === undefined){ 
    this.magic = this.MAGIC_IDENTIFIER_DEFAULT;
  } else { 
    this.magic = magic;
  }
  if (this.magic !== 0 && this.magic !== 1){
    throw "Unsupported Kafka message version: " + this.magic;
  }
  if (!payload && payload !== ''){
    throw "payload is a required argument";
  }
  this.payload = payload;
  this.checksum = checksum || this.calculateChecksum();
}
1269708
def on_message_received(self, msg):
        
        if self.is_stopped:
            raise RuntimeError("reader has already been stopped")
        else:
            self.buffer.put(msg)