Files

9 lines
535 B
Bash
Executable File

#!/usr/bin/env bash
# Reads the default partition selector out of the shipped jar, because the reference page and the jar disagree.
set -eu
cd "$(dirname "$0")/.."
JAR=$(find "${HOME}/.m2" -name 'spring-cloud-stream-5.1.0.jar' | head -1)
echo '$ javap -p -c PartitionHandler$DefaultPartitionSelector (selectPartition and the murmur2 call)'
javap -p -c -cp "$JAR" 'org.springframework.cloud.stream.binder.PartitionHandler$DefaultPartitionSelector' 2>/dev/null \
| sed -n '/public int selectPartition/,/ireturn/p' | sed -E 's/^ +//'