Creates a FLUSH_REQ message.

@param body the data of the request.
@return a protobuf message.
1348
public static Message buildFlushRequest(ByteBuffer body) {
    ZabMessage.FlushRequest flushReq =
      ZabMessage.FlushRequest.newBuilder().setBody(ByteString.copyFrom(body))
                                          .build();
    return Message.newBuilder().setType(MessageType.FLUSH_REQ)
                               .setFlushRequest(flushReq)
                               .build();
  }
960339
public HttpMethod createRequestMethod(HttpRequestHeader header, HttpBody body) throws URIException {
		return createRequestMethod(header, body, null);
	}
27078
public ResponseEncapsulation sendRequest(MessageType type, byte[] body) throws IOException {
    sendRequestHeader(type, (body != null) ? body.length : 0);
    if (body != null) {
      os.write(body);
    }
    return recvMessage();
  }
1104135
function createMessage(status) {

        var message = [];

        message.push(broadcastIdentifier);
        message.push(compabilityVersion);
        message.push(netId);
        message.push(id);
        message.push(name);
        message.push(self.port);
        message.push(status);
        //message.push(mode);
        payloadLength = payload.length;
        message.push(payloadLength + ':' + payload);

        var messageString = message.join(" ");

        return new Buffer(messageString);

    }
429323
public BaseMessageQueue getMessageQueue(String strQueueName, String strQueueType)
    {
        // Look up the message Queue!
        BaseMessageQueue messageQueue = (BaseMessageQueue)super.getMessageQueue(strQueueName, strQueueType);
        if (messageQueue != null)
            return messageQueue;
        Object server = null;
        boolean bCreateIfNotFound = false;
        if (((this.getApplication().getProperty(DBParams.REMOTE_HOST) != null) && (this.getApplication().getProperty(DBParams.REMOTE_HOST).length() > 0))
            || (this.getApplication().getProperty(DBParams.REMOTE_APP_NAME) != null))
                bCreateIfNotFound = true;   // If you explicitly specify a remote server, create the server if new.
        if (((BaseApplication)this.getApplication()).getEnvironment().getDefaultApplication() != null)
            if (!MessageConstants.LOCAL_QUEUE.equalsIgnoreCase(strQueueType))
                if ((!DBConstants.TRUE.equalsIgnoreCase(this.getApplication().getProperty(DBParams.MESSAGE_SERVER)))  // Don't try to get a remote message server if I am the remote message server
                    && (!DBParams.LOCAL.equalsIgnoreCase(this.getApplication().getProperty(DBParams.MESSAGE_SERVER))))
                        server = ((BaseApplication)this.getApplication()).getEnvironment().getDefaultApplication().getRemoteTask(null, null, bCreateIfNotFound);    // (remote)
        // This assumes that I only have a server for client processes (Should be correct).
        if (server != null)
            return new org.jbundle.base.message.core.dual.DualMessageQueue(this, strQueueName, strQueueType); // Handle remote and local
        else
            return new LocalMessageQueue(this, strQueueName);
    }
24086
function flush() {
		var temp = buffer;
		buffer = [];
		if (method === 'post') {
			var postJson = {
				schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-0',
				data: temp.map(valuesToStrings)
			};
			request.post({
				url: targetUrl,
				json: postJson,
				agentOptions: agentOptions,
				headers: {
					'content-type': 'application/json; charset=utf-8'
				}
			}, callback);

		} else {
			for (var i=0; i<temp.length; i++) {
				request.get({
					url: targetUrl,
                    agentOptions: agentOptions,
				 	qs: temp[i]
				}, callback);
			}
		}
	}
209272
public static BaseMessage createMessage(String strMessageClassName, BaseMessageHeader messageHeader, Object data)
    {
       BaseMessage message = null;
       
       if ((strMessageClassName == null)
           && (messageHeader != null))
       {
           strMessageClassName = (String)messageHeader.get(BaseMessageHeader.INTERNAL_MESSAGE_CLASS);
           if ((strMessageClassName == null) || (strMessageClassName.length() == 0))
           {
//?               String strRequestType = (String)messageHeader.get(TrxMessageHeader.MESSAGE_REQUEST_TYPE);
//?               if ((strRequestType == null) || (strRequestType.length() == 0) || (RequestType.MANUAL.equalsIgnoreCase(strRequestType)))
//?                   strMessageClass = ManualMessage.class.getName();
           }
       }
       if ((strMessageClassName != null) && (strMessageClassName.length() > 0))
       {
           strMessageClassName = ClassServiceUtility.getFullClassName(strMessageClassName);
           Object obj = ClassServiceUtility.getClassService().makeObjectFromClassName(strMessageClassName);
           if (obj instanceof BaseMessage)
           {
               message = (BaseMessage)obj;
               message.init(messageHeader, null);
           }
           else if  (obj instanceof MessageRecordDesc)
           {
               message = new TreeMessage(messageHeader, null);
               ((MessageRecordDesc)obj).init(message, null);
           }
       }
       return message;
   }
971702
public MockResponse setChunkedBody(String body, int maxChunkSize) {
    return setChunkedBody(new Buffer().writeUtf8(body), maxChunkSize);
  }
334440
public PactDslRequestWithoutPath body(JSONObject body) {
        requestBody = OptionalBody.body(body.toString().getBytes());
        if (!requestHeaders.containsKey(CONTENT_TYPE)) {
            requestHeaders.put(CONTENT_TYPE, Collections.singletonList(ContentType.APPLICATION_JSON.toString()));
        }
        return this;
    }
1126498
public MailRequest newTextMailRequest(String subject, String body) {
        return createMailRequest(generateRequestId(), false, subject, body);
    }
1279036
public static QueuedMessage createSIBQueuedMessage(SIMPQueuedMessageControllable qmc) {

        String id = null;
        int jsApproximateLength = 0;
        String name = null;
        String state = null;
        String transactionId = null;
        String type = null;
        String busSystemMessageId = null;

        id = qmc.getId();
        name = qmc.getName();
        state = null;
        transactionId = null;

        try {
            if (qmc.getState() != null) {
                state = qmc.getState().toString();
            }
            transactionId = qmc.getTransactionId();
        } catch (SIMPException e) {
            // No FFDC code needed
        }

        try {
            JsMessage jsMessage = qmc.getJsMessage();
            jsApproximateLength = jsMessage.getApproximateLength();
            busSystemMessageId = jsMessage.getSystemMessageId();
            type = jsMessage.getJsMessageType().toString();
        } catch (SIMPControllableNotFoundException e) {
            // No FFDC code needed
        } catch (SIMPException e) {
            // No FFDC code needed
        }

        return new QueuedMessage(id, name, jsApproximateLength, state, transactionId, type, busSystemMessageId);
    }
1270503
private <M extends MessageHeaders<EmptyRequestBody, P, U>, U extends MessageParameters, P extends ResponseBody> CompletableFuture<P>
			sendRequest(M messageHeaders, U messageParameters) {
		return sendRequest(messageHeaders, messageParameters, EmptyRequestBody.getInstance());
	}
360988
def _flush(self, buffer):
        
        with _handle_client_error():
            self._client.put_object(
                Body=buffer.tobytes(), **self._client_kwargs)
163661
function req (method, url, query, body, done) {
	request({
		method: method,
		url: url,
		qs: query,
		body: body,
		json: true
	}, function (err, res, body) {
		if (err) {
			return done(err);
		}
		if (res.statusCode > 299) {
			var message = (body && body.message ? body.message : 'Error ' + res.statusCode);
			return done(new Error(message));
		}
		done(null, body);
	});
}
830336
public static DefaultGoApiResponse error(String responseBody) {
        DefaultGoApiResponse defaultGoApiResponse = new DefaultGoApiResponse(500);
        defaultGoApiResponse.setResponseBody(responseBody);
        return defaultGoApiResponse;
    }
1022847
public void send(String destination, Object body) {
        AsyncMessage message = this.defaultMessageCreator.createMessage();
        message.setDestination(destination);
        message.setBody(body);
        getMessageBroker().routeMessageToService(message, null);
    }
764645
function create(body, cb) {
  var validates = Schema(body);

  if(!validates) {
    return cb(new exceptions.BadRequest());
  }

  body.expires_at = stampify(conf.session_maxage);

  var q = qb.insert(body);
  db.getClient(function(err, client, done) {
    client.query(q[0], q[1], function(err, r) {
      if(err) {
        if(err.code == 23505) {
          err = new exceptions.AlreadyExists();
        }
        cb(err);
        done(err);
      } else {
        cb(null, r.rows[0]);
        done();
      }
    });
  });
}