Migrated the following modules, nos using parent-boot-2:

spring-protobuf
spring-mockito
spring-mustache
spring-kafka
spring-jooq
spring-cucumber
spring-aop
spring-amqp-simple
This commit is contained in:
geroza 2018-12-19 16:37:10 -02:00
parent 29b4110b34
commit a1b5d77656
9 changed files with 23 additions and 24 deletions

View File

@ -35,7 +35,7 @@ public class SpringAmqpConfig {
} }
@Bean @Bean
SimpleMessageListenerContainer container(ConnectionFactory connectionFactory, SimpleMessageListenerContainer SpringAmqpContainer(ConnectionFactory connectionFactory,
MessageListenerAdapter listenerAdapter) { MessageListenerAdapter listenerAdapter) {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory); container.setConnectionFactory(connectionFactory);

View File

@ -61,7 +61,7 @@ public class BroadcastConfig {
} }
@Bean @Bean
public SimpleRabbitListenerContainerFactory container(ConnectionFactory connectionFactory, SimpleRabbitListenerContainerFactoryConfigurer configurer) { public SimpleRabbitListenerContainerFactory BroadcastContainer(ConnectionFactory connectionFactory, SimpleRabbitListenerContainerFactoryConfigurer configurer) {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
configurer.configure(factory, connectionFactory); configurer.configure(factory, connectionFactory);
return factory; return factory;

View File

@ -0,0 +1,5 @@
spring:
rabbitmq:
username: guest
password: guest
host: localhost

View File

@ -129,6 +129,9 @@
<packageName>com.baeldung.jooq.introduction.db</packageName> <packageName>com.baeldung.jooq.introduction.db</packageName>
<directory>src/main/java</directory> <directory>src/main/java</directory>
</target> </target>
<database>
<inputCatalog></inputCatalog>
</database>
</generator> </generator>
</configuration> </configuration>
</execution> </execution>
@ -185,14 +188,12 @@
</dependencyManagement> </dependencyManagement>
<properties> <properties>
<org.jooq.version>3.8.6</org.jooq.version> <org.jooq.version>3.11.7</org.jooq.version>
<com.h2database.version>1.4.193</com.h2database.version> <com.h2database.version>1.4.193</com.h2database.version>
<org.springframework.version>4.3.17.RELEASE</org.springframework.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version> <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<sql-maven-plugin.version>1.5</sql-maven-plugin.version> <sql-maven-plugin.version>1.5</sql-maven-plugin.version>
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version> <properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
<spring-boot.version>1.5.13.RELEASE</spring-boot.version>
<start-class>org.jooq.example.spring.Application</start-class> <start-class>org.jooq.example.spring.Application</start-class>
</properties> </properties>

View File

@ -30,11 +30,9 @@
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<properties> <properties>
<spring-kafka.version>1.1.3.RELEASE</spring-kafka.version>
<jackson.version>2.6.7</jackson.version> <jackson.version>2.6.7</jackson.version>
</properties> </properties>

View File

@ -22,7 +22,7 @@ public class KafkaApplication {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context = SpringApplication.run(KafkaApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(KafkaApplication.class, args);
MessageProducer producer = context.getBean(MessageProducer.class); MessageProducer producer = context.getBean(MessageProducer.class);
MessageListener listener = context.getBean(MessageListener.class); MessageListener listener = context.getBean(MessageListener.class);
/* /*
@ -102,7 +102,7 @@ public class KafkaApplication {
} }
public void sendMessageToPartion(String message, int partition) { public void sendMessageToPartion(String message, int partition) {
kafkaTemplate.send(partionedTopicName, partition, message); kafkaTemplate.send(partionedTopicName, partition, null, message);
} }
public void sendMessageToFiltered(String message) { public void sendMessageToFiltered(String message) {
@ -124,13 +124,13 @@ public class KafkaApplication {
private CountDownLatch greetingLatch = new CountDownLatch(1); private CountDownLatch greetingLatch = new CountDownLatch(1);
@KafkaListener(topics = "${message.topic.name}", group = "foo", containerFactory = "fooKafkaListenerContainerFactory") @KafkaListener(topics = "${message.topic.name}", groupId = "foo", containerFactory = "fooKafkaListenerContainerFactory")
public void listenGroupFoo(String message) { public void listenGroupFoo(String message) {
System.out.println("Received Messasge in group 'foo': " + message); System.out.println("Received Messasge in group 'foo': " + message);
latch.countDown(); latch.countDown();
} }
@KafkaListener(topics = "${message.topic.name}", group = "bar", containerFactory = "barKafkaListenerContainerFactory") @KafkaListener(topics = "${message.topic.name}", groupId = "bar", containerFactory = "barKafkaListenerContainerFactory")
public void listenGroupBar(String message) { public void listenGroupBar(String message) {
System.out.println("Received Messasge in group 'bar': " + message); System.out.println("Received Messasge in group 'bar': " + message);
latch.countDown(); latch.countDown();

View File

@ -11,7 +11,7 @@ import org.springframework.context.annotation.Profile;
public class NameServiceTestConfiguration { public class NameServiceTestConfiguration {
@Bean @Bean
@Primary @Primary
public NameService nameService() { public NameService nameServiceTest() {
return Mockito.mock(NameService.class); return Mockito.mock(NameService.class);
} }
} }

View File

@ -36,21 +36,10 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<properties> <properties>
<protobuf-java.version>3.1.0</protobuf-java.version> <protobuf-java.version>3.1.0</protobuf-java.version>
<protobuf-java-format.version>1.4</protobuf-java-format.version> <protobuf-java-format.version>1.4</protobuf-java-format.version>
<start-class>com.baeldung.protobuf.Application</start-class>
</properties> </properties>
</project> </project>

View File

@ -4,7 +4,9 @@ import com.baeldung.protobuf.BaeldungTraining.Course;
import com.baeldung.protobuf.BaeldungTraining.Student; import com.baeldung.protobuf.BaeldungTraining.Student;
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneNumber; import com.baeldung.protobuf.BaeldungTraining.Student.PhoneNumber;
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneType; import com.baeldung.protobuf.BaeldungTraining.Student.PhoneType;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter; import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
@ -17,6 +19,10 @@ import java.util.Map;
@SpringBootApplication @SpringBootApplication
public class Application { public class Application {
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class).run(args);
}
@Bean @Bean
RestTemplate restTemplate(ProtobufHttpMessageConverter hmc) { RestTemplate restTemplate(ProtobufHttpMessageConverter hmc) {