All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mvnsearch.spring.boot.nats.cloudevents.NatsCloudEventsConstants Maven / Gradle / Ivy

Go to download

Spring Boot starter NATS with publish/subscribe, KeyValue, Object Store, Durable Component, Services framework etc. support.

There is a newer version: 0.2.1
Show newest version
package org.mvnsearch.spring.boot.nats.cloudevents;

import io.cloudevents.core.message.impl.MessageUtils;

import java.util.Map;

/**
 * Constants and methods used throughout the NATS binding for cloud events.
 *
 * @author linux_china
 */
public class NatsCloudEventsConstants {
  /**
   * The prefix name for CloudEvent attributes for use in properties of a NATS message.
   * please refer https://github.com/cloudevents/spec/blob/main/cloudevents/bindings/nats-protocol-binding.md
   */
  static final String CE_PREFIX = "ce-";

  static final Map ATTRIBUTES_TO_PROPERTY_NAMES = MessageUtils.generateAttributesToHeadersMapping(CEA -> CE_PREFIX + CEA);

  static final String PROPERTY_CONTENT_TYPE = "ce-contenttype";
  static final String MESSAGE_PROPERTY_SPEC_VERSION = ATTRIBUTES_TO_PROPERTY_NAMES.get("specversion");
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy