Spring Initializr, Meet Your Perfect Match for Event-Driven Microservices: PubSub+
Tags: solace, spring, microservices, java
Published: 2019-11-21 14:07:12

---
title: Spring Initializr, Meet Your Perfect Match for Event-Driven Microservices: PubSub+
published: true
date: 2019-11-06 22:27:35 UTC
tags: solace,spring,microservices,java
canonical_url: https://solace.com/blog/solace-pubsub-spring-initializr/
---

 ![Further thoughts on FPGA co-processing and performance](https://solace.com/wp-content/uploads/2019/08/solace-default-blog-thumbnail-600x285.jpg)

If you’re not familiar with start.spring.io, it hosts the Spring Engineering team’s opinionated version of Spring Initializr, which allows developers to generate Spring Boot projects pre-populated with the dependencies they need to get started quickly.

**Spring Developer Advocate Josh Long calls start.spring.io the “second-best place on the internet,”** and it just got better! Why do I say that? Because Solace PubSub+ is now available on start.spring.io, enabling developers to create event-driven microservices.

![Did you know that devs use Start.Spring to generate 15mil projects](https://solace.com/wp-content/uploads/2019/11/didyouknow-springone.png)

As a developer who has been creating event-driven applications with a combination of the Spring Framework and Solace PubSub+ for about eight years, I love how the developer experience keeps improving. This is the next step.

When selected as a dependency on Initializr at start.spring.io, the `Solace PubSub+’ option informs Initializr to add the Solace JMS Spring Boot Starter to the maven pom or build.gradle file as a dependency. This enables autoconfiguration of a _ConnectionFactory_ or _JndiTemplate,_ allowing developers to use Spring Boot to easily create event-driven microservices with PubSub+ and the JMS API. Using PubSub+ to create event-driven microservices empowers developers to use the best message exchange patterns for their use case, such as publish/subscribe, queuing, request/reply and it even provides the ability to [store & replay](https://docs.solace.com/Configuring-and-Managing/Msg-Replay-Video.htm#Video:). The use of PubSub+ also allows developers to take advantage of all the benefits of having events flow over the Event Mesh, such as being able to communicate with applications using other APIs and protocols and built-in high availability and disaster recovery.

Maven Example:

```
<dependency>
 <groupId>com.solace.spring.boot</groupId>
 <artifactId>solace-jms-spring-boot-starter</artifactId>
 <version>3.2.0</version>
</dependency>
```

Want to give it a shot? Spring Initializr offers several ways to generate your Spring Boot project. You can do it using the Web UI, from your favorite IDE or even from the command-line.

- **Web:** Use this link to [spring.io](https://start.spring.io/#!dependencies=solace) to use the Initializr Web UI, and yes it even offers a dark mode! You can choose your project type (Maven or Gradle), programming language, project dependencies and more. You’ll find the Solace PubSub+ dependency by looking under the “Messaging” section, searching for “solace” or if you use the link above, we’ve pre-populated the Solace PubSub+ dependency for you ;). Once you’ve made your choices, click the _Generate_ button to download a zip file of your Spring Boot project.  
[![](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-1.png)](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-1.png)
- **IDE:** You can also create Spring Boot projects from your favorite IDE. These IDEs currently support Initializr: Spring Tool Suite, IntelliJ IDEA Ultimate, NetBeans (with [this plugin](https://github.com/AlexFalappa/nb-springboot)) or VSCode (with [the vscode-spring-initializr plugin](https://github.com/microsoft/vscode-spring-initializr)). Which Initializr do you think they use by default? If you guessed the one at start.spring.io, you’re correct.  
For example, when using the Spring Tool Suite IDE for development, you can create a new _Spring Starter Project_ and under the covers Initializr will generate your project. Check out the options available in the image below.  
[![](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-2.png)](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-2.png)  
After choosing those initial options and selecting _Next,_ you will be asked to choose dependencies. You’ll find Solace PubSub+ under the _Messaging_ dropdown. Choose it, click _Finish,_ and a Spring Boot project is generated right in your IDE.  
[![](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-3.png)](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-3.png)
- **CLI:** Not a fan of a GUI? No worries, you can generate Spring Boot projects from the command line as well. For example, if you want to generate a zip file containing a project with Java 11 and Solace PubSub+ as a dependency, you could execute:  
`curl https://start.spring.io/starter.zip -d dependencies=solace -d javaVersion=11 -o demo.zip`  
Or to see all available options, execute `curl -XGET https://start.spring.io` as seen in the image below.  
[![](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-4.png)](https://solace.com/wp-content/uploads/2019/11/spring-initialzr-blog-post_image-4.png)

Now that you’ve used Spring Initializr to generate your Spring Boot project with Solace’s Spring Boot JMS Starter as a dependency, it’s time to code your event-driven microservice. You can learn more about using our Spring Boot JMS Starter using the following resources:

- Blog: [https://solace.com/blog/solace-jms-meet-spring-boot-starters/](https://solace.com/blog/solace-jms-meet-spring-boot-starters/)
- Tutorial: [https://solace.com/samples/solace-samples-spring/spring-boot-autoconfigure/](https://solace.com/samples/solace-samples-spring/spring-boot-autoconfigure/)

If you have any questions, feel free to ask them in the [Solace Developer Community](https://solace.dev/) with the `Spring` tag.

And if you love start.spring.io so much that you want to learn more about how it works, watch [Stéphane Nicoll](https://twitter.com/snicoll)’s talk from SpringOne Platform 2019: [Creating “The Second Best Place on the Internet” with Spring Initializr](https://www.youtube.com/watch?v=YVF08E7Xd_Y&list=PLAdzTan_eSPRlQ8t4TU5c-AB4SHV939M6&index=134)

The Spring + Solace developer experience has come a long way in the last eight years and I’m excited to see it continuously improve. Check out [solace.com/spring](https://www.solace.com/spring) to see all the ways you can use Spring with Solace and stay tuned for more upcoming Spring + Solace news.  
Hint: SolaceYSpring & SolaceY[AsyncAPI](https://asyncapi.com/). Until next time, Happy Eventing!

The post [Spring Initializr, Meet Your Perfect Match for Event-Driven Microservices: PubSub+](https://solace.com/blog/solace-pubsub-spring-initializr/) appeared first on [Solace](https://solace.com).