Example usage for io.vertx.core.eventbus DeliveryOptions getHeaders

List of usage examples for io.vertx.core.eventbus DeliveryOptions getHeaders

Introduction

In this page you can find the example usage for io.vertx.core.eventbus DeliveryOptions getHeaders.

Prototype

@GenIgnore
public MultiMap getHeaders() 

Source Link

Document

Get the message headers

Usage

From source file:co.runrightfast.vertx.core.eventbus.ProtobufMessageProducer.java

License:Apache License

public static DeliveryOptions addRunRightFastHeaders(final DeliveryOptions options) {
    final MultiMap headers = options.getHeaders();
    if (headers == null) {
        options.addHeader(MESSAGE_ID.header, uuid());
        options.addHeader(MESSAGE_TIMESTAMP.header, DateTimeFormatter.ISO_INSTANT.format(Instant.now()));
        return options;
    }//  ww w.j av a  2 s  . c  o m

    if (!headers.contains(MESSAGE_ID.header)) {
        headers.add(MESSAGE_ID.header, uuid());
    }

    if (!headers.contains(MESSAGE_TIMESTAMP.header)) {
        headers.add(MESSAGE_TIMESTAMP.header, DateTimeFormatter.ISO_INSTANT.format(Instant.now()));
    }
    return options;
}

From source file:io.engagingspaces.graphql.schema.SchemaDefinitionOptions.java

License:Open Source License

private JsonObject deliveryOptionsToJson(DeliveryOptions options) {
    return JsonObjectHelper.jsonObject().put("sendTimeout", options.getSendTimeout())
            .putIfPresent("codecName", options.getCodecName())
            // TODO Test with MultiMap values
            .putIf("headers", options.getHeaders(), headers -> headers.size() > 0, headers -> headers);
}