The Spring Blog

Engineering
Releases
News and Events

Webinar Dec 8th: Awesome tools to level up your Spring Cloud architecture

Getting up and running with Spring Cloud is a breeze. But once the initial setup is done, it needs to be complemented with an ecosystem that can cope with the extra operational complexity and quality concerns. While running Spring Cloud in production for over a year, Pivotal has integrated some interesting tools for documentation, operations and testing. During this talk you will see a demo of an integrated platform based on Spring Cloud, including tools like Spring Cloud Contract, wiremock, saboteur, ELK, Spinnaker, Spring Boot Admin and more. One of these tools is a dashboard for visualising Pivotal’s Spring Cloud microservice architecture, which has recently been open sourced. Documenting, testing, troubleshooting, and monitoring highly distributed systems in microservice architectures are hard. Finding quality, complementary tools in the wilds of open source can be even harder. Join this webinar for a pragmatic look at taming some of the challenges of running microservices in production.

Read more...

SpringOne Platform 2016 Replay: Building Modern Web Applications with Angular2

Recorded at SpringOne Platform 2016.
Speaker: Sergi Almar
Slides: http://www.slideshare.net/SpringCentral/building-modern-web-applications-with-angular2

Web development has become more complex in the last few years with a plethora of frameworks to choose from and no clear direction. Join Sergi Almar in this presentation to learn why Angular2 is a good fit for Spring developers. We’ll review the Angular2 architecture and see how TypeScript allows us to build more maintable and clean applications having the benefits of a typed language. We’ll look at the Angular2 component based model, dependency injection, data binding, routing, templates…to build modern web applications.

Read more...

SpringOne Platform 2016 Replay: Netflix's Edge Gateway Using Zuul

Recorded at SpringOne Platform 2016.
Speaker: Mikey Cohen, Netflix
Slides: http://www.slideshare.net/SpringCentral/netflixs-edge-gateway-using-zuul

An edge gateway is an essential piece of infrastructure for large scale cloud based services. This presentation details the purpose, benefits and use cases for an edge gateway to provide security, traffic management and cloud cross region resiliency. How a gateway can be used to enhance continuous deployment, and help testing of new service versions and get service insights and more are discussed. Philosophical and architectural approaches to what belongs in a gateway vs what should be in services will be discussed. Real examples of how gateway services, built on top of Netflix’s Open source project, Zuul, are used in front of nearly all of Netflix’s consumer facing traffic will show how gateway infrastructure is used in real highly available, massive scale services.

Read more...

Spring AMQP 2.0 Milestone 1 Available

We are pleased to announce the first milestone of Spring AMQP 2.0 is now available.

For a complete list of changes; see the what’s new in the reference manual and the release notes.

Here are some highlights of this release

  • The framework is now fully Java 8 based; several functional interfaces are provided for convenient Lambda implementations (callbacks, ReplyingMessageListener etc). Java 8 is now a requirement. It is also based on Spring Framework 5.0.

  • The framework uses the new 4.0 amqp-client library.

  • A new DirectMessageListenerContainer is now available alongside the existing SimpleMessageListenerContainer. The new container actually has a simpler architecture and the listener is called directly on the amqp-client thread (hence the name Direct…​). See Choosing a Container to help you decide which container is appropriate for your application.

  • A subclass - DirectReplyToMessageLisenerContainer - is also provided, specifically for using the RabbitMQ Direct ReplyTo feature for request/reply messaging. This is now used by the RabbitTemplate (by default) rather than creating a consumer per request/reply as was the case previously. Consumers are cached for reuse.

  • The AsyncRabbitTemplate now supports direct replyTo, utilizing the new container; previously the async template did not support direct replyTo.

  • @RabbitListener annotations can now be configured with an error handler and the ability to send exceptions to the sender when request/reply messaging is being used.

  • Connection and channel listeners now receive shutdown signals.

  • You can now assign names to connections created by Spring AMQP - the name appears on the RabbitMQ Admin UI.

  • Limited stateful retry (1 redelivery attempt) is now available (when an inbound message does not have a message id) without the need to configure a MissingMessageIdAdvice which has now been removed from the framework. Spring Retry 1.2 is required to support this feature.

  • The log4j appender is no longer provided due to the EOL of log4j (the log4j2 and logback appenders remain available).

Read more...

SpringOne Platform 2016 Replay: Intro to Spring Boot

Recorded at SpringOne Platform 2016.
Speaker: Eddú Meléndez Gonzales
Slides: http://www.slideshare.net/SpringCentral/intro-to-spring-boot

Spring Boot, the new convention-over-configuration centric framework from the Spring team at Pivotal, marries Spring’s flexibility with conventional, common sense defaults to make application development move swiftly and enjoyable. It’s ideally suited for building microservices and distributed systems and makes streamlining devops practices simple. Join Spring Boot contributor Eddú Meléndez Gonzales for a look at what Spring Boot is, why it’s turning heads, why you should consider it for your next application (REST, web, batch, big-data, integration, whatever!) and how to get started.

Read more...

Spring Cloud Brixton.SR7 and Spring Cloud Camden.SR3 Are Available

On behalf of the team, I am pleased to announce that Brixton Service Release 7 and Camden Service Release 3 of Spring Cloud are available today. The releases can be found in our Spring Release repository and Maven Central.

These releases include primarily bug fixes.

The following modules were updated as part of Brixton.SR7:

The following modules were updated as part of Camden.SR3:

Read more...

This Week in Spring - November 29th, 2016

Welcome to another installment of This Week in Spring! I can’t believe how quickly this year has gone! This week I’m in Melbourne, Australia for the YOW! conference and then week it’s off to Brisbane and then Sydney for the next editions of the same show. Australia is the furthest I’ve ever been from my ‘native’ timezone - so even though I always post This Week in Spring every Tuesday, I appreciate that it’s still Monday for anybody west of Europe right now! Tonight, I’ll join my pal, Intellij’s Trisha Gee, and we’ll be speaking at the Melbourne JVM User Group. I’m super excited to be here, for my first time, helping bring the Spring down under. If you’re around then say hi (@starbuxman)!

Read more...

Going reactive with Spring Data

Last weeks' Spring Data Kay M1 is the first release ever that comes with support for reactive data access. Its initial set of supported stores — MongoDB, Apache Cassandra and Redis — all ship reactive drivers already, which made them very natural candidates for such a prototype. Let’s take a more detailed look at the new programming model and the APIs that make up that support.

Reactive Repositories

The repositories programming model is the most high-level abstraction Spring Data users usually deal with. They’re usually comprised of a set of CRUD methods defined in a Spring Data provided interface and domain-specific query methods. Here’s what a reactive Spring Data repository definition would look like:

public interface ReactivePersonRepository
  extends ReactiveCrudRepository<Person, String> {

  Flux<Person> findByLastname(Mono<String> lastname);

  @Query("{ 'firstname': ?0, 'lastname': ?1}")
  Mono<Person> findByFirstnameAndLastname(String firstname, String lastname);
}

As you can see, there’s not too much difference to what you’re used to. However, in contrast to the traditional repository interfaces, a reactive repository uses reactive types as return types and can do so for parameter types, too. The CRUD methods in the newly introduced ReactiveCrudRepository, of course make use of these types, too.

By default, reactive repositories use Project Reactor types but other reactive libraries can also be used. We provide custom repository base interface (e.g. RxJava1CrudRepository) for those and also automatically adapt the types as needed for query methods, e.g RxJava’s Observable and Single. The rest basically stays the same. Note, however, that the current milestone does not support pagination yet and you of course have to have the necessary reactive libraries on the classpath to activate support for a particular library.

Activating reactive Spring Data

Similarly to what we have in the blocking world, the support for reactive Spring Data is activated through an @Enable… annotation alongside some infrastructure setup:

@EnableReactiveMongoRepositories
public class AppConfig extends AbstractReactiveMongoConfiguration {

  @Bean
  public MongoClient mongoClient() {
    return MongoClients.create();
  }

  @Override
  protected String getDatabaseName() {
    return "reactive";
  }
}

See how we use a different base class for the infrastructure configuration, as we need to make use of the MongoDB async driver.

Read more...

SpringOne Platform 2016 Replay: Leadership Election with Spring Cloud Cluster

Recorded at SpringOne Platform 2016.
Speaker: Dr. David Syer
Slides: http://www.slideshare.net/SpringCentral/leadership-election-with-spring-cloud-cluster

Leader election allows application to work together with other applications to coordinate a cluster leadership via a third party system. A leader can then be used to provide global state or global ordering, generally without sacrificing availability. In this presentation we show how Spring Cloud Cluster provides a simple abstraction for leader election and how it is implemented using zookeeper, hazelcast and etcd.

Read more...