Merge branch '1.5.x'

This commit is contained in:
Andy Wilkinson
2016-09-29 15:49:04 +01:00
36 changed files with 27 additions and 1938 deletions

View File

@@ -83,9 +83,6 @@ The following sample applications are provided:
| link:spring-boot-sample-hibernate4[spring-boot-sample-hibernate52]
| Demonstrates how to use Hibernate 5.2
| link:spring-boot-sample-hornetq[spring-boot-sample-hornetq]
| Message-oriented application using HornetQ
| link:spring-boot-sample-hypermedia[spring-boot-sample-hypermedia]
| Demonstrates Actuator's hypermedia support, including HAL Browser

View File

@@ -47,7 +47,6 @@
<module>spring-boot-sample-hateoas</module>
<module>spring-boot-sample-hibernate4</module>
<module>spring-boot-sample-hibernate52</module>
<module>spring-boot-sample-hornetq</module>
<module>spring-boot-sample-hypermedia</module>
<module>spring-boot-sample-hypermedia-gson</module>
<module>spring-boot-sample-hypermedia-jpa</module>

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-samples</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
</parent>
<artifactId>spring-boot-sample-hornetq</artifactId>
<name>Spring Boot HornetQ Sample</name>
<description>Spring Boot HornetQ Sample</description>
<url>http://projects.spring.io/spring-boot/</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>http://www.spring.io</url>
</organization>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hornetq</artifactId>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jms-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,65 +0,0 @@
/*
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample.hornetq;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor;
@SpringBootApplication
public class SampleHornetQApplication {
@Autowired
private ConnectionFactory connectionFactory;
@Bean
public ScheduledAnnotationBeanPostProcessor scheduledAnnotationBeanPostProcessor() {
return new ScheduledAnnotationBeanPostProcessor();
}
@Bean
public DefaultMessageListenerContainer messageListener() {
DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
container.setConnectionFactory(this.connectionFactory);
container.setDestinationName("testQueue");
container.setMessageListener(new MessageListener() {
@Override
public void onMessage(Message message) {
try {
System.out.println(message.getBody(Object.class));
}
catch (JMSException ex) {
ex.printStackTrace();
}
}
});
return container;
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleHornetQApplication.class, args);
}
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample.hornetq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class Sender {
@Autowired
private JmsTemplate jmsTemplate;
@Scheduled(fixedDelay = 1000L)
public void send() {
this.jmsTemplate.convertAndSend("testQueue", "Hello");
}
}

View File

@@ -1,3 +0,0 @@
spring.hornetq.mode=embedded
spring.hornetq.embedded.enabled=true
spring.hornetq.embedded.queues=testQueue,anotherQueue