Class EsbEventCodec

java.lang.Object
com.kingsrook.qqq.esb.envelope.EsbEventCodec

public class EsbEventCodec extends Object
Reads and writes EsbEvents as CloudEvents 1.0 structured JSON (spec section 4), and as JMS TextMessages. Written JSON always has specversion "1.0" and datacontenttype "application/json"; subject, time, qqqcausationid (the causation id, as a CloudEvent extension attribute) and data are left out when null. Values inside data are written as they are, nulls included; Instants and other java.time values are written as ISO-8601 strings. Reading accepts any CloudEvents 1.0 JSON event whose data (if any) is a JSON object; other attributes are ignored. Decimal numbers in data are read as BigDecimal, so they keep their exact value. Anything else throws EsbUnparseableMessageException. Uses one shared, thread-safe Jackson mapper, because building one per message is slow for bulk publishes.