This is an example application demonstrating how to use Spring for Apache Pulsar.
- Java 17 or higher to run
- Maven to compile
- StreamNative Cloud instance or your own Pulsar cluster
If you are using StreamNative Cloud you need to configure your Pulsar service URLs and authentication in the application.yaml file as detailed below:
spring:
pulsar:
client:
service-url: pulsar+ssl://free.o-j8r1u.snio.cloud:6651
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2
authentication:
private-key: file:///Users/user/Downloads/o-j8r1u-free.json
audience: urn:sn:pulsar:o-j8r1u:free
issuer-url: https://auth.streamnative.cloud/
You can build the example application with the following command:
mvn clean install
You can run the example application with the following command:
mvn spring-boot:run