-
Notifications
You must be signed in to change notification settings - Fork 19
Releases
Adjust the values as necessary and then execute the following to set variables that are used in most steps below.=
CURRENT_VERSION=0.5.9
VERSION=0.5.10
NEXT_SNAPSHOT_VERSION=0.5.11-SNAPSHOT
RC=1
RC_VERSION="${VERSION}-candidate-${RC}"
TAG="v${RC_VERSION}"
APACHEID=asfuserid
PULSAR_CLIENT_REACTIVE_HOME="$HOME/repos/pulsar-client-reactive"
The version in the build must be set to the version to be released.
Here's a command line approach for Linux:
sed -i "s/version=${CURRENT_VERSION}-SNAPSHOT/version=$VERSION/g" gradle.properties
git add gradle.properties
git commit -m "[Release $VERSION] Update version to $VERSION"
git push origin
git push upstream
Here's a command line approach for Mac:
sed -i '' "s/version=${CURRENT_VERSION}-SNAPSHOT/version=$VERSION/g" gradle.properties
git add gradle.properties
git commit -m "[Release $VERSION] Update version to $VERSION"
git push origin
git push upstream
Wait for the CI to pass before proceeding.
# display the git revision
git rev-parse HEAD
# tag HEAD
git tag -u $APACHEID@apache.org $TAG -m "Release $TAG"
# push the tag to origin (GitHub)
git push origin $TAG
# if you are working from a fork, also tag upstream
git push upstream $TAG
Ensure SVN is installed by running:
svn --version
Install if necessary (for Mac run brew install svn
).
KEY_ID=$(gpg --list-keys --with-colons $APACHEID@apache.org | egrep "^pub" | awk -F: '{print $5}')
cd $HOME
mkdir pulsar-client-reactive-releases
cd pulsar-client-reactive-releases
svn mkdir --username $APACHEID -m "Add directory for pulsar-client-reactive $RC_VERSION release" https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-reactive-$RC_VERSION
svn co https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-reactive-$RC_VERSION
cd pulsar-client-reactive-$RC_VERSION
(cd $PULSAR_CLIENT_REACTIVE_HOME && ./gradlew sourceTar)
cp $PULSAR_CLIENT_REACTIVE_HOME/build/pulsar-client-reactive-$VERSION-src.tar.gz .
gpg --default-key $KEY_ID --armor --output pulsar-client-reactive-$VERSION-src.tar.gz.asc --detach-sig pulsar-client-reactive-$VERSION-src.tar.gz
shasum -a 512 pulsar-client-reactive-$VERSION-src.tar.gz > pulsar-client-reactive-$VERSION-src.tar.gz.sha512
# execute the following and copy the output to go into the VOTE email below
shasum -a 512 pulsar-client-reactive-$VERSION-src.tar.gz
svn add pulsar-client-reactive-$VERSION-src.tar.gz{,.asc,.sha512}
svn commit -m "Add files for pulsar-client-reactive $RC_VERSION release"
This process is for MacOS and Linux.
# Adjust the following as necessary to point to your local copy of the project repo
cd $PULSAR_CLIENT_REACTIVE_HOME
# Get the 8 digit short key id required by Gradle publish/sign plugin
KEY_ID=$(gpg --list-keys --with-colons --keyid-format short $APACHEID@apache.org | egrep "^pub" | awk -F: '{print $5}' | grep -o '........$')
echo "$KEY_ID"
# Export apache key in format required by Gradle publish/sign plugin
gpg -o $HOME/.gnupg/secring.kbx --export-secret-key $KEY_ID
# start the following command with a space to skip adding the command to shell history
./gradlew -PasfUsername=$APACHEID '-PasfPassword=<your asf password>' -Psigning.keyId=$KEY_ID '-Psigning.password=<your signing password>' -Psigning.secretKeyRingFile=$HOME/secring.kbx publish
Log in to the ASF Nexus repository at https://repository.apache.org/
Click on "Staging Repositories" on the left sidebar and then select the current Pulsar staging repo. This should be called something like orgapachepulsar-XYZ.
Use the "Close" button to close the repository. This operation will take few minutes. Once complete click "Refresh" and now a link to the staging repository should be available, something like https://repository.apache.org/content/repositories/orgapachepulsar-XYZ
Note
If the close operation fails w/ sigining validation errors saying your public key can not be found, be sure your key is uploaded to the key servers by following these steps. Then attempt to close the repository again. If the re-attempt fails and you are sure your keys are available on the key servers, then drop the repository and repeat the above steps to re-stage the repo.
Send the vote email to the dev mailing list.
Execute the following command to substitute variables and put the email content into your copy buffer. You can then paste the content into your email editor or another text file to prepare to send.
tee >(pbcopy) <<EOF
To: dev@pulsar.apache.org
Subject: [VOTE] Reactive Java client for Apache Pulsar ${VERSION} Candidate ${RC}
Following PIP-205: Reactive Java client for Apache Pulsar (
https://github.com/apache/pulsar/issues/17335), this is release
candidate ${RC} for the Reactive Java client for Apache Pulsar, version ${VERSION}.
*** Please download, test and vote on this release. This vote will stay open
for at least 72 hours ***
Note that we are voting upon the source (tag). Binaries in the Maven repository
are provided for convenience.
Source package:
https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-reactive-${RC_VERSION}/
SHA-512 checksums:
3ba5c623d11329c3336657b3e081ae80a2ee581b1a206d4d5e1e84642ad143cab8462ef325cfa1082b89c18dae65b9bf51f063c97bd970fecb0d8b943bb28535
pulsar-client-reactive-${VERSION}-src.tar.gz
Maven staging repo:
https://repository.apache.org/content/repositories/orgapachepulsar-1266/
The tag to be voted upon:
v${RC_VERSION} (8c8d087abaa04c413150d6931451996e9fad8c2c)
https://github.com/apache/pulsar-client-reactive/releases/tag/v${RC_VERSION}
Please download the source package, and follow detailed instructions for pulsar-client-reactive release validation at
https://github.com/apache/pulsar-client-reactive/wiki/Releases#validating-release-candidates.
Best regards
<Your name here>
EOF
The vote should be open for at least 72 hours (3 days). Votes from Pulsar PMC members will be considered binding, while anyone else is encouraged to verify the release and vote as well.
If the release is approved here with 3 +1 binding votes, you can then proceed to the next step. Otherwise, you should repeat the previous steps and prepare another release candidate to vote.
It is also helpful to send a Slack message to the Pulsar Dev channel. Here's an example (execute command to get variables substituted and put into your copy buffer):
tee >(pbcopy) <<EOF
Release vote started for the Reactive Java client for Apache Pulsar ${VERSION} based on ${RC_VERSION}:
https://lists.apache.org/thread/lv3yvv8nvm5b62kptzdtmwrpkrvh4sj4
Please help validate the release and vote!
EOF
Once the vote has been passed, send a reply to the voting thread with the vote result.
Here's an example (execute as command to get variables substituted and put into your copy buffer):
tee >(pbcopy) <<EOF
Hello all,
The vote to release the Reactive Java client for Apache Pulsar version ${VERSION}
based on ${RC_VERSION} is now closed.
The vote PASSED with X binding "+1", Y non-binding "+1" and 0 "-1" votes:
"+1" Binding votes:
- <name>
"+1" Non-Binding votes:
- <name>
I'll continue with the release process and the release announcement
will follow shortly.
Thanks,
<your name>
EOF
git tag -u $APACHEID@apache.org v$VERSION -m "Release v$VERSION" $TAG^{}
git push origin v$VERSION
# if you are working from a fork, also push upstream
git push upstream v$VERSION
Go to https://github.com/apache/pulsar-client-reactive/tags and create a release from the released tag. Create release notes. You can use GitHub's automated release notes generator to list all changes.
Verify the correct repository to stage in the release candidate vote email.
Go to https://repository.apache.org/#stagingRepositories and release the correct repository.
After releasing, the artifacts will be available under https://repository.apache.org/content/repositories/releases/org/apache/pulsar/ and then get synchronized to maven central under https://repo1.maven.org/maven2/org/apache/pulsar/. This might take a few hours.
Please ask a PMC member to complete this step. This will make the source package available at https://archive.apache.org/dist/pulsar/.
ARTIFACT_TO_PROMOTE="pulsar-client-reactive-$RC_VERSION"
svn move --username $APACHEID -m "Release Reactive client for Apache Pulsar $VERSION" \
https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-reactive-$RC_VERSION \
https://dist.apache.org/repos/dist/release/pulsar/pulsar-client-reactive-$VERSION
Wait for the maven packages to become available in Maven Central and the sources to be available in downloads.apache.org
before announcing the release.
Use your @apache.org
mail address to send the email for the announcement.
Send the email in plain text mode since the announce@apache.org mailing list will reject messages with text/html content.
In Gmail, there's an option to set Plain text mode
in the ⋮
/ More options
menu.
Here's an example (execute as command to get variables substituted and put into your copy buffer):
tee >(pbcopy) <<EOF
To: dev@pulsar.apache.org, users@pulsar.apache.org, announce@apache.org
Subject: [ANNOUNCE] Released Reactive client for Apache Pulsar, version $VERSION
The Apache Pulsar team is proud to announce the Reactive client for
Apache Pulsar, version $VERSION.
The Reactive client for Apache Pulsar can be used together with any
Reactive Streams implementation on the JVM. Examples include Project
Reactor / Spring Reactive, Akka Streams, RxJava 3, Vert.x, SmallRye
Mutiny (RedHat/Quarkus), ServiceTalk and others. (Reactive Streams to
JDK Flow adapters might be needed in some cases.)
Reactive programming is about non-blocking applications that are
asynchronous and event-driven and require a small number of threads to
scale.
The Reactive client for Apache Pulsar supports non-blocking, reactive
& asynchronous back pressure for producing and consuming messages.
The library provides an interface module "pulsar-client-reactive-api"
that abstracts the Reactive client API. This interface is currently
implemented by wrapping the Apache Pulsar Java client and adapting the
existing asynchronous Java API to the Reactive client API. The
decoupled reactive interfaces makes it possible to implement a fully
native reactive client in the future.
Source package is available for download at
https://downloads.apache.org/pulsar/pulsar-client-reactive-$VERSION/
Maven packages are available in Maven central. Please check
https://github.com/apache/pulsar-client-reactive#getting-it for usage
with Maven or Gradle builds.
Release Notes are at:
https://github.com/apache/pulsar-client-reactive/releases/tag/v$VERSION
We would like to thank the contributors that made the release possible.
Regards,
The Pulsar Team
EOF
Here's a command line approach for Linux:
sed -i "s/^:latest_version: .*/:latest_version: $VERSION/" README.adoc
git add README.adoc
git commit -m "[Release ${VERSION}] Update latest version in README.adoc to $VERSION"
Here's a command line approach for Mac:
sed -i '' "s/^:latest_version: .*/:latest_version: $VERSION/" README.adoc
git add README.adoc
git commit -m "[Release ${VERSION}] Update latest version in README.adoc to $VERSION"
Here's a command line approach for Linux:
sed -i "s/version=$VERSION/version=$NEXT_SNAPSHOT_VERSION/g" gradle.properties
git add gradle.properties
git commit -m "[Release $VERSION] Update next snapshot version to $NEXT_SNAPSHOT_VERSION"
Here's a command line approach for Mac:
sed -i '' "s/version=$VERSION/version=$NEXT_SNAPSHOT_VERSION/g" gradle.properties
git add gradle.properties
git commit -m "[Release $VERSION] Update next snapshot version to $NEXT_SNAPSHOT_VERSION"
This section contains manual instructions for reviewing and verifying a release candidate.
Execute the following to set variables that are used in most steps below.=
VERSION=0.5.10
RC=1
The source code should be validated that it matches the voted hash.
Download the source artifacts
mkdir source-comparison
cd source-comparison
curl -L -O https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-reactive-$VERSION-candidate-$RC/pulsar-client-reactive-$VERSION-src.tar.gz
curl -L -O https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-reactive-$VERSION-candidate-$RC/pulsar-client-reactive-$VERSION-src.tar.gz.asc
curl -L -O https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-reactive-$VERSION-candidate-$RC/pulsar-client-reactive-$VERSION-src.tar.gz.sha512
Validate sha512 checksum
shasum -a 512 -c pulsar-client-reactive-$VERSION-src.tar.gz.sha512
Validate signature
gpg --verify pulsar-client-reactive-$VERSION-src.tar.gz.asc
Tip
If the key is missing in your local key ring, you can import all Apache Pulsar committer keys with this command:
gpg --import <(curl https://dist.apache.org/repos/dist/release/pulsar/KEYS)
Extract the sources
tar zxvf pulsar-client-reactive-$VERSION-src.tar.gz
Checkout the source from GitHub for comparison
# checkout with the tag in the vote email
git clone --depth 1 -b v$VERSION-candidate-$RC https://github.com/apache/pulsar-client-reactive pulsar-client-reactive-$VERSION-candidate-$RC-source
# validate the the hash matches the revision mentioned in the vote email
( cd pulsar-client-reactive-$VERSION-candidate-$RC-source && git rev-parse HEAD )
Compare
diff -r pulsar-client-reactive-$VERSION pulsar-client-reactive-$VERSION-candidate-$RC-source
In addition, it's necessary to validate the binaries that will be published to Maven central if the vote passes.
The validate_staging_repo.sh script can be executed to validate that the staging repo contains the expected artifacts by building a simple application with Gradle that uses the artifacts.
example of using the validate_staging_repo.sh
script:
# check the release vote email for the staging repo url
STAGING_REPO=https://repository.apache.org/content/repositories/orgapachepulsar-XYZ
./scripts/validate_staging_repo.sh $VERSION $STAGING_REPO
If you prefer to validate the binaries manually, follow these steps.
Here is an example of setting Gradle or Maven build to use to release staging repository:
With Gradle:
repositories {
mavenCentral()
maven {
url 'https://repository.apache.org/content/repositories/orgapachepulsar-XYZ/'
}
}
dependencies {
implementation "org.apache.pulsar:pulsar-client-reactive-adapter:$VERSION"
implementation "org.apache.pulsar:pulsar-client-reactive-producer-cache-caffeine:0.5.3"
}
With Maven:
<repository>
<id>apache.release.staging</id>
<name>Apache Release Staging Repository</name>
<url>https://repository.apache.org/content/repositories/orgapachepulsar-XYZ/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<dependencies>
<dependency>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-client-reactive-adapter</artifactId>
<version>$VERSION</version>
</dependency>
<dependency>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-client-reactive-producer-cache-caffeine</artifactId>
<version>$VERSION</version>
</dependency>
</dependencies>
It is useful to validate the usage of pulsar-client-reactive with a simple test application.
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.Schema;
import org.apache.pulsar.reactive.client.adapter.AdaptedReactivePulsarClientFactory;
import org.apache.pulsar.reactive.client.api.MessageSpec;
import org.apache.pulsar.reactive.client.api.ReactiveMessagePipeline;
import org.apache.pulsar.reactive.client.api.ReactiveMessageSender;
import org.apache.pulsar.reactive.client.api.ReactivePulsarClient;
import reactor.core.publisher.Mono;
public class HelloPulsarClientReactive {
public static void main(String[] args) throws PulsarClientException, InterruptedException {
// Before running this, start Pulsar within docker with this command:
// docker run -it -p 8080:8080 -p 6650:6650 apachepulsar/pulsar:3.1.1 /pulsar/bin/pulsar standalone -nss -nfw
try (PulsarClient pulsarClient = PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build()) {
ReactivePulsarClient reactivePulsarClient = AdaptedReactivePulsarClientFactory.create(pulsarClient);
ReactiveMessagePipeline reactiveMessagePipeline = reactivePulsarClient.messageConsumer(Schema.STRING)
.subscriptionName("sub").topic("testreactive").build().messagePipeline()
.messageHandler(message -> Mono.fromRunnable(() -> {
System.out.println("Received message:" + message.getValue());
})).build().start();
ReactiveMessageSender<String> messageSender = reactivePulsarClient.messageSender(Schema.STRING)
.topic("testreactive").cache(AdaptedReactivePulsarClientFactory.createCache()).build();
messageSender.sendOne(MessageSpec.of("Hello world!")).block();
messageSender.sendOne(MessageSpec.of("Hello Pulsar!")).block();
messageSender.sendOne(MessageSpec.of("Hello Pulsar Client Reactive!")).block();
Thread.sleep(10000L);
reactiveMessagePipeline.stop();
}
}
}