Class Utils


  • public class Utils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getServiceId​(java.lang.String topic)
      get serviceId according to topic
      static void logFailedMessageFlow​(io.netty.channel.ChannelFuture future, org.apache.eventmesh.common.protocol.tcp.Package pkg, org.apache.eventmesh.common.protocol.tcp.UserAgent user, long startTime, long taskExecuteTime)
      print the message flow of failed sending
      static void logSucceedMessageFlow​(org.apache.eventmesh.common.protocol.tcp.Package pkg, org.apache.eventmesh.common.protocol.tcp.UserAgent user, long startTime, long taskExecuteTime)
      print the message flow of successful sending.
      static java.util.Map<java.lang.String,​java.lang.Object> parseHttpHeader​(io.netty.handler.codec.http.HttpRequest fullReq)
      parse http header
      static java.lang.String printMqMessage​(org.apache.eventmesh.common.protocol.tcp.EventMeshMessage eventMeshMessage)
      print part of the mq message
      static void writeAndFlush​(org.apache.eventmesh.common.protocol.tcp.Package pkg, long startTime, long taskExecuteTime, io.netty.channel.ChannelHandlerContext ctx, Session session)
      used to send messages to the client
      • Methods inherited from class java.lang.Object

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

      • Utils

        public Utils()
    • Method Detail

      • writeAndFlush

        public static void writeAndFlush​(org.apache.eventmesh.common.protocol.tcp.Package pkg,
                                         long startTime,
                                         long taskExecuteTime,
                                         io.netty.channel.ChannelHandlerContext ctx,
                                         Session session)
        used to send messages to the client
        Parameters:
        pkg -
        startTime -
        ctx -
        session -
      • logFailedMessageFlow

        public static void logFailedMessageFlow​(io.netty.channel.ChannelFuture future,
                                                org.apache.eventmesh.common.protocol.tcp.Package pkg,
                                                org.apache.eventmesh.common.protocol.tcp.UserAgent user,
                                                long startTime,
                                                long taskExecuteTime)
        print the message flow of failed sending
        Parameters:
        future -
        pkg -
        user -
        startTime -
      • logSucceedMessageFlow

        public static void logSucceedMessageFlow​(org.apache.eventmesh.common.protocol.tcp.Package pkg,
                                                 org.apache.eventmesh.common.protocol.tcp.UserAgent user,
                                                 long startTime,
                                                 long taskExecuteTime)
        print the message flow of successful sending.
        Parameters:
        pkg -
        user -
        startTime -
      • printMqMessage

        public static java.lang.String printMqMessage​(org.apache.eventmesh.common.protocol.tcp.EventMeshMessage eventMeshMessage)
        print part of the mq message
        Parameters:
        eventMeshMessage -
        Returns:
      • getServiceId

        public static java.lang.String getServiceId​(java.lang.String topic)
        get serviceId according to topic
      • parseHttpHeader

        public static java.util.Map<java.lang.String,​java.lang.Object> parseHttpHeader​(io.netty.handler.codec.http.HttpRequest fullReq)
        parse http header
        Parameters:
        fullReq - request parameter
        Returns:
        http header