/** * Create an {@link InteractiveConsumer simple consumer} that can be used to read messages from the cluster. * * @param groupId the name of the group; may not be null * @param clientId the name of the client; may not be null * @param topicName the name of the topic to read; may not be null and may not be empty * @param keyDeserializer the deserializer for the keys; may not be null * @param valueDeserializer the deserializer for the values; may not be null * @param completion the function to call when the consumer terminates; may be null * @return the running interactive consumer; never null */ public <K, V> InteractiveConsumer<K, V> createConsumer(String groupId, String clientId, String topicName, Deserializer<K> keyDeserializer, Deserializer<V> valueDeserializer, Runnable completion) { Set<String> topicNames = Collections.singleton(topicName); return createConsumer(groupId, clientId, topicNames, keyDeserializer, valueDeserializer, completion); }
/** * Create an {@link InteractiveConsumer simple consumer} that can be used to read messages from the cluster. * * @param groupId the name of the group; may not be null * @param clientId the name of the client; may not be null * @param topicName the name of the topic to read; may not be null and may not be empty * @param completion the function to call when the consumer terminates; may be null * @return the running interactive consumer; never null */ public InteractiveConsumer<String, Document> createConsumer(String groupId, String clientId, String topicName, Runnable completion) { Set<String> topicNames = Collections.singleton(topicName); return createConsumer(groupId, clientId, topicNames, new StringDeserializer(), new DocumentSerdes(), completion); }
/** * Create an {@link InteractiveConsumer simple consumer} that can be used to read messages from the cluster. * * @param groupId the name of the group; may not be null * @param clientId the name of the client; may not be null * @param topicNames the names of the topics to read; may not be null and may not be empty * @param completion the function to call when the consumer terminates; may be null * @return the running interactive consumer; never null */ public InteractiveConsumer<String, Document> createConsumer(String groupId, String clientId, Set<String> topicNames, Runnable completion) { return createConsumer(groupId, clientId, topicNames, new StringDeserializer(), new DocumentSerdes(), completion); }