This repository contains example projects demonstrating how to use Apache Pulsar as a JMS provider. It includes two implementations:
- A pure Java implementation (current, production-ready)
- A Spring Boot implementation (work in progress)
These examples demonstrate:
- Integration of Apache Pulsar with JMS using the DataStax Pulsar JMS client
- Configuration of Pulsar JMS connection factory and connection
- Sending and receiving messages using JMS
- Message listener implementation
- Handling of custom message types
- Support for both Astra Streaming and standalone Pulsar deployments
The repository is organized into two main directories:
This is the current, production-ready implementation that includes:
- Pure Java-based JMS client implementation
- Support for both Astra Streaming and standalone Pulsar
- Comprehensive deployment scripts
- Example patterns for different messaging scenarios
- Configuration management for different environments
This is a work-in-progress implementation that demonstrates:
- Integration with Spring Boot
- Spring's JMS template usage
- Spring's
@JmsListener
annotation - Spring-based configuration
- Java 8 or higher
- Maven
- Docker (optional, for running Pulsar locally)
- Astra Streaming account (optional, for cloud deployment)
-
Configure your environment:
- For Astra Streaming: Set up your
client.conf
with your Astra credentials - For standalone Pulsar: Use the default configuration
- For Astra Streaming: Set up your
-
Build the project:
cd java
mvn clean package
- Run the example:
./_bash/deploy.sh -cc <path-to-client.conf>
- Start Pulsar (if using standalone):
docker run -p 8080:8080 -p 6650:6650 apachepulsar/pulsar:latest bin/pulsar standalone
- Build and run:
cd spring
mvn clean package
mvn spring-boot:run
The Java implementation supports both Astra Streaming and standalone Pulsar through:
client.conf
: Connection configurationdeploy.properties
: Topic and namespace configuration- Environment-specific settings
The Spring implementation uses:
application.properties
for configuration- Spring's auto-configuration capabilities
- JMS connection factory setup
- DataStax Pulsar JMS Client 4.0.1
- SLF4J for logging
- JUnit for testing
- Spring Boot 2.4.5
- DataStax Pulsar JMS Client 4.0.1
- Spring Pulsar 1.0.5
- Lombok
This project is licensed under the terms included in the LICENSE file.