Class AbstractCmdConsume

java.lang.Object
org.apache.pulsar.client.cli.AbstractCmdConsume
Direct Known Subclasses:
CmdConsume, CmdRead

public abstract class AbstractCmdConsume extends Object
common part of consume command and read command of pulsar-client.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
    • MESSAGE_BOUNDARY

      protected static final String MESSAGE_BOUNDARY
      See Also:
    • clientBuilder

      protected org.apache.pulsar.client.api.ClientBuilder clientBuilder
    • authentication

      protected org.apache.pulsar.client.api.Authentication authentication
    • serviceURL

      protected String serviceURL
  • Constructor Details

    • AbstractCmdConsume

      public AbstractCmdConsume()
  • Method Details

    • updateConfig

      public void updateConfig(org.apache.pulsar.client.api.ClientBuilder clientBuilder, org.apache.pulsar.client.api.Authentication authentication, String serviceURL)
      Set client configuration.
    • interpretMessage

      protected String interpretMessage(org.apache.pulsar.client.api.Message<?> message, boolean displayHex) throws IOException
      Interprets the message to create a string representation.
      Parameters:
      message - The message to interpret
      displayHex - Whether to display BytesMessages in hexdump style, ignored for simple text messages
      Returns:
      String representation of the message
      Throws:
      IOException
    • interpretByteArray

      protected static String interpretByteArray(boolean displayHex, byte[] msgData) throws IOException
      Throws:
      IOException
    • genericObjectToMap

      protected static Map<String,Object> genericObjectToMap(org.apache.pulsar.client.api.schema.GenericObject value, boolean displayHex) throws IOException
      Throws:
      IOException
    • keyValueToMap

      protected static Map<String,Object> keyValueToMap(org.apache.pulsar.common.schema.KeyValue value, boolean displayHex) throws IOException
      Throws:
      IOException
    • primitiveValueToMap

      protected static Map<String,Object> primitiveValueToMap(Object value, boolean displayHex) throws IOException
      Throws:
      IOException
    • genericRecordToMap

      protected static Map<String,Object> genericRecordToMap(org.apache.pulsar.client.api.schema.GenericRecord value, boolean displayHex) throws IOException
      Throws:
      IOException