From f625317445df0c2cc076ba4cc32f6078b9421351 Mon Sep 17 00:00:00 2001
From: Christoph Strobl Spring Security OAuth 2.0.3 is available now in all the usual Maven repositories. It's a bug fix release, nothing major, so upgrading from 2.0.x should be painless (and is recommended). Some people were having issues getting JWT tokens to work properly, and those should be fixed. The only noteworthy functional change is that Resource Servers (if configured with Dear Spring Community, I am happy to announce the new release of our Eclipse-based tooling today:\nThe Spring Tool Suite (STS) 3.6.1 and the Groovy/Grails Tool Suite (GGTS) 3.6.1. Highlights from this release include: To download the distributions, please go visit: Detailed new and noteworthy notes can be found here: STS/GGTS 3.6.1 New & Noteworthy. NOTE:\nBoth tool suites ship on top of the latest Eclipse Luna 4.4 release as 64bit and 32bit based zip files only.\nThere will be no native installers for STS/GGTS anymore. With the 3.6.0 release we shifted towards a slightly changed release schedule, shipping minor releases more frequently. Therefore 3.6.2 is scheduled to ship already in October, shortly after the Eclipse Luna SR1 release, followed by 3.6.3 in early Dezember and 3.6.4 in early March 2015, shortly after the Eclipse Luna SR2 release. Enjoy! Welcome to another installment of This Week in Spring! It's a few weeks before SpringOne2GX 2014, already! Time sure flies when you're having fun! The beginning of 2015 will mark the 4th year of This Week in Spring, and it's more exciting every week! I'm hoping to see as many of you as possible at SpringOne2GX 2014. This is sure to be an amazing event. Anyway, with that out of the way, let's get on to this week's roundup! On behalf of the Spring Data team I am pleased to announce the availability of the fourth service release of the Dijkstra release train. It includes 36 fixes overall for the following modules: The release is a recommended upgrade for all Dijkstra users as it contains a few important bug fixes. The next release coming will be the final release of the upcoming release train Evans. If you want to learn more about Spring Data, be sure to attend this year's SpringOne conference. The schedule contains a lot of data-related talks to introduce you to the latest features we're going to ship with Evans. Holy cats! Can you believe how close we are to SpringOne2GX? Last year we made a huge splash with the announcements of Spring Boot and Spring XD, both of which have recently hit 1.0 releases. I happen to know the next level looks like, and you're going to want to see it. Register now if you haven't already! I am personally super excited to see Greg, Rob, the rest of the Spring team, and of course all of you, at SpringOne2GX! Register now if you haven't! I was recently made aware that a public API we were using for one of our guides contained objectionable material. After confirming this, I immediately responded that we would pick another source. Wishing to avoid such an issue in the future, I decided the best solution was to build our own RESTful quote service. So I decided to use the best tools to do so, the Spring stack, and was able to migrate the very next day. To kick things off, I made a check list of what I knew would be the right tools for the job of creating a RESTful web service. I quickly set aside the desire to add, delete, manage, or view the data through a web page. Instead, my focus was to serve up a fixed set of content with the exact same structure that the guide expected to consume. The original content for the guide was a series of \"Chunk Norris\" jokes. I like a good laugh. But when I revisited the public API, I saw that several of the jokes were a bit rancid. After a brief discussion with colleagues, the idea came up to cite historical quotes. I took that idea and bent it a little. I had recently collected quotes from various developers about Spring Boot for personal reasons, so I decided to use that as the curated content. To kick things off, I visited http://start.spring.io. This Spring Boot app lets you enter the details of your new project, pick the Java level, and select the Spring Boot starters you need. I used my checklist up above and created a new gradle-based project. With the project unpacked and imported into my IDE, the first thing I did was copy the domain objects shown in the Reactor guide. This way, I could ensure that the data sent out by my REST service was correct. Since the POJOs in my Quoters Incorporated app are almost identical, I won't post them here. Then I created a Spring Data repository. This empty interface definition handles Next step? Initialize some data. I created a Because I have H2 as my database of choice (com.h2database:h2) in After I built this database layer, I went on to create the APIs. With Spring MVC, it wasn't hard at all. Let's break it down: To fetch ALL quotes, I use a Java 8 stream to wrap the Spring data's To fetch a single quote, it first tests if a given id exists. If not, return Finally, to fetch a random quote, I use Java 8's QUESTION: Why am I using With this in place, the default Ta dah! To wrap things up, I built the JAR file and pushed it up to Pivotal Web Services. You can view the site yourself at http://gturnquist-quoters.cfapps.io/api/random. Suffice it to say, I was able to tweak the Reactor guide by altering ONE LINE OF CODE. With that in place, I did some other clean up of the content and was done! To see the code, please visit https://github.com/gregturn/quoters. These are some outstanding things that didn't fit inside the time budget and weren't required to solve the original problem involving the Reactor guide. But they are good exercises you can explore! You can clone the project in github and take a shot at it yourself! Book your place at SpringOne in Dallas, TX for Sept 8-11 soon. It's simply the best opportunity to find out first hand all that's going on and to provide direct feedback. You can see myself and Roy Clarkson talk about Spring Data REST - Data Meets Hypermedia to see how to merge Spring Data and RESTful services. I'm pleased to announce the release of Spring Security 4.0.0.M2 available in the Spring Milestone repository.
diff --git a/mongodb/text-search/src/test/java/example/springdata/mongodb/textsearch/TextSearchTemplateTests.java b/mongodb/text-search/src/test/java/example/springdata/mongodb/textsearch/TextSearchTemplateTests.java
index 8a25993f..f67a3c03 100644
--- a/mongodb/text-search/src/test/java/example/springdata/mongodb/textsearch/TextSearchTemplateTests.java
+++ b/mongodb/text-search/src/test/java/example/springdata/mongodb/textsearch/TextSearchTemplateTests.java
@@ -15,8 +15,8 @@
*/
package example.springdata.mongodb.textsearch;
-import static example.springdata.mongodb.util.ConsoleResultPrinter.printResult;
-import static org.springframework.data.mongodb.core.query.Query.query;
+import static example.springdata.mongodb.util.ConsoleResultPrinter.*;
+import static org.springframework.data.mongodb.core.query.Query.*;
import java.util.List;
@@ -33,7 +33,7 @@ import org.springframework.data.mongodb.core.query.TextQuery;
import org.springframework.data.util.Version;
import example.springdata.mongodb.util.BlogPostInitializer;
-import example.springdata.mongodb.util.MongoVersionRule;
+import example.springdata.mongodb.util.RequiresMongoDB;
/**
* @author Christoph Strobl
@@ -43,7 +43,7 @@ public class TextSearchTemplateTests {
MongoOperations operations;
- @ClassRule public static MongoVersionRule versionRule = MongoVersionRule.atLeast(new Version(2, 6));
+ @ClassRule public static RequiresMongoDB mongodbAvailable = RequiresMongoDB.atLeast(new Version(2, 6));
@Before
public void setUp() throws Exception {
diff --git a/mongodb/text-search/src/test/java/example/springdata/mongodb/util/BlogPostInitializer.java b/mongodb/text-search/src/test/java/example/springdata/mongodb/util/BlogPostInitializer.java
index c7d12bea..84fc0b56 100644
--- a/mongodb/text-search/src/test/java/example/springdata/mongodb/util/BlogPostInitializer.java
+++ b/mongodb/text-search/src/test/java/example/springdata/mongodb/util/BlogPostInitializer.java
@@ -15,21 +15,12 @@
*/
package example.springdata.mongodb.util;
-import java.util.ArrayList;
-import java.util.List;
-
import lombok.extern.slf4j.Slf4j;
-import org.springframework.core.convert.converter.Converter;
+import org.springframework.core.io.ClassPathResource;
import org.springframework.data.mongodb.core.MongoOperations;
-import org.springframework.http.ResponseEntity;
+import org.springframework.data.repository.init.Jackson2ResourceReader;
import org.springframework.util.Assert;
-import org.springframework.web.client.RestTemplate;
-
-import com.rometools.rome.feed.atom.Category;
-import com.rometools.rome.feed.atom.Content;
-import com.rometools.rome.feed.atom.Entry;
-import com.rometools.rome.feed.atom.Feed;
import example.springdata.mongodb.textsearch.BlogPost;
@@ -44,73 +35,31 @@ public enum BlogPostInitializer {
INSTANCE;
- private final RestTemplate restTemplate = new RestTemplate();
- private final Converter@Configuration) will now check the validity of the client and scopes before allowing access to protected resources. This means that client privileges can be revoked quickly, but may also lead to a performance penalty (so caching the ClientDetailsService results would be recommended).\n
\n
\n
",
+ "categories" : [
+ "Engineering"
+ ]
+},
+
+{
+ "_id" : "tag:spring.io,2014-08-27:1743",
+ "_class" : "example.springdata.mongodb.textsearch.BlogPost",
+ "title" : "Spring Data Dijkstra SR4 released",
+ "content" : "
\nprovides a lot of great features, including improved Security-aware testing support, Spring Data integration, support for websocket security, and ties into the nascent Spring Session projet that was derived from the work for this release. Check it out! Rob also announced Spring Security 3.2.5 and 3.1.7 which is a fix that closes a few potential security holes. This is good stuff, all around!
\nweb.xml and Spring XML configuration. It's a working recipe, but I hope readers will remember that you can get the same done with Spring Boot in much less time and code.\n
\n
HandlerMethodArgumentResolver in other to resolve and inject objects into Spring MVC controllers. This is a really powerful technique if you need it.
\n\nPicking your tools
\n\n\n
\nPicking your content
\n\n\nTime to code!
\n\n\nDefining your domain
\n\npublic interface QuoteRepository extends CrudRepository<Quote, Long> {}\n
Quote objects with an internal primary key of type Long. By extending the Spring Data Commons CrudRepository, it inherits a fistful of database operations we'll use later on.DatabaseLoader like this:@Service\npublic class DatabaseLoader {\n\n private final QuoteRepository repository;\n\n @Autowired\n public DatabaseLoader(QuoteRepository repository) {\n this.repository = repository;\n }\n\n @PostConstruct\n void init() {\n repository.save(new Quote(\"Working with Spring Boot is like pair-programming with the Spring developers.\"));\n // more quotes...\n }\n\n}\n
\n
@Service so it will be automatically picked up by @ComponentScan when the app starts.QuoteRepository is made available.@PostConstruct tells Spring MVC to run the data loading method after all beans have been created.init() method uses Spring Data JPA to create a whole slew of quotations.build.gradle, there is no database set up at all (thanks to Spring Boot).\nCreating a controller
\n\n@RestController\npublic class QuoteController {\n\n private final QuoteRepository repository;\n\n private final static Quote NONE = new Quote(\"None\");\n\n private final static Random RANDOMIZER = new Random();\n\n @Autowired\n public QuoteController(QuoteRepository repository) {\n this.repository = repository;\n }\n\n @RequestMapping(value = \"/api\", method = RequestMethod.GET)\n public List<QuoteResource> getAll() {\n return StreamSupport.stream(repository.findAll().spliterator(), false)\n .map(q -> new QuoteResource(q, \"success\"))\n .collect(Collectors.toList());\n }\n\n @RequestMapping(value = \"/api/{id}\", method = RequestMethod.GET)\n public QuoteResource getOne(@PathVariable Long id) {\n if (repository.exists(id)) {\n return new QuoteResource(repository.findOne(id), \"success\");\n } else {\n return new QuoteResource(NONE, \"Quote \" + id + \" does not exist\");\n }\n }\n\n @RequestMapping(value = \"/api/random\", method = RequestMethod.GET)\n public QuoteResource getRandomOne() {\n return getOne(nextLong(1, repository.count() + 1));\n }\n\n private long nextLong(long lowerRange, long upperRange) {\n return (long)(RANDOMIZER.nextDouble() * (upperRange - lowerRange)) + lowerRange;\n }\n\n}\n
\n
@RestController. This means all routes return objects not views.NONE quote and a Java 8 Random for randomly picking quotes.QuoteRepository.\n
\n \n\nAPI \nDescription \n\n \n/api \nFetch ALL quotes \n\n \n/api/{id} \nFetch quote id\n \n\n \n\n/api/random \nFetch a random quote \nfindAll() and in turn, wrap each one into a QuoteResource. The results are turned into a List.NONE. Otherwise, return a wrapped quote.Random utility inside the nextLong() utility method to fetch a Long with the lowerRange and upperRange, inclusively.\n
\n\nQuoteResource? Quote is the core domain object returned by the QuoteRepository. To match the previous public API, I wrap each instance in a QuoteResource which includes a status code.\nTesting the results
\n\nApplication class created by http://start.spring.io was ready to run.
\n\n$ curl localhost:8080/api/random\n{\n type: \"success\",\n value: {\n id: 1,\n quote: \"Working with Spring Boot is like pair-programming with the Spring developers.\"\n }\n}\n\nOutstanding issues
\n\n\n
\nSpringOne 2GX 2014
\n\n
You can find details about this release in the release notes. Highlights of the release include:
\n\nHttpSession implementation. See the project page for additional features of this exciting new project.MockMvc through SecurityMockMvcConfigurers\nWithSecurityContextTestExecutionListener on your tests@WithSecurityContext works even with custom SecurityContextRepository implementationsStay tuned to the spring.io blog for a blog series introducing these exciting new features.
\n\n", + "categories" : [ + "Releases" + ] +}, + +{ + "_id" : "tag:spring.io,2014-08-15:1730", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "CVE-2014-3527 Fixed in Spring Security 3.2.5 and 3.1.7", + "content" : "Spring Security 3.2.5 (change log) and 3.1.7 (change log) have been released and are available in Maven Central. Important highlights of this release are:
\n\nA special thanks to Scott Battaglia & the rest of the CAS team for relaying CVE-2014-3527 to the Spring Security team and coordinating with the Spring Security team on the CAS release to resolve CVE-2014-4172.
\n\nSpringOne 2GX 2014 is around the corner
\n\nBook your place at SpringOne in Dallas, TX for Sept 8-11 soon. It's simply the best opportunity to find out first hand all that's going on and to provide direct feedback. There will be deep dive sessions on the latest updates to Spring, Groovy, and Grails!
", + "categories" : [ + "Releases" + ] +}, + +{ + "_id" : "tag:spring.io,2014-08-15:1729", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "Spring Framework 4.1 RC2 Released", + "content" : "On behalf of the team I am pleased to announce the second release candidate of Spring Framework 4.1 is now available from our milestone repository. This release includes over 70 fixes and improvements.
\n\nSpring 4.1 is really coming up soon: please try it out and let us know if you run into any issue. We're looking forward to getting in touch via Twitter, StackOverflow or JIRA.
\n\nSpringOne 2GX 2014 is around the corner
\n\nBook your place at SpringOne in Dallas, TX for Sept 8-11 soon. It's simply the best opportunity to find out first hand all that's going on and to provide direct feedback. There will be deep dive sessions on Spring XD along with general Big Data talks to provide an introduction to the landscape and challenges in developing Big Data applications.
", + "categories" : [ + "Releases" + ] +}, + +{ + "_id" : "tag:spring.io,2014-08-13:1725", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "First Release Candidate of Spring Data Release Train Evans Available", + "content" : "We are happy to announce the first release candidate of the Spring Data release train Evans. We ship the following modules:
\n\nSome of the highlights that happened since the first milestone are:
\n\nOverall 95 tickets have be processed so make sure you've booked your place for SpringOne in Dallas to find out firsthand what's new in Spring Data. Meanwhile watch out for upcoming blog posts on selected features of this release. The release train wiki page might be a good start to find out about relevant new stuff as well.
\n\nGot questions? Have feedback? Found a bug? Don't hesitate to contact us! We're looking forward to getting in touch via Twitter, StackOverflow or JIRA.
", + "categories" : [ + "Releases" + ] +}, + +{ + "_id" : "tag:spring.io,2014-08-13:1724", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "This Week in Spring - August 12th, 2014", + "content" : "Welcome to another installment of This Week in Spring. We've got a lot of cool stuff happening and, as you might imagine, the entire team is abuzz in preparation for SpringOne2GX 2014, coming in just a few short weeks! If you haven't registered, now's the time to do so!
\n\nJdbcTemplate or inject an ApplicationContext into a bean. Maybe it'll help somebody as a first-cut, though. So, did I mention SpringOne2GX 2014? It's right around the corner! I'll be there, and so will everyone from the Spring team, so don't miss out. This is going to be an amazing year. I happen to know what some of the keynotes are going to be about. Do not miss out. Register today!
", + "categories" : [ + "Engineering" + ] +}, + +{ + "_id" : "tag:spring.io,2014-08-07:1722", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "Spring Boot 1.1.5 released", + "content" : "We are pleased to announce that Spring Boot 1.1.5 has been released and is available from repo.spring.io and Maven Central.
\n\nThis release addresses a number of issues and is a recommended upgrade for all Spring Boot users. For a complete list of changes please refer to the issue tracker.
\n\nProject Page | GitHub | Issues | Documentation
", + "categories" : [ + "Releases" + ] +}, + +{ + "_id" : "tag:spring.io,2014-08-06:1721", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "Spring MVC Test HtmlUnit 1.0.0.M2 Released", + "content" : "I'm pleased to announce the second milestone release of Spring MVC Test HtmlUnit.
\n\nThe project’s aim is to provide integration between Spring MVC Test and HtmlUnit. This simplifies performing end to end testing when using HTML based views.
\n\nChangelog
\n\nYou can view the complete changelog on github. Below are the highlights of the release:
\n\nWelcome to another installment of This Week in Spring! As usual, we've got a lot to cover so let's get to it.
\n\n/dev/Kico blog has a nice Portguese-language post on what's new in Spring 4\nStoredProcedure object that can be used to wrap and adapt the painful setup involved in invoking a stored procedure from JDBC.SpringOne 2GX 2014 is around the corner
\n\nBook your place at SpringOne in Dallas, TX for Sept 8-11 soon. It's simply the best opportunity to find out first hand all that's going on and to provide direct feedback. There will be deep dive sessions on Spring XD along with general Big Data talks to provide an introduction to the landscape and challenges in developing Big Data applications.
", + "categories" : [ + "Engineering" + ] +}, + +{ + "_id" : "tag:spring.io,2014-07-24:1697", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "Extending Spring Cloud", + "content" : "One of the most interesting capabilities of Spring Cloud is its extensibility. You can extend it to support additional clouds, enhance already supported clouds, support new services, new service connectors--all without modifying the Spring Cloud code itself. In this blog, we explore this capability. If you haven’t done so already, please read the first and second blog in this series to acquire sufficient background.
\n\nSpring Cloud provides extensibility along three orthogonal directions. You may extend it in one of these directions and orthogonality ensures that you continue to benefit from the others.
\n\nCloud Platforms: While Spring Cloud supports Cloud Foundry, Heroku, and a Local Config cloud (to test locally in a cloud-like environment), you aren’t limited by these choices. You can add your own cloud platform and take advantage of the rest of Spring Cloud capability such as Spring Java Config.
Cloud Services: Cloud platforms offer a variety of services ranging from relational databases to messaging. Services offered by each cloud platform vary a lot, even for multiple installations of the same platform. This is especially true for PaaS offerings such as Cloud Foundry, where private instances of Cloud Foundry tend to have services specific to each installation. Spring Cloud offers an easy way to extend to services beyond its core offering. Just like cloud platform extensibility, you don’t have to change Spring Cloud code to extend it to new services and you continue to take advantage of the other parts.
Frameworks: Spring Cloud currently supports Spring frameworks through the spring-service-connector module. However, except for that module, nothing in Spring Cloud depends on Spring. As such, you should be able to either use other parts from any JVM-based framework or extend it for a framework by adding a new module.
In the previous blog, we looked at how you would use CloudFactory and Cloud to programmatically use Spring Cloud. When it comes to extensibility, you will not be working with either of these; instead you will implement other types in the core module. Let’s take a look at them.
The main type you will need to be familiar with to extend Spring Cloud to a new cloud platform is CloudConnector, which is a simple three-method interface:
public interface CloudConnector {\n boolean isInMatchingCloud();\n ApplicationInstanceInfo getApplicationInstanceInfo();\n List<ServiceInfo> getServiceInfos();\n}\nThe isInMatchingCloud() method should examine its environment to decide if it is operating in the right environment. For example, the Cloud Foundry connector checks the existence of the VCAP_APPLICATION environment variable, whereas the Heroku connector looks for the existence of the DYNO environment variable. The getApplicationInstanceInfo() method returns information about the current application instance (app name, host, port, and application properties). The most interesting method getServiceInfos() returns a list with each element containing enough information so that applications know how to connect to each service. Exact information contained in each ServiceInfo object is left up to each implementation (the ServiceInfo as such defines only one method: getId()).
Once you create an implementation of CloudConnector, you need to make Spring Cloud aware of it. For all extension points, Spring Cloud uses a uniform mechanism based on ServiceLoader. As applied to Spring Cloud for platform extensibility, it boils down to including a file named /META-INF/services/org.springframework.cloud.CloudConnector with an entry with the fully-qualified name of the implementation class. Typically, you will bundle this file along with your implementation and supporting classes. Then all an app has to do is include this jar on the classpath.
The ServiceInfoCreator interface provides an extension point to work with a new service.
public interface ServiceInfoCreator<SI extends ServiceInfo, SD> {\n public boolean accept(SD serviceData);\n public SI createServiceInfo(SD serviceData);\n}\nThe generic parameter SI defines the kind of ServiceInfo it will create, whereas the SD parameter defines the raw service data type it can work with. The raw service data type depends on the cloud platform. For example, in Cloud Found, it will be a Map based on the VCAP_SERVICES environment variable, whereas in Heroku, it will be a pair containing the service-specific environment variables and its value. Since the raw data type depends on the platform, so does implementations of ServiceInfoCreator. The accept() method examines the service data and determines if it can deal with it. For example, it can look at the URL scheme and determine if it can consume that service data. If it can, the createServiceInfo() must return a ServiceInfo object. If it is a completely new service, you may also have to implement ServiceInfo for that, else you can use one of the existing ones.
Once you have implemented a ServiceInfoCreator, you will have to let Spring Cloud know about it. This follows the same idea as discussed earlier for cloud platform extensibility. In this case, the file name you use is CloudConnector dependent. For Cloud Foundry, it is /META-INF/services/org.springframework.cloud.cloudfoundry.CloudFoundryServiceInfoCreator (theoretically, a CloudConnector implementation may decide to use another extension mechanism, but Spring Cloud doesn’t recommend that).
As discussed in the previous blog, a cloud app developer may decide to work directly with a ServiceInfo object. As such, if you just implement a ServiceInfoCreator, you would have provided some benefit already. However, working with a raw ServiceInfo object may not be appreciated by many developers focused on developing apps, so you will implement the next extension as well.
The last extensibility point is ServiceConnectorCreator. Its job is to transform ServiceInfo into a service connector that is suitable for consumption in the framework the app is using. For example, it could transform MysqlServiceInfo into a DataSource object. Out of the box, Spring Cloud supports connectors for DataSource and a few Spring Data and Spring AMQP types. If you wish to extend Spring Cloud to other frameworks or if you wanted to support other Spring Data types (such as Neo4J, Elasticsearch, Cassandra) or Spring-compatible types (such as S3) not yet supported directly by Spring Cloud, this is the extension point you need.
public interface ServiceConnectorCreator<SC, SI extends ServiceInfo> {\n SC create(SI serviceInfo, ServiceConnectorConfig serviceConnectorConfig);\n ...\n}\nThere are a couple more methods; however, you will normally extend the AbstractServiceConnectorCreator that takes care of implementing those.
The SC generic parameter to ServiceConnectorCreator is bound to the type of connector it will create, such as DataSource, whereas the SI parameter signifies the type of ServiceInfo it can work with.
The create() method is supplied with a ServiceInfo object and a configuration object, that carries service-specific info such as pooling parameters. It needs to use these parameters to create an appropriate connector.
Once the implementation is ready, just put it in a file named /META-INF/services/org.springframework.cloud.service.ServiceConnectorCreator. Spring Cloud will use the Service Loader mechanism described earlier.
As you can see Spring Cloud offers substantial extensibility along cloud platform, services, and framework axis. Next time, you come across a new kind of these, you should be able to extend Spring Cloud to work with them. If you open-source your extensions, let us know, so that we can showcase it for others to benefit. If it is a common enough extension, consider making a pull request.
", + "categories" : [ + "Engineering" + ] +}, + +{ + "_id" : "tag:spring.io,2014-07-30:1715", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "Spring XD 1.0 GA Released", + "content" : "On behalf of the Spring XD team, I am very pleased to announce the general availability of Spring XD 1.0! You can download the zip distribution. You can also install on OSX using homebrew and on RHEL/CentOs using yum.
\n\nSpring XD's goal is to be your one stop shop for developing and deploying Big Data Applications. Such applications require a wide range of technologies to address different use-cases while interoperating as a cohesive process. The steps in this process include:
\n\nSpring XD brings together many of these steps into a single unified runtime platform so you can address as many use-cases as possible. You don't have to piece together a large number of individual projects, each with its own configuration and programming model. Instead, with Spring XD, you can quickly get started developing an end-to-end solution with a simple but powerful DSL and scale it out.
\n\nSpring XD provides:
\n\nThere are several resources available to help you get started using Spring XD.
\n\nThere are many samples available in our samples repository Here are a few that show the range of functionality available
\n\nThis was a great team effort, with over a dozen active contributors spread around the world working for 68 weeks, divided into 32 sprints, resolving 1,650 issues in 2000 commits, 1,000 tests, and 270 pages of documentation. The 51,000 HipChat messages helped keep the team in constant contact and searching for new emoticons and fun images
\n\nThanks for all the feedback from early adopters. Feedback is very important, so please get in touch with questions and comments via
\n\nspring-xd tagSpringOne 2GX 2014 is around the corner
\n\nBook your place at SpringOne in Dallas, TX for Sept 8-11 soon. It's simply the best opportunity to find out first hand all that's going on and to provide direct feedback. There will be deep dive sessions on Spring XD along with general Big Data talks to provide an introduction to the landscape and challenges in developing Big Data applications.
", + "categories" : [ + "Releases" + ] +}, + +{ + "_id" : "tag:spring.io,2014-07-30:1718", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "This Week in Spring (Spring XD Edition) - July 29th, 2014", + "content" : "Welcome to another installment of This Week in Spring! This week saw the release of the amazing Spring XD 1.0.0.RELEASE. The release announcement is a good place to start your big-data journey. There, you'll find links to other great posts, learning content, etc. This is a great opportunity to evaluate what you hope to get out of your data, and whether you're getting it. Spring XD is your big-data Swiss-army knife: it can support live, streaming workloads; batch-centric offline workloads; and general data integration solutions. If you digest but one post from this week's roundup, let it be the Spring XD release! (Then, write the data-integration solution to read and organize the rest of them using Spring XD!)
\n\nOf course, there's a lot more to say on the matter, and on all matters Spring and things, so be sure to book your place at SpringOne2GX 2014 in Dallas, TX for Sept 8-11 soon. It's simply the best opportunity to find out first hand all that's going on and to provide direct feedback. There will be deep dive sessions on Spring XD along with general Big Data talks to provide an introduction to the landscape and challenges in developing Big Data applications.
\n\nWith that out of the way, let's get on to this week's roundup...
\n\njava.util.Optional support where appropriate...MessageSources managed by Spring - handy! Filters with Spring MVC, this time doing so in Java configuration\nSpeakers: Josh Long and Joram Barrez, Activiti
\n\nToday's applications are complex, distributed systems that - taken together - produce results. Tracking the flow of work through that system, however, becomes increasingly more painful as automated- and human-driven tasks are integrated into business processes. Business can't react to what it can't see. Business can't measure what it can't see. \"Workflow\" describes the sequence of processes through which a piece of work passes from initiation to completion. Workflow systems, like Activiti, describe and then execute these processes. Activiti is an open-source, Apache 2-licensed workflow engine that works with Spring and Spring Boot. In this webinar, join Spring Developer Advocate Josh Long and Activiti-ninja Joram Barrez for a look at how to distill, describe and reuse complex business processes using Spring (and Spring Boot) and Activiti.
\n\nTuesday, Sept 23rd, 2014 3:00PM BST (London UTC+01:00) Register
\n\nTuesday, Sept 23rd, 2014 10:00 am Pacific Daylight Time (San Francisco, UTC-07:00) Register
", + "categories" : [ + "News and Events" + ] +}, + +{ + "_id" : "tag:spring.io,2014-07-30:1716", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "Webinar: Microservices with Spring Boot - Sept 16th", + "content" : "Speaker: Josh Long, Pivotal
\n\nMicroservices? A thing? Or hype? What does it mean in practice? The answer, like so many Facebook statuses, is complicated. In broad strokes, Microservices offer a refreshed approach to application architecture. Microservices are a new way to describe many of the patterns that have fallen out of large-scale applications in practice over the recent years. There is no doubt that the approach works. The question is: how does one build a microservice architecture? Join Josh Long for this webinar introducing Spring's support for building microservice architectures.
\n\nTuesday, Sept 16th, 2014 3:00PM BST (London UTC+01:00) Register
\n\nTuesday, Sept 16th, 2014 10:00 am Pacific Daylight Time (San Francisco, UTC-07:00) Register
", + "categories" : [ + "News and Events" + ] +}, + +{ + "_id" : "tag:spring.io,2014-07-15:1690", + "_class" : "example.springdata.mongodb.textsearch.BlogPost", + "title" : "Using Spring Cloud programmatically", + "content" : "In the last blog, I showed you how to use Spring Cloud's Java configuration option to obtain service connectors declaratively (there is also XML namespace support, if you need it). In this blog, we will take a closer look at how you would use Spring Cloud programmatically. This will help in the situations where you cannot use Java or XML configuration. It will also demystify how Spring Cloud works and prepare for the next blog in this series, where we discuss extending Spring Cloud.
\n\nTo work with Spring Cloud we need to access an object of the Cloud class. However, you can’t create a Cloud object directly (its constructor is not public). Instead, you will obtain it through CloudFactory.
CloudFactory cloudFactory = new CloudFactory();\nCloud cloud = cloudFactory.getCloud();\nThe cloud object created in this matter is suitable for the environment in which the app is operating. For example, if the app is running in Cloud Foundry it is configured to understand how it exposes services to the app. Note that creating a CloudFactory instance is somewhat expensive, therefore you should try to avoid creating multiple instances. If you use a dependency injection framework such as Spring, it will take care of avoiding multiple instances; otherwise, just manage it yourself.
Once we have the cloud object, we can get application instance information, service information objects using various criteria, and service connectors using the specified criteria. Let's say, you want to get ServiceInfo objects for all services bound to the app and print the JDBC URL for relational services, you could use the following snippet:
List<ServiceInfo> serviceInfos = cloud.getServiceInfos();\nfor (ServiceInfo serviceInfo : serviceInfos) {\n if (serviceInfo instanceof RelationalServiceInfo) {\n System.out.println(((RelationalServiceInfo) serviceInfo).getJdbcUrl());\n }\n}\nThis will produce output such as this:
\n\njdbc:postgresql://babar.elephantsql.com:5432/tbsonrjm?user=***&password=***\n\n\nObjects obtained using getServiceInfos() and its variations contain enough information such as URL and credentials to create a service connector. In some cases, obtaining a ServiceInfo object may be all you need, since you can always create suitable connectors (such as a DataSource) based on it. But in most cases, you would let Spring Cloud create a suitable service connector for a service. For example, if you would like to get a DataSource for the \"inventory-db\" service directly, you could use the following snippet:
DataSource inventoryDataSource = \n cloud.getServiceConnector(\"inventory-db\", DataSource.class, null);\n\n\nThere is a variation of this method: getSingletonServiceConnector(), which you can use as follows:
DataSource inventoryDataSource = cloud.getSingletonServiceConnector(DataSource.class, null);\nHere, it will return a DataSource for the unique relational database service bound to the app; if there is no such service or there is more than one service, it will throw an exception. We passed null as the last argument to both methods to use the default configuration for the created connector. However, you can pass a configuration you desire to override. For example, here we specify pool config as well as connection config for the datasource to be created.
PoolConfig poolConfig = new PoolConfig(20, 200);\nConnectionConfig connectionConfig = new ConnectionConfig(\"characterEncoding=UTF-8\");\nDataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig);\nDataSource invetoryDataSource = cloud.getSingletonServiceConnector(DataSource.class, serviceConfig);\nLast, there is a method to obtain application info that contains application id (cloud dependent, but typically the application name), application instance id, and loosely defined application properties. Let’s print all this information:
\n\nApplicationInstanceInfo appInstanceInfo = cloud.getApplicationInstanceInfo();\nSystem.out.println(\"Application id: \" + appInstanceInfo.getAppId());\nSystem.out.println(\"Application instance id: \" + appInstanceInfo.getInstanceId());\nfor (Map.Entry<String, Object> entry: appInstanceInfo.getProperties().entrySet()) {\n System.out.println(\"Application property: \" + entry.getKey() + \"=\" + entry.getValue());\n}\nWhen you execute this code in an app running in Cloud Foundry, you get output similar to the following (abbreviated here). If the same app is running in Heroku, it will produce a similar output, however, with a different set of keys:
\n\n\nApplication id: hello-spring-cloud\nApplication instance id: 8b523252a9d3478b92750ef27ad4e5b0\nApplication property: limits={mem=800, disk=1024, fds=16384}\nApplication property: application_version=b1257c57-2a5c-47aa-8ca7-5e8b6d9a7b9c\nApplication property: application_name=hello-spring-cloud\nApplication property: application_uris=[hello-spring-cloud.cfapps.io]\nApplication property: version=b1257c57-2a5c-47aa-8ca7-5e8b6d9a7b9c\nApplication property: name=hello-spring-cloud\nApplication property: space_name=development\nApplication property: space_id=5f629937-1821-4f48-9eb4-8c67c70c0df0\nApplication property: application_id=a345f90f-e075-4005-b003-f4ab86ad716a\nApplication property: instance_id=8b523252a9d3478b92750ef27ad4e5b0\nApplication property: instance_index=0\nApplication property: host=0.0.0.0\nApplication property: port=61023\nApplication property: start=2014-07-15 21:27:34 +0000\nApplication property: state_timestamp=1405459654\n\n\nThat is pretty much all you need to know to use Spring Cloud programmatically. In the next blog, we will shift our focus on the extensibility aspect of Spring Cloud. Stay tuned.
", + "categories" : [ + "Engineering" + ] +} +] \ No newline at end of file diff --git a/mongodb/util/pom.xml b/mongodb/util/pom.xml new file mode 100644 index 00000000..786680e1 --- /dev/null +++ b/mongodb/util/pom.xml @@ -0,0 +1,21 @@ +