[
{
    "_id" : "tag:spring.io,2014-09-01:1745",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Spring Security OAuth 2.0.3 Available Now",
    "content" : "<p>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 <code>@Configuration</code>) 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 <code>ClientDetailsService</code> results would be recommended).</p>",
    "categories" : [ 
        "Releases"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-28:1744",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Spring Tool Suite and Groovy/Grails Tool Suite 3.6.1 released",
    "content" : "<p>Dear Spring Community,</p>\n\n<p>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.</p>\n\n<p>Highlights from this release include:</p>\n\n<ul>\n<li>updated to tc Server 3.0.0</li>\n<li>performance improvements for building Spring projects</li>\n<li>AspectJ/AJDT now support annotation processors</li>\n</ul><p>To download the distributions, please go visit:</p>\n\n<ul>\n<li>Spring Tool Suite: <a href=\"https://spring.io/tools/sts/all\">https://spring.io/tools/sts/all</a>\n</li>\n<li>Groovy/Grails Tool Suite: <a href=\"https://spring.io/tools/ggts/all\">https://spring.io/tools/ggts/all</a>\n</li>\n</ul><p>Detailed new and noteworthy notes can be found here: <a href=\"http://docs.spring.io/sts/nan/v361/NewAndNoteworthy.html\">STS/GGTS 3.6.1 New &amp; Noteworthy</a>.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>Enjoy!</p>",
    "categories" : [ 
        "Releases"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-19:1740",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "This Week in Spring-19th August 2014",
    "content" : "<p>Welcome to another installment of <em>This Week in Spring</em>! It's a few weeks before <a href=\"http://springone2gx.com/\">SpringOne2GX 2014</a>, already! Time sure flies when you're having fun! The beginning of 2015 will mark the <em>4th</em> year of <em>This Week in Spring</em>, 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. </p>\n\n<p>Anyway, with that out of the way, let's get on to this week's roundup!</p>\n\n<ol>\n<li>Spring Security lead Rob Winch just announced   <a href=\"http://spring.io/blog/2014/08/18/spring-security-4-0-0-m2-released\"> Spring Security 4.0.0.M2</a>, which<br>\nprovides a <em>lot</em> 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 <a href=\"http://spring.io/blog/2014/08/15/cve-2014-3527-fixed-in-spring-security-3-2-5-and-3-1-7\">Spring Security 3.2.5 and 3.1.7</a> which is a fix that closes a few potential security holes. This is good stuff, all around!</li>\n<li>\n<a href=\"http://spring.io/blog/2014/08/15/spring-framework-4-1-rc2-released\">Spring framework 4.1.RC2 just dropped</a>. Spring 4.1 is <em>very</em> near completion, so be sure to check out the latest and greatest bits in this release! </li>\n<li>Christoph Strobl just announced <a href=\"http://spring.io/blog/2014/08/13/first-release-candidate-of-spring-data-release-train-evans-available\"> the first RC for the Spring Data Evans release train</a>. The new release includes a lot of features, including text search integration for Spring Data MongoDB, improved multistore support, configuration options for Redis sentinels, and much more.</li>\n<li>Our friends at Codecentric have just announced a new cut of their <a href=\"http://blog.codecentric.de/en/2014/08/spring-boot-starter-batch-web-1-2-0-released/\">custom Spring Boot autoconfiguration for Spring Batch</a>.   This implementation is different   than the auto-configuration provided out of the box with Spring Boot, and includes support for JSR 352.<br>\n</li>\n<li>Netflix Developer Dan Woods recently gave a nice talk looking at what they hope <a href=\"http://www.slideshare.net/danveloper/future-of-grails\"> to get out of the Spring Boot-based Grails 3</a>, and the slide deck is definitely worth a look.</li>\n<li>The Being Java Guys blog has a nice post on  how to build a REST service with Spring 4 and Hibernate 4. The example uses <code>web.xml</code> and Spring XML configuration. It's a working recipe, but I hope readers will remember that you <a href=\"http://www.beingjavaguys.com/2014/08/spring-restful-web-services.html\"> can get the same done with Spring Boot in <em>much</em> less time</a> and code.</li>\n<li>\n<a href=\"http://docs.oracle.com/middleware/1213/wls/SPRNG/intro.htm#BHCDGJFA\">Oracle has particular support for Spring-based applications in WebLogic 12.1.3</a> which, I confess, I didn't know about. This is a pretty interesting read if you're on WebLogic. </li>\n<li> <a href=\"http://tirthalpatel.blogspot.com/2014/08/executive-view-of-spring-io.html\">Tirthal's Java cafe blog takes a look at the recently announced Spring IO</a>.</li>\n<li> This <a href=\"http://laptrinh.vn/d/3974-huong-dan-tao-javaee-project-voi-spring-framework\">Vietnamese-language post on building a simple Spring-based web application</a> was pretty straightforward, and worth a read. </li>\n<li>This  post introduces how to <a href=\"http://lalit-bhatt.blogspot.com/2014/08/spring-security-gwt-integration.html\">integrate Spring Security 3.0.4 and GWT</a>\n</li>\n</ol>",
    "categories" : [ 
        "Engineering"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-27:1743",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Spring Data Dijkstra SR4 released",
    "content" : "<p>On behalf of the Spring Data team I am pleased to announce the availability of the fourth service release of the <a href=\"https://github.com/spring-projects/spring-data-commons/wiki/Release-Train-Dijkstra\">Dijkstra release train</a>. It includes <a href=\"https://jira.spring.io/issues/?filter=14757\">36 fixes</a> overall for the following modules:</p>\n\n<ul>\n<li>Spring Data Commons 1.8.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-commons/1.8.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/commons/docs/1.8.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/commons/docs/1.8.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/commons/docs/1.8.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data JPA 1.6.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-jpa/1.6.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/jpa/docs/1.6.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/jpa/docs/1.6.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/jpa/docs/1.6.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data MongoDB 1.5.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-mongodb/1.5.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/mongodb/docs/1.5.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/mongodb/docs/1.5.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/mongodb/docs/1.5.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Neo4j 3.1.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-neo4j/3.1.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/neo4j/docs/3.1.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/neo4j/docs/3.1.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/neo4j/docs/3.1.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Solr 1.2.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-solr/1.2.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/solr/docs/1.2.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/solr/docs/1.2.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/solr/docs/1.2.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Couchbase 1.1.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-couchbase/1.1.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/couchbase/docs/1.1.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/couchbase/docs/1.1.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/couchbase/docs/1.1.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Cassandra 1.0.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-cassandra/1.0.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/cassandra/docs/1.0.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/cassandra/docs/1.0.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/cassandra/docs/1.0.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Elasticsearch 1.0.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-elasticsearch/1.0.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/elasticsearch/docs/1.0.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/elasticsearch/docs/1.0.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/elasticsearch/docs/1.0.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Gemfire 1.4.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-gemfire/1.4.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/gemfire/docs/1.4.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/gemfire/docs/1.4.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/gemfire/docs/1.4.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Redis 1.3.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-redis/1.3.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/redis/docs/1.3.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/redis/docs/1.3.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/redis/docs/1.3.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data REST 2.1.4 - <a href=\"http://repo.spring.io/libs-release/org/springframework/data/spring-data-rest-webmvc/2.1.4.RELEASE\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/rest/docs/2.1.4.RELEASE/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/rest/docs/2.1.4.RELEASE/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/rest/docs/2.1.4.RELEASE/changelog.txt\">Changelog</a>\n</li>\n</ul><p>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.</p>\n\n<p>If you want to learn more about Spring Data, be sure to attend this year's SpringOne conference. The <a href=\"https://2014.event.springone2gx.com/schedule/2014-09-09\">schedule</a> contains a lot of data-related talks to introduce you to the latest features we're going to ship with Evans.</p>",
    "categories" : [ 
        "Releases"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-26:1742",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "This Week in Spring - August 26th, 2014",
    "content" : "<p>Holy cats! Can you believe how close we are to <a href=\"http://springone2gx.com/\">SpringOne2GX</a>?   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!  </p>\n\n<ul>\n<li>Spring ninja Greg Turnquist wanted to <a href=\"https://spring.io/blog/2014/08/21/building-a-restful-quotation-service-with-spring\">replace one of the services used in the guides with something more family-friendly and so stood up a bespoke substitute using Spring</a>!   This is a really nice read, check it out!</li>\n<li>I hope you'll <a href=\"https://spring.io/blog/2014/07/29/webinar-microservices-with-spring-boot-sept-16th\"> join me September 16th for a webinar looking at building microservices with Spring</a> </li>\n<li>On September 23rd, join Joram Barrez and I for a webinar   looking at <a href=\"https://spring.io/blog/2014/07/29/webinar-process-driven-spring-applications-with-activiti-sept-23rd\">how to build process-centric Spring applications with the open-source BPMN2 engine, Activiti</a> </li>\n<li>Patrick Grimard did a really nice job introducing <a href=\"http://patrickgrimard.com/2014/08/14/how-to-build-a-spring-boot-application-using-intellij-idea/\">how to build Spring Boot applications using IntelliJ IDEA</a>. Pretty obvious, I hope, but it's nice to have it in one place. </li>\n<li>The <em>GeekAbyte</em>   shows <a href=\"http://geekabyte.blogspot.sg/2014/08/how-to-inject-objects-into-spring-mvc.html\"> how to implement a <code>HandlerMethodArgumentResolver</code> in other to resolve and inject objects into Spring MVC controllers</a>. This is a <em>really</em> powerful technique if you need it.</li>\n<li>This looks interesting - a (Swiss?) German workshop on <a href=\"http://techup.ch/1647/build-modern-web-apps-with-spring-io-and-angularjs\">building modern web applications using Spring IO and Angular.js</a>. I wish I could go! Check it out if you're in the area - I'd love to know how it went and if the recording and/or slides are going to be available.</li>\n<li>Our pal  Tomasz Nurkiewicz is at it again, this <a href=\"http://www.javacodegeeks.com/2014/08/url-shortener-service-in-42-lines-of-code-in-java-spring-boot-redis.html\">time with a look on building a URL shortner (\"the new  'Hello, world!' in the IoT/microservice/era world\" - ha!) in 42 lines of code</a>. So... go, check it out! </li>\n<li>(Aforementioned Spring ninja) Greg Turnquist's writing a book on Spring Boot for PACKT, <a href=\"http://blog.greglturnquist.com/2014/08/chapter-5-of-learning-springboot-almost-done.html\">and he's just posted a summary of the latest chapter (on security) on his blog</a>. This is exciting stuff - definitely intriguing, check it out! Rock on, Greg! (Did I mention he'll be <a href=\"http://springone2gx.com/\">at SpringOne2GX, too</a>?)</li>\n<li>Pankaj Kumar introduces <a href=\"http://www.journaldev.com/4144/spring-data-mongodb-example-tutorial\">a simple  Spring Data MongoDB example in this post</a> </li>\n<li>This (Japanese-language) post (appears) to  <a href=\"http://code-examples-ja.hateblo.jp/entry/2014/08/23/Spring_Framework_Dependency_Injection(%E4%BE%9D%E5%AD%98%E6%80%A7%E6%B3%A8%E5%85%A5)%E3%81%A8%E3%81%AF\">introduce basic dependency injection with Spring</a>). Could do... </li>\n<li>This (Portuguese-language) post introduces how to create <a href=\"http://rodrigoportela.blog.br/2014/08/criando-um-securitycontext-para-testes-unitarios/\">a Spring Security context in unit tests</a>. This approach works, but readers should <em>definitely</em> check out some of the cool stuff Spring Security lead <a href=\"http://spring.io/team/rwinch\">Rob Winch</a> has <a href=\"https://spring.io/blog/2014/05/23/preview-spring-security-test-web-security\">been unveiling to support unit-testing secure applications recently</a>...<br>\n</li>\n<li>A few years ago I blogged about the amazing <a href=\"https://spring.io/blog/2013/03/04/spring-at-china-scale-alibaba-group-alipay-taobao-and-tmall/\">things the Alibaba group is doing to meet China-scale demand with Spring</a>. They built an (open-source) framework called Dubbo (which sits on top of Spring), and this <a href=\"http://www.kukujia.net/archives/389\">(Mandarin-language) post has a (simple) example demonstrating its use</a>. <em>Very</em> cool!</li>\n</ul><p>I am personally <em>super</em> excited to <a href=\"http://springone2gx.com\">see Greg, Rob, the rest of the Spring team, and of course all of you, at SpringOne2GX</a>! Register now if you haven't! </p>",
    "categories" : [ 
        "Engineering"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-20:1741",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Building a RESTful quotation service with Spring",
    "content" : "<p>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.</p>\n\n<h3>\n<a name=\"user-content-picking-your-tools\" class=\"anchor\" href=\"#picking-your-tools\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Picking your tools</h3>\n\n<p>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.</p>\n\n<ul>\n<li>\n<a href=\"http://projects.spring.io/spring-data-jpa/\">Spring Data JPA</a> - quickly pre-load, fetch, and potentially update content</li>\n<li>\n<a href=\"http://projects.spring.io/spring-framework/\">Spring MVC</a> - solid REST support since Spring 3</li>\n<li>\n<a href=\"http://projects.spring.io/spring-boot/\">Spring Boot</a> - create all the needed components with little to no effort</li>\n<li>\n<a href=\"http://start.spring.io\">http://start.spring.io</a> - assemble a project by simply checking the desired items on a form</li>\n</ul><p>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.</p>\n\n<h3>\n<a name=\"user-content-picking-your-content\" class=\"anchor\" href=\"#picking-your-content\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Picking your content</h3>\n\n<p>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.</p>\n\n<h3>\n<a name=\"user-content-time-to-code\" class=\"anchor\" href=\"#time-to-code\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Time to code!</h3>\n\n<p>To kick things off, I visited <a href=\"http://start.spring.io\">http://start.spring.io</a>. This <a href=\"https://github.com/spring-io/initializr\">Spring Boot app</a> 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.</p>\n\n<h4>\n<a name=\"user-content-defining-your-domain\" class=\"anchor\" href=\"#defining-your-domain\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Defining your domain</h4>\n\n<p>With the project unpacked and imported into my IDE, the first thing I did was copy the <a href=\"http://spring.io/guides/gs/messaging-reactor/#initial\">domain objects shown in the Reactor guide</a>. This way, I could ensure that the data sent out by my REST service was correct. Since the POJOs in my <em>Quoters Incorporated</em> app are almost identical, I won't post them here.</p>\n\n<p>Then I created a Spring Data repository.</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"kd\">public</span> <span class=\"kd\">interface</span> <span class=\"nc\">QuoteRepository</span> <span class=\"kd\">extends</span> <span class=\"n\">CrudRepository</span><span class=\"o\">&lt;</span><span class=\"n\">Quote</span><span class=\"o\">,</span> <span class=\"n\">Long</span><span class=\"o\">&gt;</span> <span class=\"o\">{}</span>\n</pre></div>\n\n<p>This empty interface definition handles <code>Quote</code> objects with an internal primary key of type <code>Long</code>. By extending the Spring Data Commons <code>CrudRepository</code>, it inherits a fistful of database operations we'll use later on.</p>\n\n<p>Next step? Initialize some data. I created a <code>DatabaseLoader</code> like this:</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"nd\">@Service</span>\n<span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"nc\">DatabaseLoader</span> <span class=\"o\">{</span>\n\n    <span class=\"kd\">private</span> <span class=\"kd\">final</span> <span class=\"n\">QuoteRepository</span> <span class=\"n\">repository</span><span class=\"o\">;</span>\n\n    <span class=\"nd\">@Autowired</span>\n    <span class=\"kd\">public</span> <span class=\"nf\">DatabaseLoader</span><span class=\"o\">(</span><span class=\"n\">QuoteRepository</span> <span class=\"n\">repository</span><span class=\"o\">)</span> <span class=\"o\">{</span>\n        <span class=\"k\">this</span><span class=\"o\">.</span><span class=\"na\">repository</span> <span class=\"o\">=</span> <span class=\"n\">repository</span><span class=\"o\">;</span>\n    <span class=\"o\">}</span>\n\n    <span class=\"nd\">@PostConstruct</span>\n    <span class=\"kt\">void</span> <span class=\"nf\">init</span><span class=\"o\">()</span> <span class=\"o\">{</span>\n        <span class=\"n\">repository</span><span class=\"o\">.</span><span class=\"na\">save</span><span class=\"o\">(</span><span class=\"k\">new</span> <span class=\"nf\">Quote</span><span class=\"o\">(</span><span class=\"s\">\"Working with Spring Boot is like pair-programming with the Spring developers.\"</span><span class=\"o\">));</span>\n        <span class=\"c1\">// more quotes...</span>\n    <span class=\"o\">}</span>\n\n<span class=\"o\">}</span>\n</pre></div>\n\n<ul>\n<li>It's marked as a <code>@Service</code> so it will be automatically picked up by <code>@ComponentScan</code> when the app starts.</li>\n<li>It uses constructor injection with auto-wiring to ensure a copy of the <code>QuoteRepository</code> is made available.</li>\n<li>\n<code>@PostConstruct</code> tells Spring MVC to run the data loading method after all beans have been created.</li>\n<li>Finally, the <code>init()</code> method uses Spring Data JPA to create a whole slew of quotations.</li>\n</ul><p>Because I have H2 as my database of choice (<strong>com.h2database:h2</strong>) in <code>build.gradle</code>, there is no database set up at all (thanks to Spring Boot).</p>\n\n<h4>\n<a name=\"user-content-creating-a-controller\" class=\"anchor\" href=\"#creating-a-controller\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Creating a controller</h4>\n\n<p>After I built this database layer, I went on to create the APIs. With Spring MVC, it wasn't hard at all.</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"nd\">@RestController</span>\n<span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"nc\">QuoteController</span> <span class=\"o\">{</span>\n\n    <span class=\"kd\">private</span> <span class=\"kd\">final</span> <span class=\"n\">QuoteRepository</span> <span class=\"n\">repository</span><span class=\"o\">;</span>\n\n    <span class=\"kd\">private</span> <span class=\"kd\">final</span> <span class=\"kd\">static</span> <span class=\"n\">Quote</span> <span class=\"n\">NONE</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nf\">Quote</span><span class=\"o\">(</span><span class=\"s\">\"None\"</span><span class=\"o\">);</span>\n\n    <span class=\"kd\">private</span> <span class=\"kd\">final</span> <span class=\"kd\">static</span> <span class=\"n\">Random</span> <span class=\"n\">RANDOMIZER</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nf\">Random</span><span class=\"o\">();</span>\n\n    <span class=\"nd\">@Autowired</span>\n    <span class=\"kd\">public</span> <span class=\"nf\">QuoteController</span><span class=\"o\">(</span><span class=\"n\">QuoteRepository</span> <span class=\"n\">repository</span><span class=\"o\">)</span> <span class=\"o\">{</span>\n        <span class=\"k\">this</span><span class=\"o\">.</span><span class=\"na\">repository</span> <span class=\"o\">=</span> <span class=\"n\">repository</span><span class=\"o\">;</span>\n    <span class=\"o\">}</span>\n\n    <span class=\"nd\">@RequestMapping</span><span class=\"o\">(</span><span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"s\">\"/api\"</span><span class=\"o\">,</span> <span class=\"n\">method</span> <span class=\"o\">=</span> <span class=\"n\">RequestMethod</span><span class=\"o\">.</span><span class=\"na\">GET</span><span class=\"o\">)</span>\n    <span class=\"kd\">public</span> <span class=\"n\">List</span><span class=\"o\">&lt;</span><span class=\"n\">QuoteResource</span><span class=\"o\">&gt;</span> <span class=\"nf\">getAll</span><span class=\"o\">()</span> <span class=\"o\">{</span>\n        <span class=\"k\">return</span> <span class=\"n\">StreamSupport</span><span class=\"o\">.</span><span class=\"na\">stream</span><span class=\"o\">(</span><span class=\"n\">repository</span><span class=\"o\">.</span><span class=\"na\">findAll</span><span class=\"o\">().</span><span class=\"na\">spliterator</span><span class=\"o\">(),</span> <span class=\"kc\">false</span><span class=\"o\">)</span>\n            <span class=\"o\">.</span><span class=\"na\">map</span><span class=\"o\">(</span><span class=\"n\">q</span> <span class=\"o\">-&gt;</span> <span class=\"k\">new</span> <span class=\"nf\">QuoteResource</span><span class=\"o\">(</span><span class=\"n\">q</span><span class=\"o\">,</span> <span class=\"s\">\"success\"</span><span class=\"o\">))</span>\n            <span class=\"o\">.</span><span class=\"na\">collect</span><span class=\"o\">(</span><span class=\"n\">Collectors</span><span class=\"o\">.</span><span class=\"na\">toList</span><span class=\"o\">());</span>\n    <span class=\"o\">}</span>\n\n    <span class=\"nd\">@RequestMapping</span><span class=\"o\">(</span><span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"s\">\"/api/{id}\"</span><span class=\"o\">,</span> <span class=\"n\">method</span> <span class=\"o\">=</span> <span class=\"n\">RequestMethod</span><span class=\"o\">.</span><span class=\"na\">GET</span><span class=\"o\">)</span>\n    <span class=\"kd\">public</span> <span class=\"n\">QuoteResource</span> <span class=\"nf\">getOne</span><span class=\"o\">(</span><span class=\"nd\">@PathVariable</span> <span class=\"n\">Long</span> <span class=\"n\">id</span><span class=\"o\">)</span> <span class=\"o\">{</span>\n        <span class=\"k\">if</span> <span class=\"o\">(</span><span class=\"n\">repository</span><span class=\"o\">.</span><span class=\"na\">exists</span><span class=\"o\">(</span><span class=\"n\">id</span><span class=\"o\">))</span> <span class=\"o\">{</span>\n            <span class=\"k\">return</span> <span class=\"k\">new</span> <span class=\"nf\">QuoteResource</span><span class=\"o\">(</span><span class=\"n\">repository</span><span class=\"o\">.</span><span class=\"na\">findOne</span><span class=\"o\">(</span><span class=\"n\">id</span><span class=\"o\">),</span> <span class=\"s\">\"success\"</span><span class=\"o\">);</span>\n        <span class=\"o\">}</span> <span class=\"k\">else</span> <span class=\"o\">{</span>\n            <span class=\"k\">return</span> <span class=\"k\">new</span> <span class=\"nf\">QuoteResource</span><span class=\"o\">(</span><span class=\"n\">NONE</span><span class=\"o\">,</span> <span class=\"s\">\"Quote \"</span> <span class=\"o\">+</span> <span class=\"n\">id</span> <span class=\"o\">+</span> <span class=\"s\">\" does not exist\"</span><span class=\"o\">);</span>\n        <span class=\"o\">}</span>\n    <span class=\"o\">}</span>\n\n    <span class=\"nd\">@RequestMapping</span><span class=\"o\">(</span><span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"s\">\"/api/random\"</span><span class=\"o\">,</span> <span class=\"n\">method</span> <span class=\"o\">=</span> <span class=\"n\">RequestMethod</span><span class=\"o\">.</span><span class=\"na\">GET</span><span class=\"o\">)</span>\n    <span class=\"kd\">public</span> <span class=\"n\">QuoteResource</span> <span class=\"nf\">getRandomOne</span><span class=\"o\">()</span> <span class=\"o\">{</span>\n        <span class=\"k\">return</span> <span class=\"nf\">getOne</span><span class=\"o\">(</span><span class=\"n\">nextLong</span><span class=\"o\">(</span><span class=\"mi\">1</span><span class=\"o\">,</span> <span class=\"n\">repository</span><span class=\"o\">.</span><span class=\"na\">count</span><span class=\"o\">()</span> <span class=\"o\">+</span> <span class=\"mi\">1</span><span class=\"o\">));</span>\n    <span class=\"o\">}</span>\n\n    <span class=\"kd\">private</span> <span class=\"kt\">long</span> <span class=\"nf\">nextLong</span><span class=\"o\">(</span><span class=\"kt\">long</span> <span class=\"n\">lowerRange</span><span class=\"o\">,</span> <span class=\"kt\">long</span> <span class=\"n\">upperRange</span><span class=\"o\">)</span> <span class=\"o\">{</span>\n        <span class=\"k\">return</span> <span class=\"o\">(</span><span class=\"kt\">long</span><span class=\"o\">)(</span><span class=\"n\">RANDOMIZER</span><span class=\"o\">.</span><span class=\"na\">nextDouble</span><span class=\"o\">()</span> <span class=\"o\">*</span> <span class=\"o\">(</span><span class=\"n\">upperRange</span> <span class=\"o\">-</span> <span class=\"n\">lowerRange</span><span class=\"o\">))</span> <span class=\"o\">+</span> <span class=\"n\">lowerRange</span><span class=\"o\">;</span>\n    <span class=\"o\">}</span>\n\n<span class=\"o\">}</span>\n</pre></div>\n\n<p>Let's break it down:</p>\n\n<ul>\n<li>The whole class is flagged as a <code>@RestController</code>. This means all routes return objects not views.</li>\n<li>I have some static objects, particular a <code>NONE</code> quote and a Java 8 <code>Random</code> for randomly picking quotes.</li>\n<li>It uses constructor injection to get a hold of <code>QuoteRepository</code>.</li>\n</ul><table>\n<thead><tr>\n<th>API</th>\n<th>Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td>/api</td>\n<td>Fetch ALL quotes</td>\n</tr>\n<tr>\n<td>/api/{id}</td>\n<td>Fetch quote <strong>id</strong>\n</td>\n</tr>\n<tr>\n<td>/api/random</td>\n<td>Fetch a random quote</td>\n</tr>\n</tbody>\n</table><p>To fetch ALL quotes, I use a Java 8 stream to wrap the Spring data's <code>findAll()</code> and in turn, wrap each one into a <code>QuoteResource</code>. The results are turned into a <code>List</code>.</p>\n\n<p>To fetch a single quote, it first tests if a given id exists. If not, return <code>NONE</code>. Otherwise, return a wrapped quote.</p>\n\n<p>Finally, to fetch a random quote, I use Java 8's <code>Random</code> utility inside the <code>nextLong()</code> utility method to fetch a <code>Long</code> with the <code>lowerRange</code> and <code>upperRange</code>, inclusively.</p>\n\n<blockquote>\n<p><strong>QUESTION:</strong> Why am I using <code>QuoteResource</code>? <code>Quote</code> is the core domain object returned by the <code>QuoteRepository</code>. To match the previous public API, I wrap each instance in a <code>QuoteResource</code> which includes a <strong>status</strong> code.</p>\n</blockquote>\n\n<h4>\n<a name=\"user-content-testing-the-results\" class=\"anchor\" href=\"#testing-the-results\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Testing the results</h4>\n\n<p>With this in place, the default <code>Application</code> class created by <a href=\"http://start.spring.io\">http://start.spring.io</a> was ready to run.</p>\n\n<pre><code>$ 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</code></pre>\n\n<p>Ta dah! </p>\n\n<p>To wrap things up, I built the JAR file and pushed it up to <a href=\"https://run.pivotal.io/\">Pivotal Web Services</a>. You can view the site yourself at <a href=\"http://gturnquist-quoters.cfapps.io/api/random\">http://gturnquist-quoters.cfapps.io/api/random</a>.</p>\n\n<p>Suffice it to say, I was able to tweak the <a href=\"https://spring.io/guides/gs/messaging-reactor/\">Reactor guide</a> by altering <a href=\"https://github.com/spring-guides/gs-messaging-reactor/blob/master/complete/src/main/java/hello/Receiver.java#L21\">ONE LINE OF CODE</a>. With that in place, I did some other clean up of the content and was done!</p>\n\n<p>To see the code, please visit <a href=\"https://github.com/gregturn/quoters\">https://github.com/gregturn/quoters</a>.</p>\n\n<h3>\n<a name=\"user-content-outstanding-issues\" class=\"anchor\" href=\"#outstanding-issues\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Outstanding issues</h3>\n\n<ul>\n<li>This RESTful service satisfies <a href=\"http://martinfowler.com/articles/richardsonMaturityModel.html#level2\">Level 2 - HTTP Verbs</a> of the Richardson Maturity Model. While good, it's best to shoot for <a href=\"http://martinfowler.com/articles/richardsonMaturityModel.html#level3\">Level 3 - Hypermedia</a>. With <a href=\"http://projects.spring.io/spring-hateoas\">Spring HATEOAS</a>, it's easier than ever to add hypermedia links. Stay tuned.</li>\n<li>There is no friendly web page. This would be nice, but it isn't required.</li>\n<li>Content is fixed and defined inside the app. To make content flexible, we would need to open the door to POSTs and PUTs. This would introduce the desire to also secure things properly.</li>\n</ul><p>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!</p>\n\n<h3>\n<a name=\"user-content-springone-2gx-2014\" class=\"anchor\" href=\"#springone-2gx-2014\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>SpringOne 2GX 2014</h3>\n\n<p>Book your place at <a href=\"https://2014.event.springone2gx.com/register\">SpringOne</a> 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 <a href=\"https://2014.event.springone2gx.com/schedule/sessions/spring_data_rest_data_meets_hypermedia.html\">Spring Data REST - Data Meets Hypermedia</a> to see how to merge Spring Data and RESTful services.</p>",
    "categories" : [ 
        "Engineering"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-18:1732",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Spring Security 4.0.0.M2 Released",
    "content" : "<p>I'm pleased to announce the release of Spring Security 4.0.0.M2 available in the <a href=\"http://docs.spring.io/spring-security/site/docs/4.0.0.M2/reference/htmlsingle/#get-spring-security\">Spring Milestone repository</a>.</p>\n\n<p><div class=\"callout\">\n<div class=\"callout-title\">SpringOne 2GX 2014 is around the corner</div>\nBook your place at <a href=\"https://2014.event.springone2gx.com/register\">SpringOne</a> 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. <a href=\"https://2014.event.springone2gx.com/schedule/sessions/from_0_to_spring_security_4_0.html\">From 0 to Spring Security 4.0</a> session will contain detailed information on how to get started with Spring Security and provide a deep dive into the new features found in Spring Security 4. Of course there plenty of other <a href=\"https://2014.event.springone2gx.com/schedule/2014-09-09\">exciting Spring related talks</a>!\n</div></p>\n\n<h2>\n<a name=\"user-content-changelog\" class=\"anchor\" href=\"#changelog\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Changelog</h2>\n\n<p>You can find details about this release in the <a href=\"https://jira.spring.io/secure/ReleaseNote.jspa?projectId=10040&amp;version=14530\">release notes</a>. Highlights of the release include:</p>\n\n<ul>\n<li>Support for WebSocket Security using Spring's messaging abstraction</li>\n<li>Spring Data integration</li>\n<li>\n<a href=\"https://github.com/spring-projects/spring-session\">Spring Session</a> was produced out of the work necessary for this release. In an application server independent way you can easily use a custom backend (i.e. Redis) as the <code>HttpSession</code> implementation. See the project page for additional features of this exciting new project.</li>\n<li>Enhancements and fixes to the testing support\n\n<ul>\n<li>Easier integration with <code>MockMvc</code> through <code>SecurityMockMvcConfigurers</code>\n</li>\n<li>You no longer need to specify <code>WithSecurityContextTestExecutionListener</code> on your tests</li>\n<li>\n<code>@WithSecurityContext</code> works even with custom <code>SecurityContextRepository</code> implementations</li>\n<li>Support for digest and certificate based authentication testing</li>\n</ul>\n</li>\n<li>Support nested static groups in LDAP Authentication</li>\n<li>Lots of integration tests added to the sample applications</li>\n<li>Updated minimum version of Spring 4.1 RC2. This was necessary for enough of the features, that it made sense to do across the board</li>\n</ul><p>Stay tuned to the <a href=\"http://spring.io/blog\">spring.io blog</a> for a blog series introducing these exciting new features.</p>\n\n<p><a href=\"http://docs.spring.io/spring-security/site/docs/4.0.0.M2/reference/htmlsingle/\">Reference</a> | <a href=\"http://docs.spring.io/spring-security/site/docs/4.0.0.M2/apidocs/\">Javadoc</a> | <a href=\"http://docs.spring.io/spring-security/site/docs/4.0.0.M2/guides/\">Guides</a></p>",
    "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" : "<p>Spring Security 3.2.5 (<a href=\"https://jira.spring.io/secure/ReleaseNote.jspa?projectId=10040&amp;version=14531\">change log</a>) and 3.1.7 (<a href=\"https://jira.spring.io/secure/ReleaseNote.jspa?projectId=10040&amp;version=14401\">change log</a>) have been released and are available in Maven Central. Important highlights of this release are:</p>\n\n<ul>\n<li>This release contains a fix for <a href=\"https://jira.spring.io/browse/SEC-2688\">CVE-2014-3527</a> which resolves an issue where a malicious CAS Service can impersonate another CAS Service when using proxy tickets.</li>\n<li>This release updates the transitive dependencies of the cas module to cas-client-core which has a fix for <a href=\"https://www.mail-archive.com/cas-user@lists.jasig.org/msg17338.html\">CVE-2014-4172</a>. This issue was not in Spring Security itself, but the library in which it depends on.</li>\n</ul><p>A special thanks to <a href=\"https://twitter.com/battags\">Scott Battaglia</a> &amp; the rest of the <a href=\"http://www.jasig.org/cas/team\">CAS team</a> 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.</p>\n\n<p><strong>SpringOne 2GX 2014 is around the corner</strong></p>\n\n<p><a href=\"https://2014.event.springone2gx.com/register\">Book your place at SpringOne</a> 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 <a href=\"https://2014.event.springone2gx.com/schedule/2014-09-09\">deep dive sessions</a> on the latest updates to Spring, Groovy, and Grails!</p>",
    "categories" : [ 
        "Releases"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-15:1729",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Spring Framework 4.1 RC2 Released",
    "content" : "<p>On behalf of the team I am pleased to announce the second release candidate of Spring Framework 4.1 is now available from our <a href=\"http://repo.spring.io/milestone/\">milestone repository</a>. This release includes <a href=\"https://jira.spring.io/browse/SPR/fixforversion/14397/?selectedTab=com.atlassian.jira.jira-projects-plugin:version-issues-panel\">over 70 fixes and improvements</a>.</p>\n\n<p>Spring 4.1 is <em>really</em> 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 <a href=\"https://twitter.com/springcentral\">Twitter</a>, <a href=\"http://stackoverflow.com/tags/spring\">StackOverflow</a> or <a href=\"https://jira.spring.io/browse/SPR\">JIRA</a>.</p>\n\n<p><strong>SpringOne 2GX 2014 is around the corner</strong></p>\n\n<p>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. 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.</p>",
    "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" : "<p>We are happy to announce the first release candidate of the Spring Data release train <a href=\"https://github.com/spring-projects/spring-data-commons/wiki/Release-Train-Evans\">Evans</a>. We ship the following modules:</p>\n\n<ul>\n<li>Spring Data Commons 1.9 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-commons/1.9.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/commons/docs/1.9.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/commons/docs/1.9.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/commons/docs/1.9.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data JPA 1.7 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-jpa/1.7.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/jpa/docs/1.7.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/jpa/docs/1.7.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/jpa/docs/1.7.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data MongoDB 1.6 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-mongodb/1.6.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/mongodb/docs/1.6.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/mongodb/docs/1.6.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/mongodb/docs/1.6.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Neo4j 3.2 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-neo4j/3.2.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/neo4j/docs/3.2.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/neo4j/docs/3.2.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/neo4j/docs/3.2.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Solr 1.3 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-solr/1.3.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/solr/docs/1.3.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/solr/docs/1.3.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/solr/docs/1.3.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Couchbase 1.2 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-couchbase/1.2.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/couchbase/docs/1.2.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/couchbase/docs/1.2.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/couchbase/docs/1.2.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Cassandra 1.1 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-cassandra/1.1.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/cassandra/docs/1.1.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/cassandra/docs/1.1.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/cassandra/docs/1.1.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Elasticsearch 1.1 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-elasticsearch/1.1.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/elasticsearch/docs/1.1.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/elasticsearch/docs/1.1.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/elasticsearch/docs/1.1.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Gemfire 1.5 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-gemfire/1.5.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/gemfire/docs/1.5.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/gemfire/docs/1.5.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/gemfire/docs/1.5.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data Redis 1.4 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-redis/1.4.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/redis/docs/1.4.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/redis/docs/1.4.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/redis/docs/1.4.0.RC1/changelog.txt\">Changelog</a>\n</li>\n<li>Spring Data REST 2.2 RC1 - <a href=\"http://repo.spring.io/libs-milestone/org/springframework/data/spring-data-rest-webmvc/2.2.0.RC1\">Artifacts</a> - <a href=\"http://docs.spring.io/spring-data/rest/docs/2.2.0.RC1/api\">JavaDocs</a> - <a href=\"http://docs.spring.io/spring-data/rest/docs/2.2.0.RC1/reference/html\">Documentation</a> - <a href=\"http://docs.spring.io/spring-data/rest/docs/2.2.0.RC1/changelog.txt\">Changelog</a>\n</li>\n</ul><p>Some of the highlights that happened since the <a href=\"https://spring.io/blog/2014/07/10/first-milestone-of-spring-data-release-train-evans-available\">first milestone</a> are:</p>\n\n<ul>\n<li>Enhanced <a href=\"https://jira.spring.io/browse/DATACMNS-526\">multistore support</a> in case you want to use different stores side by side.</li>\n<li>Support for <a href=\"https://jira.spring.io/browse/DATACMNS-557\">custom repository implementations when using CDI</a>.</li>\n<li>Text search integration for MongoDB repositories.</li>\n<li>\n<a href=\"https://github.com/spring-projects/spring-data-redis/blob/fd361a186899c2aef124d2801fb78ef733d05baa/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java#L119\">Configuration options</a> for Redis sentinels.</li>\n<li>\n<a href=\"https://jira.spring.io/browse/DATAES-89\">Geo queries</a> for Elasticsearch.</li>\n<li>We moved the reference documentation from Docbook to Asciidoctor.</li>\n</ul><p>Overall <a href=\"https://jira.spring.io/issues/?filter=14750\">95 tickets</a> have be processed so make sure you've booked your place for <a href=\"http://springone2gx.com/\">SpringOne</a> 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 <a href=\"https://github.com/spring-projects/spring-data-commons/wiki/Release-Train-Evans\">release train wiki page</a> might be a good start to find out about relevant new stuff as well.</p>\n\n<p>Got questions? Have feedback? Found a bug? Don't hesitate to contact us! We're looking forward to getting in touch via <a href=\"http://twitter.com/springdata\">Twitter</a>, <a href=\"http://stackoverflow.com/questions/tagged/spring-data\">StackOverflow</a> or <a href=\"http://jira.spring.io\">JIRA</a>.</p>",
    "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" : "<p>Welcome to another installment of <em>This Week in Spring</em>. We've got a <em>lot</em> 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, <a href=\"http://springone2gx.com\">now's the time to do so</a>!</p>\n\n<ol>\n<li>Spring Security lead and all-around sleepless ninja Rob Winch has just announced that Spring MVC Test HtmlUnit 1.0.0.M2 has been released. This is an <em>awesome</em> release if you're trying to <a href=\"http://spring.io/blog/2014/08/06/spring-mvc-test-htmlunit-1-0-0-m2-released\">unit test real pages with Spring MVC</a>\n</li>\n<li>\n<a href=\"http://spring.io/blog/2014/08/07/spring-boot-1-1-5-released\">Spring Boot 1.1.5 has just been released</a>. The new release mainly addresses a few issues and is a recommended upgrade for all users.</li>\n<li>I really enjoyed this blog, <a href=\"http://www.genbetadev.com/frameworks/que-es-spring-framework\">¿Qué es Spring Framework?</a>, which tries to explain what the fundamental value of Spring is. Largely, the (Spanish language) article explains that Spring handles the lifecycle for objects in a consistent way. It's easy to plug in various frameworks, software, around the edges when the fundamental life-cycle is handled. I would point out that this post uses Spring 3.0 and XML configuration, which is a bit outdated, though certainly still works. </li>\n<li>The RebelLabs folks are back at it with an interesting look at web framework usage. Check out this <a href=\"http://zeroturnaround.com/rebellabs/top-4-java-web-frameworks-revealed-real-life-usage-data-of-spring-mvc-vaadin-gwt-and-jsf/\">latest report which has Spring MVC leading </a>  the charge (by a lot).</li>\n<li>This is a nice post looking at how to use Spring MVC (as part of Spring framework 4.x) to <a href=\"http://www.concretepage.com/spring-4/spring-4-mvc-single-multiple-file-upload-example-with-tomcat\">handle file uploads</a>\n</li>\n<li>The <em>Mr. Haki * blog has a nice post <a href=\"http://mrhaki.blogspot.com/2014/08/gradle-goodness-getting-more-dependency.html\">on analyzing dependencies using Gradle</a>, with an example based on Spring Boot. <a href=\"http://start.spring.io\">Spring Boot, of course, is easy to get started with</a>, can be used with Maven *or</em> Gradle, and has numerous benefits, not the least of which being that it makes it dead simple to use Spring libraries in your project without worrying about version mismatches. </li>\n<li> Stuck on JAX-RS and JSF? Still want to use Spring Security? This post - <a href=\"http://ezjsf.blogspot.com/2014/08/javaee-rest-jax-rs-with-spring-security.html\">from the JSF Usefullness post</a> - has the code snippets that (sort of) demonstrate a path forward. Granted, you'll have an easier time of doing this using straight Spring. No need to add all that extra Java EE weight.. </li>\n<li> This is a sort of oldie-but-a-goodie: a post on how to <a href=\"http://www.technicalkeeda.com/spring/jquery-ajax-autosave-example-in-spring-mvc\">implement a JQuery-powered autosave example in Spring MVC</a>\n</li>\n<li> This is a (particularly tortured) example of <a href=\"http://www.mastertheboss.com/spring/spring-jdbc-application-on-wildfly\">how to write a Spring application that uses Primefaces and runs on the Wildfly application server</a>. I don't see why you'd need all this indirection when Spring has good JSF support out of the box. Additionally, there's no reason to recreate the <code>JdbcTemplate</code> or inject an <code>ApplicationContext</code> into a bean. Maybe it'll help somebody as a first-cut, though. </li>\n</ol><p>So, did I mention <strong>SpringOne2GX 2014</strong>? It's right around the corner! I'll be there, <a href=\"http://spring.io/team\">and so will everyone from the Spring team</a>, 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 <em>not</em> miss out. <a href=\"http://springone2gx.com\">Register today</a>!</p>",
    "categories" : [ 
        "Engineering"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-07:1722",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Spring Boot 1.1.5 released",
    "content" : "<p>We are pleased to announce that Spring Boot 1.1.5 has been released and is available from <a href=\"http://repo.spring.io/release\">repo.spring.io</a> and <a href=\"http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.springframework.boot%22\">Maven Central</a>. </p>\n\n<p>This 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 <a href=\"https://github.com/spring-projects/spring-boot/issues?milestone=20&amp;state=closed\">issue tracker</a>.</p>\n\n<p><a href=\"http://projects.spring.io/spring-boot/\">Project Page</a> | <a href=\"https://github.com/spring-projects/spring-boot\">GitHub</a> | <a href=\"https://github.com/spring-projects/spring-boot/issues\">Issues</a> | <a href=\"http://docs.spring.io/spring-boot/docs/1.1.5.RELEASE/reference/htmlsingle\">Documentation</a></p>",
    "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" : "<p>I'm pleased to announce the second milestone release of <a href=\"https://github.com/spring-projects/spring-test-htmlunit\">Spring MVC Test HtmlUnit</a>.</p>\n\n<p>The project’s aim is to provide integration between <a href=\"Spring%20MVC%20Test%20Framework\">Spring MVC Test</a> and <a href=\"http://htmlunit.sourceforge.net/\">HtmlUnit</a>. This simplifies performing end to end testing when using HTML based views.</p>\n\n<p><strong>Changelog</strong></p>\n\n<p>You can view the complete <a href=\"https://github.com/spring-projects/spring-test-htmlunit/issues?q=milestone%3A1.0.0.M2+is%3Aclosed\">changelog</a> on github. Below are the highlights of the release:</p>\n\n<ul>\n<li>The release contains <a href=\"http://docs.spring.io/spring-test-htmlunit/docs/current/reference/\">Reference Documentation</a> and Publishes the <a href=\"http://docs.spring.io/spring-test-htmlunit/docs/current/api/\">API Docs</a>\n</li>\n<li>The artifact name has changed from spring-test-mvc-htmlunit to spring-test-htmlunit See the <a href=\"http://docs.spring.io/spring-test-htmlunit/docs/current/reference/#updating-dependencies\">Updating Dependencies</a> to see how to add Spring MVC Test HtmlUnit as either a Maven or Gradle dependency</li>\n<li>The project name has been changed to Spring MVC Test HtmlUnit in order to better align with Spring MVC Test's name</li>\n<li>Context root of \"\" is now supported</li>\n<li>\n<a href=\"https://github.com/spring-projects/spring-test-htmlunit/issues/24\">Support for external resources</a> has been added. See the javadoc of <a href=\"http://docs.spring.io/spring-test-htmlunit/docs/current/api/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnection.html\">DelegatingWebConnection</a> for additional details.</li>\n<li>Bug fixes</li>\n</ul><p><div class=\"callout\">\n<div class=\"callout-title\">SpringOne 2GX 2014 is around the corner</div>\nBook your place at <a href=\"https://2014.event.springone2gx.com/register\">SpringOne</a> 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. <a href=\"https://2014.event.springone2gx.com/schedule/sessions/the_quest_for_the_holy_integration_test.html\">The Quest for the Holy Integration Test</a> session will contain detailed information on how to test your Spring web applications including detailed information about Spring MVC Test HtmlUnit. Of course there plenty of other exciting Spring related talks!\n</div></p>",
    "categories" : [ 
        "Releases"
    ]
},

{
    "_id" : "tag:spring.io,2014-08-06:1720",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "This Week in Spring - August 5th, 2014",
    "content" : "<p>Welcome to another installment of <em>This Week in Spring</em>! As usual, we've got a lot to cover so let's get to it.  </p>\n\n<ol>\n<li>Spring Cloud lead Ramnivas Laddad  has written up a nice post that looks at how to extend <a href=\"http://spring.io/blog/2014/08/05/extending-spring-cloud\">Spring Cloud to consume <em>other</em> services in a consistent manner</a>. </li>\n<li> I liked Samer Abdelkafi's blog introducing <a href=\"http://samerabdelkafi.wordpress.com/2014/08/03/spring-mvc-full-java-based-config/\">how to use Java configuration with Spring</a>. It's always a good time to review..</li>\n<li> The Pragmatists blog has a detailed look at the sort of (tortured) steps involved in <a href=\"http://pragmatists.pl/blog/2014/07/integrating-spring-with-play-framework-1-0-jpa-management/\">using Spring with the Play! web framework</a> </li>\n<li> Biju Kunjummen put together a great post that looks at <a href=\"http://www.javacodegeeks.com/2014/08/deploying-a-spring-boot-application-to-cloud-foundry-with-spring-cloud.html\">how to deploy a Spring Cloud enabled application to Cloud Foundry</a> </li>\n<li> Thys Michels  is back at it again, this time with a post on <a href=\"http://thysmichels.com/2014/08/04/spring-mvc-angularjs-todo-list/\">building a ToDo application with Spring MVC and Angular.js</a> </li>\n<li> I am really happy that this link is in this week's roundup, the author -Priyadarshini - did an amazing job! Check out this really thoughtful introduction <a href=\"http://www.programming-free.com/2014/07/spring-data-rest-with-angularjs-crud.html\">to using Spring Boot to build a CRUD-capable Spring Boot-based application</a>.</li>\n<li> The <code>/dev/Kico</code> blog has a <a href=\"http://www.itexto.net/devkico/?p=1919\">nice Portguese-language post on what's new in Spring 4</a>\n</li>\n<li> Ahmed Essam El-din Ahmed's roundup of the <a href=\"http://blog.eramax.org/java-security-frameworks/\">integrations for security among the various web frameworks - including Spring MVC -  is fantastic</a>.<br>\n</li>\n<li> Did you know that <a href=\"http://myshittycode.com/2014/08/01/spring-invoking-stored-procedure/\">Spring provides a <code>StoredProcedure</code> object that can be used to wrap and adapt the painful setup involved in invoking a stored procedure from JDBC</a>.<br>\n</li>\n<li>  Theodora Fragkouli put together a <a href=\"http://examples.javacodegeeks.com/enterprise-java/spring/mvc/spring-mvc-form-handling-example/\">nice post on how to handle Spring MVC form handling</a> </li>\n<li> The ITEssays blog has a code recipe demonstrating <a href=\"http://itessays.com/java-development-technology/spring-mongodb-mongodb.html\">how to use Spring Data MongoDB with XML configuration</a>. </li>\n</ol><p><strong>SpringOne 2GX 2014 is around the corner</strong></p>\n\n<p>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. 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.</p>",
    "categories" : [ 
        "Engineering"
    ]
},

{
    "_id" : "tag:spring.io,2014-07-24:1697",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Extending Spring Cloud",
    "content" : "<p>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 <a href=\"https://spring.io/blog/2014/06/03/introducing-spring-cloud\">first</a> and <a href=\"https://spring.io/blog/2014/07/29/using-spring-cloud-programmatically\">second</a> blog in this series to acquire sufficient background.</p>\n\n<h1>\n<a name=\"user-content-the-three-axes-of-extensibility\" class=\"anchor\" href=\"#the-three-axes-of-extensibility\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>The three axes of extensibility</h1>\n\n<p>Spring 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.</p>\n\n<ol>\n<li><p><strong>Cloud Platforms</strong>: 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.</p></li>\n<li><p><strong>Cloud Services</strong>: 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.</p></li>\n<li><p><strong>Frameworks</strong>: Spring Cloud currently supports Spring frameworks through the <a href=\"https://github.com/spring-projects/spring-cloud/tree/master/spring-cloud-spring-service-connector\">spring-service-connector</a> 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.</p></li>\n</ol><p>In the <a href=\"https://spring.io/blog/2014/07/29/using-spring-cloud-programmatically\">previous blog</a>, we looked at how you would use <code>CloudFactory</code> and <code>Cloud</code> 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.</p>\n\n<h1>\n<a name=\"user-content-cloud-platform-extensibility\" class=\"anchor\" href=\"#cloud-platform-extensibility\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Cloud Platform Extensibility</h1>\n\n<p>The main type you will need to be familiar with to extend Spring Cloud to a new cloud platform is <code>CloudConnector</code>, which is a simple three-method interface:</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"kd\">public</span> <span class=\"kd\">interface</span> <span class=\"nc\">CloudConnector</span> <span class=\"o\">{</span>\n    <span class=\"kt\">boolean</span> <span class=\"nf\">isInMatchingCloud</span><span class=\"o\">();</span>\n    <span class=\"n\">ApplicationInstanceInfo</span> <span class=\"nf\">getApplicationInstanceInfo</span><span class=\"o\">();</span>\n    <span class=\"n\">List</span><span class=\"o\">&lt;</span><span class=\"n\">ServiceInfo</span><span class=\"o\">&gt;</span> <span class=\"nf\">getServiceInfos</span><span class=\"o\">();</span>\n<span class=\"o\">}</span>\n</pre></div>\n\n<p>The <code>isInMatchingCloud()</code> 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 <code>VCAP_APPLICATION</code> environment variable, whereas the Heroku connector looks for the existence of the <code>DYNO</code> environment variable. The <code>getApplicationInstanceInfo()</code> method returns information about the current application instance (app name, host, port, and application properties). The most interesting method <code>getServiceInfos()</code> returns a list with each element containing enough information so that applications know how to connect to each service. Exact information contained in each <code>ServiceInfo</code> object is left up to each implementation (the <code>ServiceInfo</code> as such defines only one method: <code>getId()</code>).</p>\n\n<p>Once you create an implementation of <code>CloudConnector</code>, you need to make Spring Cloud aware of it. For all extension points, Spring Cloud uses a uniform mechanism based on <a href=\"http://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html\">ServiceLoader</a>. As applied to Spring Cloud for platform extensibility, it boils down to including a file named <code>/META-INF/services/org.springframework.cloud.CloudConnector</code> 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.</p>\n\n<h1>\n<a name=\"user-content-service-extensibility\" class=\"anchor\" href=\"#service-extensibility\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Service Extensibility</h1>\n\n<p>The <code>ServiceInfoCreator</code> interface provides an extension point to work with a new service.</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"kd\">public</span> <span class=\"kd\">interface</span> <span class=\"nc\">ServiceInfoCreator</span><span class=\"o\">&lt;</span><span class=\"n\">SI</span> <span class=\"kd\">extends</span> <span class=\"n\">ServiceInfo</span><span class=\"o\">,</span> <span class=\"n\">SD</span><span class=\"o\">&gt;</span> <span class=\"o\">{</span>\n    <span class=\"kd\">public</span> <span class=\"kt\">boolean</span> <span class=\"nf\">accept</span><span class=\"o\">(</span><span class=\"n\">SD</span> <span class=\"n\">serviceData</span><span class=\"o\">);</span>\n    <span class=\"kd\">public</span> <span class=\"n\">SI</span> <span class=\"nf\">createServiceInfo</span><span class=\"o\">(</span><span class=\"n\">SD</span> <span class=\"n\">serviceData</span><span class=\"o\">);</span>\n<span class=\"o\">}</span>\n</pre></div>\n\n<p>The generic parameter <code>SI</code> defines the kind of <code>ServiceInfo</code> it will create, whereas the <code>SD</code> 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 <code>Map</code> based on the <code>VCAP_SERVICES</code> 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 <code>ServiceInfoCreator</code>. The <code>accept()</code> 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 <code>createServiceInfo()</code> must return a <code>ServiceInfo</code> object. If it is a completely new service, you may also have to implement <code>ServiceInfo</code> for that, else you can use one of the existing ones.</p>\n\n<p>Once you have implemented a <code>ServiceInfoCreator</code>, 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 <code>CloudConnector</code> dependent. For Cloud Foundry, it is  <code>/META-INF/services/org.springframework.cloud.cloudfoundry.CloudFoundryServiceInfoCreator</code>  (theoretically, a <code>CloudConnector</code> implementation may decide to use another extension mechanism, but Spring Cloud doesn’t recommend that).</p>\n\n<p>As discussed in the previous blog, a cloud app developer may decide to work directly with a <code>ServiceInfo</code> object. As such, if you just implement a <code>ServiceInfoCreator</code>, you would have provided some benefit already. However, working with a raw <code>ServiceInfo</code> object may not be appreciated by many developers focused on developing apps, so you will implement the next extension as well.</p>\n\n<h1>\n<a name=\"user-content-framework-extensibility\" class=\"anchor\" href=\"#framework-extensibility\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Framework Extensibility</h1>\n\n<p>The last extensibility point is <code>ServiceConnectorCreator</code>. Its job is to transform <code>ServiceInfo</code> into a service connector that is suitable for consumption in the framework the app is using. For example, it could transform <code>MysqlServiceInfo</code> into a <code>DataSource</code> object. Out of the box, Spring Cloud supports connectors for <code>DataSource</code> and a few <a href=\"http://projects.spring.io/spring-data\">Spring Data</a> and <a href=\"http://projects.spring.io/spring-amqp\">Spring AMQP</a> 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.</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"kd\">public</span> <span class=\"kd\">interface</span> <span class=\"nc\">ServiceConnectorCreator</span><span class=\"o\">&lt;</span><span class=\"n\">SC</span><span class=\"o\">,</span> <span class=\"n\">SI</span> <span class=\"kd\">extends</span> <span class=\"n\">ServiceInfo</span><span class=\"o\">&gt;</span> <span class=\"o\">{</span>\n    <span class=\"n\">SC</span> <span class=\"nf\">create</span><span class=\"o\">(</span><span class=\"n\">SI</span> <span class=\"n\">serviceInfo</span><span class=\"o\">,</span> <span class=\"n\">ServiceConnectorConfig</span> <span class=\"n\">serviceConnectorConfig</span><span class=\"o\">);</span>\n    <span class=\"o\">...</span>\n<span class=\"o\">}</span>\n</pre></div>\n\n<p>There are a couple more methods; however, you will normally extend the <code>AbstractServiceConnectorCreator</code> that takes care of implementing those. </p>\n\n<p>The <code>SC</code> generic parameter to <code>ServiceConnectorCreator</code> is bound to the type of connector it will create, such as <code>DataSource</code>, whereas the <code>SI</code> parameter signifies the type of <code>ServiceInfo</code> it can work with.</p>\n\n<p>The <code>create()</code> method is supplied with a <code>ServiceInfo</code> 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.</p>\n\n<p>Once the implementation is ready, just put it in a file named <code>/META-INF/services/org.springframework.cloud.service.ServiceConnectorCreator</code>. Spring Cloud will use the Service Loader mechanism described earlier.</p>\n\n<h1>\n<a name=\"user-content-summary\" class=\"anchor\" href=\"#summary\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"></span></a>Summary</h1>\n\n<p>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.</p>",
    "categories" : [ 
        "Engineering"
    ]
},

{
    "_id" : "tag:spring.io,2014-07-30:1715",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Spring XD 1.0 GA Released",
    "content" : "<p>On behalf of the Spring XD team, I am very pleased to announce the general availability of Spring XD 1.0!  You can <a href=\"http://repo.spring.io/release/org/springframework/xd/spring-xd/1.0.0.RELEASE/spring-xd-1.0.0.RELEASE-dist.zip\">download the zip distribution</a>.  You can also install on OSX <a href=\"https://github.com/spring-projects/spring-xd/wiki/Getting-Started#osx-homebrew-installation\">using homebrew</a> and on RHEL/CentOs <a href=\"https://github.com/spring-projects/spring-xd/wiki/Getting-Started#redhatcentos-installation\">using yum</a>.</p>\n\n<p>Spring 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:</p>\n\n<ul>\n<li>Data collection</li>\n<li>Real-time streaming and analytics</li>\n<li>Data cleansing</li>\n<li>Batch processing (both on and off Hadoop)</li>\n<li>Machine learning and exploratory data analysis</li>\n<li>Visualization and Reporting</li>\n<li>Closed loop analytics between real-time and batch processing</li>\n</ul><p>Spring 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.</p>\n\n<p>Spring XD provides:</p>\n\n<ul>\n<li><a href=\"https://github.com/spring-projects/spring-xd/wiki/XD-Distributed-Runtime\">A distributed, fault tolerant and scalable runtime</a></li>\n<li>A unified platform for <a href=\"https://github.com/spring-projects/spring-xd/wiki/Streams\">Stream</a> and <a href=\"https://github.com/spring-projects/spring-xd/wiki/Batch-Jobs\">Batch</a> Processing supporting\n\n<ul>\n<li>Popular <a href=\"https://github.com/spring-projects/spring-xd/wiki/Sources\">sources</a>, <a href=\"https://github.com/spring-projects/spring-xd/wiki/Processors\">processors</a>, and <a href=\"https://github.com/spring-projects/spring-xd/wiki/Sinks\">sinks</a> for stream processing</li>\n<li>Stream processing using <a href=\"https://github.com/spring-projects/spring-xd/wiki/Analytics#counters-and-gauges\">NoSQL Analytics</a>\n</li>\n<li><a href=\"https://github.com/spring-projects/spring-xd/wiki/Creating-a-Job-Module#orchestrating-hadoop-jobs\">Hadoop Batch workflow orchestration</a></li>\n<li><a href=\"https://github.com/spring-projects/spring-xd/wiki/Batch-Jobs#import-csv-files-to-jdbc-filejdbc\">Off-Hadoop Batch Jobs</a></li>\n<li>Closed loop machine learning from Batch to <a href=\"https://github.com/spring-projects/spring-xd/wiki/Analytics#predictive-analytics\">Real-time scoring</a> via <a href=\"https://github.com/jpmml\">JPMML</a>\n</li>\n</ul>\n</li>\n<li>Runtime portability: easy to setup, operate and deploy on <a href=\"https://github.com/spring-projects/spring-xd/wiki/Running-Distributed-Mode\">VM/on-metal cluster</a>, <a href=\"https://github.com/spring-projects/spring-xd/wiki/Running-on-YARN\">YARN</a>, or <a href=\"https://github.com/spring-projects/spring-xd-ec2\">EC2</a>\n</li>\n<li>Hadoop distribution portability: certified against <a href=\"https://github.com/spring-projects/spring-xd/wiki/Running-Distributed-Mode#using-hadoop\">six Hadoop distributions</a>\n</li>\n<li>Enterprise readiness as it is built on proven Spring foundation projects such as Spring Integration, Spring Batch, and Spring Data</li>\n<li>Ease of use\n\n<ul>\n<li>\n<a href=\"https://github.com/spring-projects/spring-xd/wiki/DSL-Reference\">DSL</a> to create streams and jobs using many pre-built components</li>\n<li>\n<a href=\"https://github.com/spring-projects/spring-xd/wiki/Shell\">Interactive Shell</a> with tab completion</li>\n<li>\n<a href=\"https://github.com/spring-projects/spring-xd/wiki/AdminUI\">Admin UI</a> and <a href=\"https://github.com/spring-projects/spring-xd/wiki/REST-API\">REST API</a>\n</li>\n<li>Easy to <a href=\"https://github.com/spring-projects/spring-xd/wiki/Creating-a-Source-Module#test-the-module-locally\">develop and test custom modules</a> as well as <a href=\"https://github.com/spring-projects/spring-xd/wiki/Extending-XD\">extend the runtime</a>.</li>\n<li>Custom modules can easily incorporate other Spring projects, such as those in Spring Data, e.g. Spring Data REST for creating dashboards </li>\n</ul>\n</li>\n</ul><p>There are several resources available to help you get started using Spring XD.</p>\n\n<ul>\n<li><a href=\"http://www.infoq.com/articles/introducing-spring-xd\">InfoQ article</a></li>\n<li><a href=\"http://bit.ly/POSHyt0005\">Spring XD Meetup Recording</a></li>\n<li><a href=\"https://spring.io/guides/gs/spring-xd/\">Getting Started Guide</a></li>\n<li><a href=\"http://projects.spring.io/spring-xd/\">Project Page</a></li>\n<li><a href=\"http://docs.spring.io/spring-xd/docs/1.0.0.RELEASE/reference/html/\">Reference Documentation</a></li>\n</ul><p>There are many samples available in our <a href=\"https://github.com/spring-projects/spring-xd-samples\">samples repository</a>  Here are a few that show the range of functionality available</p>\n\n<ul>\n<li><a href=\"https://github.com/spring-projects/spring-xd-samples/tree/master/analytics-dashboard\">Twitter Streaming Dashboard</a></li>\n<li><a href=\"https://github.com/spring-projects/spring-xd-samples/tree/master/batch-hashtag-count\">Batch Analysis of Tweet hashtags</a></li>\n<li><a href=\"https://github.com/spring-projects/spring-xd-samples/tree/master/analytics-pmml\">Scoring in real-time with JPMML</a></li>\n</ul><p>This 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 <a href=\"http://hipchat-emoticons.nyh.name/\">new emoticons</a> and <a href=\"http://bit.ly/engineer-dance\">fun images</a></p>\n\n<p>Thanks for all the feedback from early adopters.  Feedback is very important, so please get in touch with questions and comments via</p>\n\n<ul>\n<li>\n<a href=\"http://stackoverflow.com/questions/tagged/spring-xd\">StackOverflow</a> <code>spring-xd</code> tag</li>\n<li>\n<a href=\"https://jira.spring.io/browse/XD/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel\">Spring JIRA</a> or <a href=\"https://github.com/spring-projects/spring-xd/issues\">GitHub Issues</a>\n</li>\n</ul><p><strong>SpringOne 2GX 2014 is around the corner</strong></p>\n\n<p>Book your place at <a href=\"http://www.springone2gx.com/\">SpringOne in Dallas, TX</a> 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.</p>",
    "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" : "<p>Welcome to another installment of <em>This Week in Spring</em>!  This week saw the release of the amazing <a href=\"http://spring.io/projects/spring-xd\">Spring XD 1.0.0.RELEASE</a>. The release announcement is <a href=\"http://spring.io/blog/2014/07/30/spring-xd-1-0-ga-released\">a good place to start your big-data journey</a>. There, you'll find links to other great posts, learning content, etc. This is a <em>great</em> 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 <a href=\"http://spring.io/blog/2014/07/30/spring-xd-1-0-ga-released\">the Spring XD release</a>! (Then, write the data-integration solution to read and organize the rest of them using Spring XD!)</p>\n\n<p>Of course, there's a <em>lot</em> more to say on the matter, and on all matters Spring and things, so be sure to book  your <a href=\"http://www.springone2gx.com/\">place at <strong>SpringOne2GX 2014</strong> in Dallas, TX for Sept 8-11 soon</a>. 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.</p>\n\n<p>With that out of the way, let's get on to this week's roundup...</p>\n\n<ol>\n<li>starting with... <strong>Spring XD 1.0.GA</strong>! I know, I know. We just did this. But, there are some great posts about Spring XD that you might take a moment to read, starting with this <a href=\"http://www.infoq.com/articles/introducing-spring-xd\">great introduction to Spring XD on InfoQ</a>.</li>\n<li>Spring framework 4.1 RC1 dropped last week and this week we have some nice posts on Spring 4.1 features,  <a href=\"http://spring.io/blog/2014/07/28/spring-framework-4-1-spring-mvc-improvements\">including MVC improvements</a> like JSONP, Google Protocol Buffers support, and Java 8 <code>java.util.Optional</code> support where appropriate...</li>\n<li>... and a post on   <a href=\"http://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources\">Spring MVC 4.1's very sensible approach to static  web resource handling</a>. Read the comments, too! There's some great feedback there, too.</li>\n<li>I'll be giving a webinar that <a href=\"https://spring.io/blog/2014/07/29/webinar-microservices-with-spring-boot-sept-16th\">looks at microservices with Spring Boot on September 16th</a> and I hope you'll join me with questions, comments and more.</li>\n<li>Activiti project member Joram Barrez and I will be giving  a webinar introducing <a href=\"https://spring.io/blog/2014/07/29/webinar-process-driven-spring-applications-with-activiti-sept-23rd\">how to use Spring and Activiti to deliver a one-two punch for process-centric applications</a> - join us! </li>\n<li>\n<a href=\"http://spring.io/blog/2014/07/28/spring-data-dijkstra-sr2-released\">Spring Data SR2 has just been released</a>.  This ia service release, and users are encouraged to upgrade at their earliest convenience. </li>\n<li>I was lucky enough to present <a href=\"http://spring.io/blog/2014/07/25/pivotal-toronto-meetup-production-grade-applications-with-spring-boot\">at the Toronto Pivotal Open Source Hub meetup on Spring Boot. The recording's now available online</a>, though I caution you the audio can be a bit choppy at times.</li>\n<li>Spring Cloud lead Ramnivas Laddad put up a <a href=\"https://spring.io/blog/2014/07/29/using-spring-cloud-programmatically\">nice post on how to use Spring Cloud programatically</a> (as opposed to via XML, or even Spring's Java configuration). Spring Cloud is a client for PaaS-bound services like your databases, message brokers, caches, etc. It works on Heroku and Cloud Foundry. Besides working on Spring Cloud, Ramnivas is one of the original contributors to AspectJ and Spring's AOP support, and one of the early, lead architects behind  Cloud Foundry. Ramnivas lives at the intersection between Spring and the cloud, and Spring Cloud is <em>exactly</em> what the doctor ordered!</li>\n<li>Spring Batch lead Michael Minella just announced that <a href=\"http://spring.io/blog/2014/07/28/spring-batch-admin-1-3-0-release-is-available\">Spring Batch Admin 1.3.0</a> is now available. The latest release raises compatibility to the latest-and-greatest third party libraries and also represents the last cut to include the Spring Batch Integration module that now ships as part of Spring Batch 3.0. </li>\n<li>Did you see  Michael Plöd's webinar on why he recommends Spring framework to his customers? The slidedeck's online and, I think, offers a suitably pragmatic look at the reasons  for (and sometimes against) <a href=\"http://speakerdeck.com/mploed/pivotal-webinar-why-do-i-recommend-spring\">using Spring in your next project</a>.<br>\n</li>\n<li>The ZeroTurnaround team has put together a nice look at XRebel, an interactive profile designed to shine a light on performance issues in a running application. They disect the classic <a href=\"http://zeroturnaround.com/blog/spring-mvc-and-xrebel-uncovering-httpession-issues-with-an-interactive-profiler/\">Petclinic sample application's use of sessions and see how they can optimize it</a>. Interesting read!<br>\n</li>\n<li> Idriss Mrabti has put together a nice post explaining how to <a href=\"http://www.javacodegeeks.com/2014/07/jsr-303-loading-messages-from-an-i18n-property-file.html\">load JSR 303 validation messages from internationalized (\"i18n\") <code>MessageSource</code>s managed by Spring</a> - handy! </li>\n<li> Shazin Sadakath has revisited one of his previous posts introductions <a href=\"http://shazsterblog.blogspot.com/2014/07/spring-security-custom-filterchainproxy.html\">to registering and using Spring-managed <code>Filter</code>s with Spring MVC, this time doing so in Java configuration</a>\n</li>\n<li>James Watters, director of product on the Cloud Foundry team, has put together an <em>almost</em>-too-abbreviated  <a href=\"http://www.slideshare.net/wattersjames/pivotal-cf-in-2-slides\">look at   Cloud Foundry's features in 2 slides</a>. I.. tried... but couldn't find anything wrong with this. If you understand those two slides, then you have enough to make the case for Cloud Foundry. Obviously, these aren't implementation instructions so much as  a  darned good first step at making the business case. Why Cloud Foundry for you and me? Because it's a perfect platform to run Spring-based workloads. There. That probably wouldn't even have needed a whole slide. :)</li>\n</ol>",
    "categories" : [ 
        "Engineering"
    ]
},

{
    "_id" : "tag:spring.io,2014-07-30:1717",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Webinar: Process Driven Spring Applications with Activiti - Sept 23rd",
    "content" : "<p>Speakers: Josh Long and Joram Barrez, Activiti </p>\n\n<p>Today'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. </p>\n\n<p>Tuesday, Sept 23rd, 2014 3:00PM BST (London UTC+01:00) <a href=\"http://connect.pivotal.io/OSS_Webinar_ProcessDrivenSpringAppsActiviti7AM_Register.html\">Register</a></p>\n\n<p>Tuesday, Sept 23rd, 2014 10:00 am Pacific Daylight Time (San Francisco, UTC-07:00) <a href=\"http://connect.pivotal.io/OSS_Webinar_ProcessDrivenSpringAppsActiviti10AM_Register.html\">Register</a></p>",
    "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" : "<p> Speaker: Josh Long, Pivotal</p>\n\n<p>Microservices? 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.</p>\n\n<p>Tuesday, Sept 16th, 2014 3:00PM BST (London UTC+01:00) <a href=\"http://connect.pivotal.io/OSS_Webinar_MicroserviceswithSpringBoot-JoshLong7AM_Register.html\">Register</a></p>\n\n<p>Tuesday, Sept 16th, 2014 10:00 am Pacific Daylight Time (San Francisco, UTC-07:00) <a href=\"http://connect.pivotal.io/OSS_Webinar_MicroserviceswithSpringBoot10AM_Register.html\">Register</a></p>",
    "categories" : [ 
        "News and Events"
    ]
},

{
    "_id" : "tag:spring.io,2014-07-15:1690",
    "_class" : "example.springdata.mongodb.textsearch.BlogPost",
    "title" : "Using Spring Cloud programmatically",
    "content" : "<p>In the <a href=\"https://spring.io/blog/2014/06/03/introducing-spring-cloud\">last blog</a>, I showed you how to use <a href=\"http://projects.spring.io/spring-cloud\">Spring Cloud</a>'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.</p>\n\n<p>To work with Spring Cloud we need to access an object of the <code>Cloud</code> class. However, you can’t create a <code>Cloud</code> object directly (its constructor is not public). Instead, you will obtain it through <code>CloudFactory</code>.</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"n\">CloudFactory</span> <span class=\"n\">cloudFactory</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nf\">CloudFactory</span><span class=\"o\">();</span>\n<span class=\"n\">Cloud</span> <span class=\"n\">cloud</span> <span class=\"o\">=</span> <span class=\"n\">cloudFactory</span><span class=\"o\">.</span><span class=\"na\">getCloud</span><span class=\"o\">();</span>\n</pre></div>\n\n<p>The 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 <code>CloudFactory</code> 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.</p>\n\n<p>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 <code>ServiceInfo</code> objects for all services bound to the app and print the JDBC URL for relational services, you could use the following snippet:</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"n\">List</span><span class=\"o\">&lt;</span><span class=\"n\">ServiceInfo</span><span class=\"o\">&gt;</span> <span class=\"n\">serviceInfos</span> <span class=\"o\">=</span> <span class=\"n\">cloud</span><span class=\"o\">.</span><span class=\"na\">getServiceInfos</span><span class=\"o\">();</span>\n<span class=\"k\">for</span> <span class=\"o\">(</span><span class=\"n\">ServiceInfo</span> <span class=\"n\">serviceInfo</span> <span class=\"o\">:</span> <span class=\"n\">serviceInfos</span><span class=\"o\">)</span> <span class=\"o\">{</span>\n    <span class=\"k\">if</span> <span class=\"o\">(</span><span class=\"n\">serviceInfo</span> <span class=\"k\">instanceof</span> <span class=\"n\">RelationalServiceInfo</span><span class=\"o\">)</span> <span class=\"o\">{</span>\n        <span class=\"n\">System</span><span class=\"o\">.</span><span class=\"na\">out</span><span class=\"o\">.</span><span class=\"na\">println</span><span class=\"o\">(((</span><span class=\"n\">RelationalServiceInfo</span><span class=\"o\">)</span> <span class=\"n\">serviceInfo</span><span class=\"o\">).</span><span class=\"na\">getJdbcUrl</span><span class=\"o\">());</span>\n    <span class=\"o\">}</span>\n<span class=\"o\">}</span>\n</pre></div>\n\n<p>This will produce output such as this:</p>\n\n<pre><code>jdbc:postgresql://babar.elephantsql.com:5432/tbsonrjm?user=***&amp;password=***\n</code></pre>\n\n<p>Objects obtained using <code>getServiceInfos()</code> and its variations contain enough information such as URL and credentials to create a service connector. In some cases, obtaining a <code>ServiceInfo</code> object may be all you need, since you can always create suitable connectors (such as a <code>DataSource</code>) 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 <code>DataSource</code> for the \"inventory-db\" service directly, you could use the following snippet:</p>\n\n<pre><code>DataSource inventoryDataSource = \n    cloud.getServiceConnector(\"inventory-db\", DataSource.class, null);\n</code></pre>\n\n<p>There is a variation of this method: <code>getSingletonServiceConnector()</code>, which you can use as follows:</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"n\">DataSource</span> <span class=\"n\">inventoryDataSource</span> <span class=\"o\">=</span> <span class=\"n\">cloud</span><span class=\"o\">.</span><span class=\"na\">getSingletonServiceConnector</span><span class=\"o\">(</span><span class=\"n\">DataSource</span><span class=\"o\">.</span><span class=\"na\">class</span><span class=\"o\">,</span> <span class=\"kc\">null</span><span class=\"o\">);</span>\n</pre></div>\n\n<p>Here, it will return a <code>DataSource</code> 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 <code>null</code> 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.</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"n\">PoolConfig</span> <span class=\"n\">poolConfig</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nf\">PoolConfig</span><span class=\"o\">(</span><span class=\"mi\">20</span><span class=\"o\">,</span> <span class=\"mi\">200</span><span class=\"o\">);</span>\n<span class=\"n\">ConnectionConfig</span> <span class=\"n\">connectionConfig</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nf\">ConnectionConfig</span><span class=\"o\">(</span><span class=\"s\">\"characterEncoding=UTF-8\"</span><span class=\"o\">);</span>\n<span class=\"n\">DataSourceConfig</span> <span class=\"n\">serviceConfig</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nf\">DataSourceConfig</span><span class=\"o\">(</span><span class=\"n\">poolConfig</span><span class=\"o\">,</span> <span class=\"n\">connectionConfig</span><span class=\"o\">);</span>\n<span class=\"n\">DataSource</span> <span class=\"n\">invetoryDataSource</span> <span class=\"o\">=</span> <span class=\"n\">cloud</span><span class=\"o\">.</span><span class=\"na\">getSingletonServiceConnector</span><span class=\"o\">(</span><span class=\"n\">DataSource</span><span class=\"o\">.</span><span class=\"na\">class</span><span class=\"o\">,</span> <span class=\"n\">serviceConfig</span><span class=\"o\">);</span>\n</pre></div>\n\n<p>Last, 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:</p>\n\n<div class=\"highlight highlight-java\"><pre><span class=\"n\">ApplicationInstanceInfo</span> <span class=\"n\">appInstanceInfo</span> <span class=\"o\">=</span> <span class=\"n\">cloud</span><span class=\"o\">.</span><span class=\"na\">getApplicationInstanceInfo</span><span class=\"o\">();</span>\n<span class=\"n\">System</span><span class=\"o\">.</span><span class=\"na\">out</span><span class=\"o\">.</span><span class=\"na\">println</span><span class=\"o\">(</span><span class=\"s\">\"Application id: \"</span> <span class=\"o\">+</span> <span class=\"n\">appInstanceInfo</span><span class=\"o\">.</span><span class=\"na\">getAppId</span><span class=\"o\">());</span>\n<span class=\"n\">System</span><span class=\"o\">.</span><span class=\"na\">out</span><span class=\"o\">.</span><span class=\"na\">println</span><span class=\"o\">(</span><span class=\"s\">\"Application instance id: \"</span> <span class=\"o\">+</span> <span class=\"n\">appInstanceInfo</span><span class=\"o\">.</span><span class=\"na\">getInstanceId</span><span class=\"o\">());</span>\n<span class=\"k\">for</span> <span class=\"o\">(</span><span class=\"n\">Map</span><span class=\"o\">.</span><span class=\"na\">Entry</span><span class=\"o\">&lt;</span><span class=\"n\">String</span><span class=\"o\">,</span> <span class=\"n\">Object</span><span class=\"o\">&gt;</span> <span class=\"nl\">entry:</span> <span class=\"n\">appInstanceInfo</span><span class=\"o\">.</span><span class=\"na\">getProperties</span><span class=\"o\">().</span><span class=\"na\">entrySet</span><span class=\"o\">())</span> <span class=\"o\">{</span>\n    <span class=\"n\">System</span><span class=\"o\">.</span><span class=\"na\">out</span><span class=\"o\">.</span><span class=\"na\">println</span><span class=\"o\">(</span><span class=\"s\">\"Application property: \"</span> <span class=\"o\">+</span> <span class=\"n\">entry</span><span class=\"o\">.</span><span class=\"na\">getKey</span><span class=\"o\">()</span> <span class=\"o\">+</span> <span class=\"s\">\"=\"</span> <span class=\"o\">+</span> <span class=\"n\">entry</span><span class=\"o\">.</span><span class=\"na\">getValue</span><span class=\"o\">());</span>\n<span class=\"o\">}</span>\n</pre></div>\n\n<p>When 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:</p>\n\n<pre>\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</pre>\n\n<p>That 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.</p>",
    "categories" : [ 
        "Engineering"
    ]
}
]