reactor-core/src/main/java/reactor/core/publisher/Flux.java
public final <K, V> Mono<Map<K, V>> collectMap(
			final Function<? super T, ? extends K> keyExtractor,
			final Function<? super T, ? extends V> valueExtractor,
			Supplier<Map<K, V>> mapSupplier) {
		Objects.requireNonNull(keyExtractor, "Key extractor is null");
		Objects.requireNonNull(valueExtractor, "Value extractor is null");
		Objects.requireNonNull(mapSupplier, "Map supplier is null");
		return collect(mapSupplier, (m, d) -> m.put(keyExtractor.apply(d), valueExtractor.apply(d)));
	}
public final <K, V> Mono<Map<K, V>> collectMap(
			final Function<? super T, ? extends K> keyExtractor,
			final Function<? super T, ? extends V> valueExtractor,
			Supplier<Map<K, V>> mapSupplier) {
		Objects.requireNonNull(keyExtractor, "Key extractor is null");
		Objects.requireNonNull(valueExtractor, "Value extractor is null");
		Objects.requireNonNull(mapSupplier, "Map supplier is null");
		return collect(mapSupplier, (m, d) -> m.put(keyExtractor.apply(d), valueExtractor.apply(d)));
	}
public final < K , V > Mono < Map < K , V > > collectMap ( final Function < ? super T , ? extends K > keyExtractor , final Function < ? super T , ? extends V > valueExtractor , Supplier < Map < K , V > > mapSupplier ) { Objects . requireNonNull ( keyExtractor , "Key extractor is null" ) ; Objects . requireNonNull ( valueExtractor , "Value extractor is null" ) ; Objects . requireNonNull ( mapSupplier , "Map supplier is null" ) ; return collect ( mapSupplier , ( m , d ) -> m . put ( keyExtractor . apply ( d ) , valueExtractor . apply ( d ) ) ) ; }
Collect all elements emitted by this {@link Flux} into a user-defined {@link Map} that is
emitted by the resulting {@link Mono} when this sequence completes.
The key is extracted from each element by applying the {@code keyExtractor}
{@link Function}, and the value is extracted by the {@code valueExtractor} Function.
In case several elements map to the same key, the associated value will be derived
from the most recently emitted element.

<p>
<img class="marble" src="doc-files/marbles/collectMapWithKeyAndValueExtractors.svg" alt="">

@reactor.discard This operator discards the buffer upon cancellation or error triggered by a data signal.

@param keyExtractor a {@link Function} to map elements to a key for the {@link Map}
@param valueExtractor a {@link Function} to map elements to a value for the {@link Map}
@param mapSupplier a {@link Map} factory called for each {@link Subscriber}

@param <K> the type of the key extracted from each source element
@param <V> the type of the value extracted from each source element

@return a {@link Mono} of a {@link Map} of key-value pairs (only including latest
element's value in case of key conflicts)
Collect all elements emitted by this { @link Flux } into a user - defined { @link Map } that is emitted by the resulting { @link Mono } when this sequence completes . The key is extracted from each element by applying the { @code keyExtractor } { @link Function } and the value is extracted by the { @code valueExtractor } Function . In case several elements map to the same key the associated value will be derived from the most recently emitted element .