Package org.apache.pulsar.client.cli
Class AbstractCmdConsume
java.lang.Object
org.apache.pulsar.client.cli.AbstractCmdConsume
- Direct Known Subclasses:
CmdConsume,CmdRead
common part of consume command and read command of pulsar-client.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenericObjectToMap(org.apache.pulsar.client.api.schema.GenericObject value, boolean displayHex) genericRecordToMap(org.apache.pulsar.client.api.schema.GenericRecord value, boolean displayHex) protected static StringinterpretByteArray(boolean displayHex, byte[] msgData) protected StringinterpretMessage(org.apache.pulsar.client.api.Message<?> message, boolean displayHex) Interprets the message to create a string representation.keyValueToMap(org.apache.pulsar.common.schema.KeyValue value, boolean displayHex) primitiveValueToMap(Object value, boolean displayHex) voidupdateConfig(org.apache.pulsar.client.api.ClientBuilder clientBuilder, org.apache.pulsar.client.api.Authentication authentication, String serviceURL) Set client configuration.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
MESSAGE_BOUNDARY
- See Also:
-
clientBuilder
protected org.apache.pulsar.client.api.ClientBuilder clientBuilder -
authentication
protected org.apache.pulsar.client.api.Authentication authentication -
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 interpretdisplayHex- Whether to display BytesMessages in hexdump style, ignored for simple text messages- Returns:
- String representation of the message
- Throws:
IOException
-
interpretByteArray
- 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
-