Class MessageMDC

java.lang.Object
de.wuespace.telestion.services.logging.MessageMDC

public final class MessageMDC extends Object
A MDC implementation for the Message object.
See Also:
MDC, Message
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Same as MDC.clear().
    static void
    put​(String key, io.vertx.core.eventbus.Message<?> message)
    Puts a message object to the MDC store like MDC.put(String, String).

    Following objects are stored:
    address replyAddress headers send body
    The key is either the name of the objects, if the key is null or key.name.
    putCloseable​(String key, io.vertx.core.eventbus.Message<?> message)
    Puts a message object to the MDC store and returns a SafeCloseable almost like MDC.putCloseable(String, String).

    See put(String, Message) for the elements which are put to the store.
    static void
    remove​(String key)
    Removes the message object with the given key from the MDC store (like MDC.remove(String)).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MessageMDC

      public MessageMDC()
  • Method Details

    • putCloseable

      public static SafeCloseable putCloseable(String key, io.vertx.core.eventbus.Message<?> message)
      Puts a message object to the MDC store and returns a SafeCloseable almost like MDC.putCloseable(String, String).

      See put(String, Message) for the elements which are put to the store.
      Parameters:
      key - to identify the Message in the store
      message - Message to store
      Returns:
      A SafeCloseable which can remove the key if close() is called
    • put

      public static void put(String key, io.vertx.core.eventbus.Message<?> message)
      Puts a message object to the MDC store like MDC.put(String, String).

      Following objects are stored:
      • address
      • replyAddress
      • headers
      • send
      • body

      The key is either the name of the objects, if the key is null or key.name.
      Parameters:
      key - to identify the Message in the store
      message - Message to store
    • clear

      public static void clear()
      Same as MDC.clear().
    • remove

      public static void remove(String key)
      Removes the message object with the given key from the MDC store (like MDC.remove(String)).
      Parameters:
      key - identifies the Message to remove